@openfin/cloud-interop 0.45.42 → 0.45.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/index.js +37 -18
- package/package.json +31 -26
package/out/index.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
|
|
3
|
-
var ds=Object.defineProperty;var zg=Object.getOwnPropertyDescriptor;var Kg=Object.getOwnPropertyNames;var Gg=Object.prototype.hasOwnProperty;var we=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qt=(t,e)=>{for(var r in e)ds(t,r,{get:e[r],enumerable:!0});},Qg=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kg(e))!Gg.call(t,n)&&n!==r&&ds(t,n,{get:()=>e[n],enumerable:!(i=zg(e,n))||i.enumerable});return t};var X=t=>Qg(ds({},"__esModule",{value:!0}),t);var B,_=we(()=>{B={deviceMemory:8,hardwareConcurrency:8,language:"en-US"};});var P={};Qt(P,{_debugEnd:()=>yu,_debugProcess:()=>gu,_events:()=>ku,_eventsCount:()=>xu,_exiting:()=>Yl,_fatalExceptions:()=>cu,_getActiveHandles:()=>eu,_getActiveRequests:()=>Zl,_kill:()=>ru,_linkedBinding:()=>Gl,_maxListeners:()=>Ou,_preload_modules:()=>Cu,_rawDebug:()=>zl,_startProfilerIdleNotifier:()=>bu,_stopProfilerIdleNotifier:()=>wu,_tickCallback:()=>pu,abort:()=>Eu,addListener:()=>Mu,allowedNodeEnvironmentFlags:()=>lu,arch:()=>xl,argv:()=>Ul,argv0:()=>Ru,assert:()=>uu,binding:()=>Fl,chdir:()=>Hl,config:()=>Jl,cpuUsage:()=>Fi,cwd:()=>$l,debugPort:()=>Tu,default:()=>$u,dlopen:()=>Xl,domain:()=>Ql,emit:()=>Du,emitWarning:()=>jl,env:()=>Ll,execArgv:()=>Nl,execPath:()=>Iu,exit:()=>ou,features:()=>fu,hasUncaughtExceptionCaptureCallback:()=>du,hrtime:()=>ji,kill:()=>su,listeners:()=>Wu,memoryUsage:()=>nu,moduleLoadList:()=>Kl,nextTick:()=>Pl,off:()=>Uu,on:()=>bt,once:()=>Lu,openStdin:()=>au,pid:()=>Su,platform:()=>Ml,ppid:()=>Au,prependListener:()=>ju,prependOnceListener:()=>Fu,reallyExit:()=>tu,release:()=>Vl,removeAllListeners:()=>qu,removeListener:()=>Nu,resourceUsage:()=>iu,setSourceMapsEnabled:()=>Bu,setUncaughtExceptionCaptureCallback:()=>hu,stderr:()=>mu,stdin:()=>vu,stdout:()=>_u,title:()=>kl,umask:()=>Wl,uptime:()=>Pu,version:()=>ql,versions:()=>Dl});function ys(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Yg(){!xr||!Yt||(xr=!1,Yt.length?yt=Yt.concat(yt):Di=-1,yt.length&&Bl());}function Bl(){if(!xr){var t=setTimeout(Yg,0);xr=!0;for(var e=yt.length;e;){for(Yt=yt,yt=[];++Di<e;)Yt&&Yt[Di].run();Di=-1,e=yt.length;}Yt=null,xr=!1,clearTimeout(t);}}function Pl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];yt.push(new Ol(t,e)),yt.length===1&&!xr&&setTimeout(Bl,0);}function Ol(t,e){this.fun=t,this.array=e;}function ve(){}function Gl(t){ys("_linkedBinding");}function Xl(t){ys("dlopen");}function Zl(){return []}function eu(){return []}function uu(t,e){if(!t)throw new Error(e||"assertion error")}function du(){return !1}function Pu(){return Mt.now()/1e3}function ji(t){var e=Math.floor((Date.now()-Mt.now())*.001),r=Mt.now()*.001,i=Math.floor(r)+e,n=Math.floor(r%1*1e9);return t&&(i=i-t[0],n=n-t[1],n<0&&(i--,n+=gs)),[i,n]}function bt(){return $u}function Wu(t){return []}var yt,xr,Yt,Di,kl,xl,Ml,Ll,Ul,Nl,ql,Dl,jl,Fl,Wl,$l,Hl,Vl,zl,Kl,Ql,Yl,Jl,tu,ru,Fi,iu,nu,su,ou,au,lu,fu,cu,hu,pu,gu,yu,bu,wu,_u,mu,vu,Eu,Su,Au,Iu,Tu,Ru,Cu,Bu,Mt,ps,gs,Ou,ku,xu,Mu,Lu,Uu,Nu,qu,Du,ju,Fu,$u,Hu=we(()=>{v();m();_();yt=[],xr=!1,Di=-1;Ol.prototype.run=function(){this.fun.apply(null,this.array);};kl="browser",xl="x64",Ml="browser",Ll={PATH:"/usr/bin",LANG:B.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Ul=["/usr/bin/node"],Nl=[],ql="v16.8.0",Dl={},jl=function(t,e){console.warn((e?e+": ":"")+t);},Fl=function(t){ys("binding");},Wl=function(t){return 0},$l=function(){return "/"},Hl=function(t){},Vl={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};zl=ve,Kl=[];Ql={},Yl=!1,Jl={};tu=ve,ru=ve,Fi=function(){return {}},iu=Fi,nu=Fi,su=ve,ou=ve,au=ve,lu={};fu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},cu=ve,hu=ve;pu=ve,gu=ve,yu=ve,bu=ve,wu=ve,_u=void 0,mu=void 0,vu=void 0,Eu=ve,Su=2,Au=1,Iu="/bin/usr/node",Tu=9229,Ru="node",Cu=[],Bu=ve,Mt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Mt.now===void 0&&(ps=Date.now(),Mt.timing&&Mt.timing.navigationStart&&(ps=Mt.timing.navigationStart),Mt.now=()=>Date.now()-ps);gs=1e9;ji.bigint=function(t){var e=ji(t);return typeof BigInt>"u"?e[0]*gs+e[1]:BigInt(e[0]*gs)+BigInt(e[1])};Ou=10,ku={},xu=0;Mu=bt,Lu=bt,Uu=bt,Nu=bt,qu=bt,Du=ve,ju=bt,Fu=bt;$u={version:ql,versions:Dl,arch:xl,platform:Ml,release:Vl,_rawDebug:zl,moduleLoadList:Kl,binding:Fl,_linkedBinding:Gl,_events:ku,_eventsCount:xu,_maxListeners:Ou,on:bt,addListener:Mu,once:Lu,off:Uu,removeListener:Nu,removeAllListeners:qu,emit:Du,prependListener:ju,prependOnceListener:Fu,listeners:Wu,domain:Ql,_exiting:Yl,config:Jl,dlopen:Xl,uptime:Pu,_getActiveRequests:Zl,_getActiveHandles:eu,reallyExit:tu,_kill:ru,cpuUsage:Fi,resourceUsage:iu,memoryUsage:nu,kill:su,exit:ou,openStdin:au,allowedNodeEnvironmentFlags:lu,assert:uu,features:fu,_fatalExceptions:cu,setUncaughtExceptionCaptureCallback:hu,hasUncaughtExceptionCaptureCallback:du,emitWarning:jl,nextTick:Pl,_tickCallback:pu,_debugProcess:gu,_debugEnd:yu,_startProfilerIdleNotifier:bu,_stopProfilerIdleNotifier:wu,stdout:_u,stdin:vu,stderr:mu,abort:Eu,umask:Wl,chdir:Hl,cwd:$l,env:Ll,title:kl,argv:Ul,execArgv:Nl,pid:Su,ppid:Au,execPath:Iu,debugPort:Tu,hrtime:ji,argv0:Ru,_preload_modules:Cu,setSourceMapsEnabled:Bu};});var m=we(()=>{Hu();});var _e={};Qt(_e,{Buffer:()=>x,INSPECT_MAX_BYTES:()=>ey,default:()=>Lt,kMaxLength:()=>ty});function Jg(){if(Vu)return ui;Vu=!0,ui.byteLength=a,ui.toByteArray=c,ui.fromByteArray=g;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)t[n]=i[n],e[i.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function s(y){var w=y.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=y.indexOf("=");E===-1&&(E=w);var S=E===w?0:4-E%4;return [E,S]}function a(y){var w=s(y),E=w[0],S=w[1];return (E+S)*3/4-S}function u(y,w,E){return (w+E)*3/4-E}function c(y){var w,E=s(y),S=E[0],I=E[1],C=new r(u(y,S,I)),R=0,U=I>0?S-4:S,N;for(N=0;N<U;N+=4)w=e[y.charCodeAt(N)]<<18|e[y.charCodeAt(N+1)]<<12|e[y.charCodeAt(N+2)]<<6|e[y.charCodeAt(N+3)],C[R++]=w>>16&255,C[R++]=w>>8&255,C[R++]=w&255;return I===2&&(w=e[y.charCodeAt(N)]<<2|e[y.charCodeAt(N+1)]>>4,C[R++]=w&255),I===1&&(w=e[y.charCodeAt(N)]<<10|e[y.charCodeAt(N+1)]<<4|e[y.charCodeAt(N+2)]>>2,C[R++]=w>>8&255,C[R++]=w&255),C}function h(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function d(y,w,E){for(var S,I=[],C=w;C<E;C+=3)S=(y[C]<<16&16711680)+(y[C+1]<<8&65280)+(y[C+2]&255),I.push(h(S));return I.join("")}function g(y){for(var w,E=y.length,S=E%3,I=[],C=16383,R=0,U=E-S;R<U;R+=C)I.push(d(y,R,R+C>U?U:R+C));return S===1?(w=y[E-1],I.push(t[w>>2]+t[w<<4&63]+"==")):S===2&&(w=(y[E-2]<<8)+y[E-1],I.push(t[w>>10]+t[w>>4&63]+t[w<<2&63]+"=")),I.join("")}return ui}function Xg(){if(zu)return Wi;zu=!0;return Wi.read=function(t,e,r,i,n){var o,s,a=n*8-i-1,u=(1<<a)-1,c=u>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=o*256+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=s*256+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else {if(o===u)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c;}return (y?-1:1)*s*Math.pow(2,o-i)},Wi.write=function(t,e,r,i,n,o){var s,a,u,c=o*8-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,w=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+d>=1?e+=g/u:e+=g*Math.pow(2,1-d),e*u>=2&&(s++,u/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*u-1)*Math.pow(2,n),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=a&255,y+=w,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=s&255,y+=w,s/=256,c-=8);t[r+y-w]|=E*128;},Wi}function Zg(){if(Ku)return Jt;Ku=!0;let t=Jg(),e=Xg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=s,Jt.SlowBuffer=I,Jt.INSPECT_MAX_BYTES=50;let i=2147483647;Jt.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=n(),!s.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 n(){try{let p=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(p,l),p.foo()===42}catch{return !1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(p){if(p>i)throw new RangeError('The value "'+p+'" is invalid for option "size"');let l=new Uint8Array(p);return Object.setPrototypeOf(l,s.prototype),l}function s(p,l,f){if(typeof p=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(p)}return a(p,l,f)}s.poolSize=8192;function a(p,l,f){if(typeof p=="string")return d(p,l);if(ArrayBuffer.isView(p))return y(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(Ye(p,ArrayBuffer)||p&&Ye(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ye(p,SharedArrayBuffer)||p&&Ye(p.buffer,SharedArrayBuffer)))return w(p,l,f);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let b=p.valueOf&&p.valueOf();if(b!=null&&b!==p)return s.from(b,l,f);let A=E(p);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return s.from(p[Symbol.toPrimitive]("string"),l,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}s.from=function(p,l,f){return a(p,l,f)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function c(p,l,f){return u(p),p<=0?o(p):l!==void 0?typeof f=="string"?o(p).fill(l,f):o(p).fill(l):o(p)}s.alloc=function(p,l,f){return c(p,l,f)};function h(p){return u(p),o(p<0?0:S(p)|0)}s.allocUnsafe=function(p){return h(p)},s.allocUnsafeSlow=function(p){return h(p)};function d(p,l){if((typeof l!="string"||l==="")&&(l="utf8"),!s.isEncoding(l))throw new TypeError("Unknown encoding: "+l);let f=C(p,l)|0,b=o(f),A=b.write(p,l);return A!==f&&(b=b.slice(0,A)),b}function g(p){let l=p.length<0?0:S(p.length)|0,f=o(l);for(let b=0;b<l;b+=1)f[b]=p[b]&255;return f}function y(p){if(Ye(p,Uint8Array)){let l=new Uint8Array(p);return w(l.buffer,l.byteOffset,l.byteLength)}return g(p)}function w(p,l,f){if(l<0||p.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');let b;return l===void 0&&f===void 0?b=new Uint8Array(p):f===void 0?b=new Uint8Array(p,l):b=new Uint8Array(p,l,f),Object.setPrototypeOf(b,s.prototype),b}function E(p){if(s.isBuffer(p)){let l=S(p.length)|0,f=o(l);return f.length===0||p.copy(f,0,0,l),f}if(p.length!==void 0)return typeof p.length!="number"||hs(p.length)?o(0):g(p);if(p.type==="Buffer"&&Array.isArray(p.data))return g(p.data)}function S(p){if(p>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return p|0}function I(p){return +p!=p&&(p=0),s.alloc(+p)}s.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==s.prototype},s.compare=function(l,f){if(Ye(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),Ye(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(l)||!s.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===f)return 0;let b=l.length,A=f.length;for(let T=0,O=Math.min(b,A);T<O;++T)if(l[T]!==f[T]){b=l[T],A=f[T];break}return b<A?-1:A<b?1:0},s.isEncoding=function(l){switch(String(l).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}},s.concat=function(l,f){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return s.alloc(0);let b;if(f===void 0)for(f=0,b=0;b<l.length;++b)f+=l[b].length;let A=s.allocUnsafe(f),T=0;for(b=0;b<l.length;++b){let O=l[b];if(Ye(O,Uint8Array))T+O.length>A.length?(s.isBuffer(O)||(O=s.from(O)),O.copy(A,T)):Uint8Array.prototype.set.call(A,O,T);else if(s.isBuffer(O))O.copy(A,T);else throw new TypeError('"list" argument must be an Array of Buffers');T+=O.length;}return A};function C(p,l){if(s.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Ye(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let f=p.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&f===0)return 0;let A=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return cs(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Cl(p).length;default:if(A)return b?-1:cs(p).length;l=(""+l).toLowerCase(),A=!0;}}s.byteLength=C;function R(p,l,f){let b=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return "";for(p||(p="utf8");;)switch(p){case"hex":return Ng(this,l,f);case"utf8":case"utf-8":return Cr(this,l,f);case"ascii":return us(this,l,f);case"latin1":case"binary":return Ug(this,l,f);case"base64":return pe(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qg(this,l,f);default:if(b)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),b=!0;}}s.prototype._isBuffer=!0;function U(p,l,f){let b=p[l];p[l]=p[f],p[f]=b;}s.prototype.swap16=function(){let l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<l;f+=2)U(this,f,f+1);return this},s.prototype.swap32=function(){let l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<l;f+=4)U(this,f,f+3),U(this,f+1,f+2);return this},s.prototype.swap64=function(){let l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<l;f+=8)U(this,f,f+7),U(this,f+1,f+6),U(this,f+2,f+5),U(this,f+3,f+4);return this},s.prototype.toString=function(){let l=this.length;return l===0?"":arguments.length===0?Cr(this,0,l):R.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(l){if(!s.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:s.compare(this,l)===0},s.prototype.inspect=function(){let l="",f=Jt.INSPECT_MAX_BYTES;return l=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(l+=" ... "),"<Buffer "+l+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(l,f,b,A,T){if(Ye(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),!s.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(f===void 0&&(f=0),b===void 0&&(b=l?l.length:0),A===void 0&&(A=0),T===void 0&&(T=this.length),f<0||b>l.length||A<0||T>this.length)throw new RangeError("out of range index");if(A>=T&&f>=b)return 0;if(A>=T)return -1;if(f>=b)return 1;if(f>>>=0,b>>>=0,A>>>=0,T>>>=0,this===l)return 0;let O=T-A,$=b-f,se=Math.min(O,$),te=this.slice(A,T),oe=l.slice(f,b);for(let J=0;J<se;++J)if(te[J]!==oe[J]){O=te[J],$=oe[J];break}return O<$?-1:$<O?1:0};function N(p,l,f,b,A){if(p.length===0)return -1;if(typeof f=="string"?(b=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,hs(f)&&(f=A?0:p.length-1),f<0&&(f=p.length+f),f>=p.length){if(A)return -1;f=p.length-1;}else if(f<0)if(A)f=0;else return -1;if(typeof l=="string"&&(l=s.from(l,b)),s.isBuffer(l))return l.length===0?-1:W(p,l,f,b,A);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(p,l,f):Uint8Array.prototype.lastIndexOf.call(p,l,f):W(p,[l],f,b,A);throw new TypeError("val must be string, number or Buffer")}function W(p,l,f,b,A){let T=1,O=p.length,$=l.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(p.length<2||l.length<2)return -1;T=2,O/=2,$/=2,f/=2;}function se(oe,J){return T===1?oe[J]:oe.readUInt16BE(J*T)}let te;if(A){let oe=-1;for(te=f;te<O;te++)if(se(p,te)===se(l,oe===-1?0:te-oe)){if(oe===-1&&(oe=te),te-oe+1===$)return oe*T}else oe!==-1&&(te-=te-oe),oe=-1;}else for(f+$>O&&(f=O-$),te=f;te>=0;te--){let oe=!0;for(let J=0;J<$;J++)if(se(p,te+J)!==se(l,J)){oe=!1;break}if(oe)return te}return -1}s.prototype.includes=function(l,f,b){return this.indexOf(l,f,b)!==-1},s.prototype.indexOf=function(l,f,b){return N(this,l,f,b,!0)},s.prototype.lastIndexOf=function(l,f,b){return N(this,l,f,b,!1)};function K(p,l,f,b){f=Number(f)||0;let A=p.length-f;b?(b=Number(b),b>A&&(b=A)):b=A;let T=l.length;b>T/2&&(b=T/2);let O;for(O=0;O<b;++O){let $=parseInt(l.substr(O*2,2),16);if(hs($))return O;p[f+O]=$;}return O}function z(p,l,f,b){return qi(cs(l,p.length-f),p,f,b)}function Q(p,l,f,b){return qi(Wg(l),p,f,b)}function de(p,l,f,b){return qi(Cl(l),p,f,b)}function Gt(p,l,f,b){return qi($g(l,p.length-f),p,f,b)}s.prototype.write=function(l,f,b,A){if(f===void 0)A="utf8",b=this.length,f=0;else if(b===void 0&&typeof f=="string")A=f,b=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(b)?(b=b>>>0,A===void 0&&(A="utf8")):(A=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let T=this.length-f;if((b===void 0||b>T)&&(b=T),l.length>0&&(b<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let O=!1;for(;;)switch(A){case"hex":return K(this,l,f,b);case"utf8":case"utf-8":return z(this,l,f,b);case"ascii":case"latin1":case"binary":return Q(this,l,f,b);case"base64":return de(this,l,f,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gt(this,l,f,b);default:if(O)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),O=!0;}},s.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function pe(p,l,f){return l===0&&f===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(l,f))}function Cr(p,l,f){f=Math.min(p.length,f);let b=[],A=l;for(;A<f;){let T=p[A],O=null,$=T>239?4:T>223?3:T>191?2:1;if(A+$<=f){let se,te,oe,J;switch($){case 1:T<128&&(O=T);break;case 2:se=p[A+1],(se&192)===128&&(J=(T&31)<<6|se&63,J>127&&(O=J));break;case 3:se=p[A+1],te=p[A+2],(se&192)===128&&(te&192)===128&&(J=(T&15)<<12|(se&63)<<6|te&63,J>2047&&(J<55296||J>57343)&&(O=J));break;case 4:se=p[A+1],te=p[A+2],oe=p[A+3],(se&192)===128&&(te&192)===128&&(oe&192)===128&&(J=(T&15)<<18|(se&63)<<12|(te&63)<<6|oe&63,J>65535&&J<1114112&&(O=J));}}O===null?(O=65533,$=1):O>65535&&(O-=65536,b.push(O>>>10&1023|55296),O=56320|O&1023),b.push(O),A+=$;}return Pr(b)}let Br=4096;function Pr(p){let l=p.length;if(l<=Br)return String.fromCharCode.apply(String,p);let f="",b=0;for(;b<l;)f+=String.fromCharCode.apply(String,p.slice(b,b+=Br));return f}function us(p,l,f){let b="";f=Math.min(p.length,f);for(let A=l;A<f;++A)b+=String.fromCharCode(p[A]&127);return b}function Ug(p,l,f){let b="";f=Math.min(p.length,f);for(let A=l;A<f;++A)b+=String.fromCharCode(p[A]);return b}function Ng(p,l,f){let b=p.length;(!l||l<0)&&(l=0),(!f||f<0||f>b)&&(f=b);let A="";for(let T=l;T<f;++T)A+=Hg[p[T]];return A}function qg(p,l,f){let b=p.slice(l,f),A="";for(let T=0;T<b.length-1;T+=2)A+=String.fromCharCode(b[T]+b[T+1]*256);return A}s.prototype.slice=function(l,f){let b=this.length;l=~~l,f=f===void 0?b:~~f,l<0?(l+=b,l<0&&(l=0)):l>b&&(l=b),f<0?(f+=b,f<0&&(f=0)):f>b&&(f=b),f<l&&(f=l);let A=this.subarray(l,f);return Object.setPrototypeOf(A,s.prototype),A};function ge(p,l,f){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+l>f)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(l,f,b){l=l>>>0,f=f>>>0,b||ge(l,f,this.length);let A=this[l],T=1,O=0;for(;++O<f&&(T*=256);)A+=this[l+O]*T;return A},s.prototype.readUintBE=s.prototype.readUIntBE=function(l,f,b){l=l>>>0,f=f>>>0,b||ge(l,f,this.length);let A=this[l+--f],T=1;for(;f>0&&(T*=256);)A+=this[l+--f]*T;return A},s.prototype.readUint8=s.prototype.readUInt8=function(l,f){return l=l>>>0,f||ge(l,1,this.length),this[l]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(l,f){return l=l>>>0,f||ge(l,2,this.length),this[l]|this[l+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(l,f){return l=l>>>0,f||ge(l,2,this.length),this[l]<<8|this[l+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},s.prototype.readBigUInt64LE=xt(function(l){l=l>>>0,kr(l,"offset");let f=this[l],b=this[l+7];(f===void 0||b===void 0)&&li(l,this.length-8);let A=f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,T=this[++l]+this[++l]*2**8+this[++l]*2**16+b*2**24;return BigInt(A)+(BigInt(T)<<BigInt(32))}),s.prototype.readBigUInt64BE=xt(function(l){l=l>>>0,kr(l,"offset");let f=this[l],b=this[l+7];(f===void 0||b===void 0)&&li(l,this.length-8);let A=f*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],T=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+b;return (BigInt(A)<<BigInt(32))+BigInt(T)}),s.prototype.readIntLE=function(l,f,b){l=l>>>0,f=f>>>0,b||ge(l,f,this.length);let A=this[l],T=1,O=0;for(;++O<f&&(T*=256);)A+=this[l+O]*T;return T*=128,A>=T&&(A-=Math.pow(2,8*f)),A},s.prototype.readIntBE=function(l,f,b){l=l>>>0,f=f>>>0,b||ge(l,f,this.length);let A=f,T=1,O=this[l+--A];for(;A>0&&(T*=256);)O+=this[l+--A]*T;return T*=128,O>=T&&(O-=Math.pow(2,8*f)),O},s.prototype.readInt8=function(l,f){return l=l>>>0,f||ge(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},s.prototype.readInt16LE=function(l,f){l=l>>>0,f||ge(l,2,this.length);let b=this[l]|this[l+1]<<8;return b&32768?b|4294901760:b},s.prototype.readInt16BE=function(l,f){l=l>>>0,f||ge(l,2,this.length);let b=this[l+1]|this[l]<<8;return b&32768?b|4294901760:b},s.prototype.readInt32LE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},s.prototype.readInt32BE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},s.prototype.readBigInt64LE=xt(function(l){l=l>>>0,kr(l,"offset");let f=this[l],b=this[l+7];(f===void 0||b===void 0)&&li(l,this.length-8);let A=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(b<<24);return (BigInt(A)<<BigInt(32))+BigInt(f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),s.prototype.readBigInt64BE=xt(function(l){l=l>>>0,kr(l,"offset");let f=this[l],b=this[l+7];(f===void 0||b===void 0)&&li(l,this.length-8);let A=(f<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return (BigInt(A)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+b)}),s.prototype.readFloatLE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),e.read(this,l,!0,23,4)},s.prototype.readFloatBE=function(l,f){return l=l>>>0,f||ge(l,4,this.length),e.read(this,l,!1,23,4)},s.prototype.readDoubleLE=function(l,f){return l=l>>>0,f||ge(l,8,this.length),e.read(this,l,!0,52,8)},s.prototype.readDoubleBE=function(l,f){return l=l>>>0,f||ge(l,8,this.length),e.read(this,l,!1,52,8)};function Ce(p,l,f,b,A,T){if(!s.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>A||l<T)throw new RangeError('"value" argument is out of bounds');if(f+b>p.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(l,f,b,A){if(l=+l,f=f>>>0,b=b>>>0,!A){let $=Math.pow(2,8*b)-1;Ce(this,l,f,b,$,0);}let T=1,O=0;for(this[f]=l&255;++O<b&&(T*=256);)this[f+O]=l/T&255;return f+b},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(l,f,b,A){if(l=+l,f=f>>>0,b=b>>>0,!A){let $=Math.pow(2,8*b)-1;Ce(this,l,f,b,$,0);}let T=b-1,O=1;for(this[f+T]=l&255;--T>=0&&(O*=256);)this[f+T]=l/O&255;return f+b},s.prototype.writeUint8=s.prototype.writeUInt8=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,1,255,0),this[f]=l&255,f+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,2,65535,0),this[f]=l&255,this[f+1]=l>>>8,f+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,2,65535,0),this[f]=l>>>8,this[f+1]=l&255,f+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,4,4294967295,0),this[f+3]=l>>>24,this[f+2]=l>>>16,this[f+1]=l>>>8,this[f]=l&255,f+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,4,4294967295,0),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4};function vl(p,l,f,b,A){Rl(l,b,A,p,f,7);let T=Number(l&BigInt(4294967295));p[f++]=T,T=T>>8,p[f++]=T,T=T>>8,p[f++]=T,T=T>>8,p[f++]=T;let O=Number(l>>BigInt(32)&BigInt(4294967295));return p[f++]=O,O=O>>8,p[f++]=O,O=O>>8,p[f++]=O,O=O>>8,p[f++]=O,f}function El(p,l,f,b,A){Rl(l,b,A,p,f,7);let T=Number(l&BigInt(4294967295));p[f+7]=T,T=T>>8,p[f+6]=T,T=T>>8,p[f+5]=T,T=T>>8,p[f+4]=T;let O=Number(l>>BigInt(32)&BigInt(4294967295));return p[f+3]=O,O=O>>8,p[f+2]=O,O=O>>8,p[f+1]=O,O=O>>8,p[f]=O,f+8}s.prototype.writeBigUInt64LE=xt(function(l,f=0){return vl(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=xt(function(l,f=0){return El(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(l,f,b,A){if(l=+l,f=f>>>0,!A){let se=Math.pow(2,8*b-1);Ce(this,l,f,b,se-1,-se);}let T=0,O=1,$=0;for(this[f]=l&255;++T<b&&(O*=256);)l<0&&$===0&&this[f+T-1]!==0&&($=1),this[f+T]=(l/O>>0)-$&255;return f+b},s.prototype.writeIntBE=function(l,f,b,A){if(l=+l,f=f>>>0,!A){let se=Math.pow(2,8*b-1);Ce(this,l,f,b,se-1,-se);}let T=b-1,O=1,$=0;for(this[f+T]=l&255;--T>=0&&(O*=256);)l<0&&$===0&&this[f+T+1]!==0&&($=1),this[f+T]=(l/O>>0)-$&255;return f+b},s.prototype.writeInt8=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,1,127,-128),l<0&&(l=255+l+1),this[f]=l&255,f+1},s.prototype.writeInt16LE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,2,32767,-32768),this[f]=l&255,this[f+1]=l>>>8,f+2},s.prototype.writeInt16BE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,2,32767,-32768),this[f]=l>>>8,this[f+1]=l&255,f+2},s.prototype.writeInt32LE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,4,2147483647,-2147483648),this[f]=l&255,this[f+1]=l>>>8,this[f+2]=l>>>16,this[f+3]=l>>>24,f+4},s.prototype.writeInt32BE=function(l,f,b){return l=+l,f=f>>>0,b||Ce(this,l,f,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4},s.prototype.writeBigInt64LE=xt(function(l,f=0){return vl(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=xt(function(l,f=0){return El(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Sl(p,l,f,b,A,T){if(f+b>p.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Al(p,l,f,b,A){return l=+l,f=f>>>0,A||Sl(p,l,f,4),e.write(p,l,f,b,23,4),f+4}s.prototype.writeFloatLE=function(l,f,b){return Al(this,l,f,!0,b)},s.prototype.writeFloatBE=function(l,f,b){return Al(this,l,f,!1,b)};function Il(p,l,f,b,A){return l=+l,f=f>>>0,A||Sl(p,l,f,8),e.write(p,l,f,b,52,8),f+8}s.prototype.writeDoubleLE=function(l,f,b){return Il(this,l,f,!0,b)},s.prototype.writeDoubleBE=function(l,f,b){return Il(this,l,f,!1,b)},s.prototype.copy=function(l,f,b,A){if(!s.isBuffer(l))throw new TypeError("argument should be a Buffer");if(b||(b=0),!A&&A!==0&&(A=this.length),f>=l.length&&(f=l.length),f||(f=0),A>0&&A<b&&(A=b),A===b||l.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=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),l.length-f<A-b&&(A=l.length-f+b);let T=A-b;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,b,A):Uint8Array.prototype.set.call(l,this.subarray(b,A),f),T},s.prototype.fill=function(l,f,b,A){if(typeof l=="string"){if(typeof f=="string"?(A=f,f=0,b=this.length):typeof b=="string"&&(A=b,b=this.length),A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!s.isEncoding(A))throw new TypeError("Unknown encoding: "+A);if(l.length===1){let O=l.charCodeAt(0);(A==="utf8"&&O<128||A==="latin1")&&(l=O);}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(f<0||this.length<f||this.length<b)throw new RangeError("Out of range index");if(b<=f)return this;f=f>>>0,b=b===void 0?this.length:b>>>0,l||(l=0);let T;if(typeof l=="number")for(T=f;T<b;++T)this[T]=l;else {let O=s.isBuffer(l)?l:s.from(l,A),$=O.length;if($===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(T=0;T<b-f;++T)this[T+f]=O[T%$];}return this};let Or={};function fs(p,l,f){Or[p]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name;}get code(){return p}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0});}toString(){return `${this.name} [${p}]: ${this.message}`}};}fs("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),fs("ERR_INVALID_ARG_TYPE",function(p,l){return `The "${p}" argument must be of type number. Received type ${typeof l}`},TypeError),fs("ERR_OUT_OF_RANGE",function(p,l,f){let b=`The value of "${p}" is out of range.`,A=f;return Number.isInteger(f)&&Math.abs(f)>2**32?A=Tl(String(f)):typeof f=="bigint"&&(A=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(A=Tl(A)),A+="n"),b+=` It must be ${l}. Received ${A}`,b},RangeError);function Tl(p){let l="",f=p.length,b=p[0]==="-"?1:0;for(;f>=b+4;f-=3)l=`_${p.slice(f-3,f)}${l}`;return `${p.slice(0,f)}${l}`}function Dg(p,l,f){kr(l,"offset"),(p[l]===void 0||p[l+f]===void 0)&&li(l,p.length-(f+1));}function Rl(p,l,f,b,A,T){if(p>f||p<l){let O=typeof l=="bigint"?"n":"",$;throw T>3?l===0||l===BigInt(0)?$=`>= 0${O} and < 2${O} ** ${(T+1)*8}${O}`:$=`>= -(2${O} ** ${(T+1)*8-1}${O}) and < 2 ** ${(T+1)*8-1}${O}`:$=`>= ${l}${O} and <= ${f}${O}`,new Or.ERR_OUT_OF_RANGE("value",$,p)}Dg(b,A,T);}function kr(p,l){if(typeof p!="number")throw new Or.ERR_INVALID_ARG_TYPE(l,"number",p)}function li(p,l,f){throw Math.floor(p)!==p?(kr(p,f),new Or.ERR_OUT_OF_RANGE(f||"offset","an integer",p)):l<0?new Or.ERR_BUFFER_OUT_OF_BOUNDS:new Or.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${l}`,p)}let jg=/[^+/0-9A-Za-z-_]/g;function Fg(p){if(p=p.split("=")[0],p=p.trim().replace(jg,""),p.length<2)return "";for(;p.length%4!==0;)p=p+"=";return p}function cs(p,l){l=l||1/0;let f,b=p.length,A=null,T=[];for(let O=0;O<b;++O){if(f=p.charCodeAt(O),f>55295&&f<57344){if(!A){if(f>56319){(l-=3)>-1&&T.push(239,191,189);continue}else if(O+1===b){(l-=3)>-1&&T.push(239,191,189);continue}A=f;continue}if(f<56320){(l-=3)>-1&&T.push(239,191,189),A=f;continue}f=(A-55296<<10|f-56320)+65536;}else A&&(l-=3)>-1&&T.push(239,191,189);if(A=null,f<128){if((l-=1)<0)break;T.push(f);}else if(f<2048){if((l-=2)<0)break;T.push(f>>6|192,f&63|128);}else if(f<65536){if((l-=3)<0)break;T.push(f>>12|224,f>>6&63|128,f&63|128);}else if(f<1114112){if((l-=4)<0)break;T.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128);}else throw new Error("Invalid code point")}return T}function Wg(p){let l=[];for(let f=0;f<p.length;++f)l.push(p.charCodeAt(f)&255);return l}function $g(p,l){let f,b,A,T=[];for(let O=0;O<p.length&&!((l-=2)<0);++O)f=p.charCodeAt(O),b=f>>8,A=f%256,T.push(A),T.push(b);return T}function Cl(p){return t.toByteArray(Fg(p))}function qi(p,l,f,b){let A;for(A=0;A<b&&!(A+f>=l.length||A>=p.length);++A)l[A+f]=p[A];return A}function Ye(p,l){return p instanceof l||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===l.name}function hs(p){return p!==p}let Hg=function(){let p="0123456789abcdef",l=new Array(256);for(let f=0;f<16;++f){let b=f*16;for(let A=0;A<16;++A)l[b+A]=p[f]+p[A];}return l}();function xt(p){return typeof BigInt>"u"?Vg:p}function Vg(){throw new Error("BigInt not supported")}return Jt}var ui,Vu,Wi,zu,Jt,Ku,Lt,x,ey,ty,ye=we(()=>{v();m();_();ui={},Vu=!1;Wi={},zu=!1;Jt={},Ku=!1;Lt=Zg();Lt.Buffer;Lt.SlowBuffer;Lt.INSPECT_MAX_BYTES;Lt.kMaxLength;x=Lt.Buffer,ey=Lt.INSPECT_MAX_BYTES,ty=Lt.kMaxLength;});var v=we(()=>{ye();});var Gu=M(ws=>{v();m();_();Object.defineProperty(ws,"__esModule",{value:!0});var bs=class{constructor(e){this.aliasToTopic={},this.max=e;}put(e,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={};}};ws.default=bs;});var ce=M((PA,Qu)=>{v();m();_();Qu.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Uint8Array};});var Je=M((jA,ms)=>{v();m();_();var ry=(ye(),X(_e)),iy=Object.getPrototypeOf(async function(){}).constructor,Yu=globalThis.Blob||ry.Blob,ny=typeof Yu<"u"?function(e){return e instanceof Yu}:function(e){return !1},_s=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
|
|
4
|
-
`;super(r),this.name="AggregateError",this.errors=e;}};ms.exports={AggregateError:_s,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r));}},createDeferredPromise:function(){let t,e;return {promise:new Promise((i,n)=>{t=i,e=n;}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n));})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return `\`${t}\``}else return `"${t}"`;return `'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return `${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return "{}"}},types:{isAsyncFunction(t){return t instanceof iy},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:ny};ms.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom");});var Hi=M((YA,$i)=>{v();m();_();var{AbortController:Ju,AbortSignal:sy}=typeof self<"u"?self:typeof window<"u"?window:void 0;$i.exports=Ju;$i.exports.AbortSignal=sy;$i.exports.default=Ju;});var Se=M((oI,ef)=>{v();m();_();var{format:oy,inspect:Vi,AggregateError:ay}=Je(),ly=globalThis.AggregateError||ay,uy=Symbol("kIsNodeError"),fy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],cy=/^([A-Z][a-z0-9]*)+$/,hy="__node_internal_",zi={};function Xt(t,e){if(!t)throw new zi.ERR_INTERNAL_ASSERTION(e)}function Xu(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function dy(t,e,r){if(typeof e=="function")return Xt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return Xt(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:oy(e,...r)}function me(t,e,r){r||(r=Error);class i extends r{constructor(...o){super(dy(t,e,o));}toString(){return `${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return `${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[uy]=!0,zi[t]=i;}function Zu(t){let e=hy+t.name;return Object.defineProperty(t,"name",{value:e}),t}function py(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new ly([e,t],e.message);return r.code=e.code,r}return t||e}var vs=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new zi.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError";}};me("ERR_ASSERTION","%s",Error);me("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Xt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],s=[];for(let u of e)Xt(typeof u=="string","All expected entries have to be of type string"),fy.includes(u)?n.push(u.toLowerCase()):cy.test(u)?o.push(u):(Xt(u!=="object",'The value "object" should be written as "Object"'),s.push(u));if(o.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),o.push("Object"));}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let u=n.pop();i+=`one of type ${n.join(", ")}, or ${u}`;}}(o.length>0||s.length>0)&&(i+=" or ");}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();i+=`an instance of ${o.join(", ")}, or ${u}`;}}s.length>0&&(i+=" or ");}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let u=s.pop();i+=`one of ${s.join(", ")}, or ${u}`;}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else {let u=Vi(r,{depth:-1});i+=`. Received ${u}`;}}else {let u=Vi(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),i+=`. Received type ${typeof r} (${u})`;}return i},TypeError);me("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=Vi(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);me("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return `Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);me("ERR_MISSING_ARGS",(...t)=>{Xt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`;}break}return `${e} must be specified`},TypeError);me("ERR_OUT_OF_RANGE",(t,e,r)=>{Xt(e,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Xu(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=Xu(i)),i+="n"):i=Vi(r),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);me("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);me("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);me("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);me("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);me("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);me("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);me("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);me("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);me("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);me("ERR_STREAM_WRITE_AFTER_END","write after end",Error);me("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);ef.exports={AbortError:vs,aggregateTwoErrors:Zu(py),hideStackFrames:Zu,codes:zi};});var fi=M((yI,ff)=>{v();m();_();var{ArrayIsArray:Ss,ArrayPrototypeIncludes:sf,ArrayPrototypeJoin:of,ArrayPrototypeMap:gy,NumberIsInteger:As,NumberIsNaN:yy,NumberMAX_SAFE_INTEGER:by,NumberMIN_SAFE_INTEGER:wy,NumberParseInt:_y,ObjectPrototypeHasOwnProperty:my,RegExpPrototypeExec:af,String:vy,StringPrototypeToUpperCase:Ey,StringPrototypeTrim:Sy}=ce(),{hideStackFrames:Ue,codes:{ERR_SOCKET_BAD_PORT:Ay,ERR_INVALID_ARG_TYPE:Ae,ERR_INVALID_ARG_VALUE:Mr,ERR_OUT_OF_RANGE:Zt,ERR_UNKNOWN_SIGNAL:tf}}=Se(),{normalizeEncoding:Iy}=Je(),{isAsyncFunction:Ty,isArrayBufferView:Ry}=Je().types,rf={};function Cy(t){return t===(t|0)}function By(t){return t===t>>>0}var Py=/^[0-7]+$/,Oy="must be a 32-bit unsigned integer or an octal string";function ky(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(af(Py,t)===null)throw new Mr(e,t,Oy);t=_y(t,8);}return lf(t,e),t}var xy=Ue((t,e,r=wy,i=by)=>{if(typeof t!="number")throw new Ae(e,"number",t);if(!As(t))throw new Zt(e,"an integer",t);if(t<r||t>i)throw new Zt(e,`>= ${r} && <= ${i}`,t)}),My=Ue((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new Ae(e,"number",t);if(!As(t))throw new Zt(e,"an integer",t);if(t<r||t>i)throw new Zt(e,`>= ${r} && <= ${i}`,t)}),lf=Ue((t,e,r=!1)=>{if(typeof t!="number")throw new Ae(e,"number",t);if(!As(t))throw new Zt(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new Zt(e,`>= ${i} && <= ${n}`,t)});function Is(t,e){if(typeof t!="string")throw new Ae(e,"string",t)}function Ly(t,e,r=void 0,i){if(typeof t!="number")throw new Ae(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&yy(t))throw new Zt(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var Uy=Ue((t,e,r)=>{if(!sf(r,t)){let n="must be one of: "+of(gy(r,o=>typeof o=="string"?`'${o}'`:vy(o)),", ");throw new Mr(e,t,n)}});function uf(t,e){if(typeof t!="boolean")throw new Ae(e,"boolean",t)}function Es(t,e,r){return t==null||!my(t,e)?r:t[e]}var Ny=Ue((t,e,r=null)=>{let i=Es(r,"allowArray",!1),n=Es(r,"allowFunction",!1);if(!Es(r,"nullable",!1)&&t===null||!i&&Ss(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Ae(e,"Object",t)}),qy=Ue((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Ae(e,"a dictionary",t)}),Ts=Ue((t,e,r=0)=>{if(!Ss(t))throw new Ae(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new Mr(e,t,i)}});function Dy(t,e){Ts(t,e);for(let r=0;r<t.length;r++)Is(t[r],`${e}[${r}]`);}function jy(t,e){Ts(t,e);for(let r=0;r<t.length;r++)uf(t[r],`${e}[${r}]`);}function Fy(t,e="signal"){if(Is(t,e),rf[t]===void 0)throw rf[Ey(t)]!==void 0?new tf(t+" (signals must use all capital letters)"):new tf(t)}var Wy=Ue((t,e="buffer")=>{if(!Ry(t))throw new Ae(e,["Buffer","TypedArray","DataView"],t)});function $y(t,e){let r=Iy(e),i=t.length;if(r==="hex"&&i%2!==0)throw new Mr("encoding",e,`is invalid for data of length ${i}`)}function Hy(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Sy(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Ay(e,t,r);return t|0}var Vy=Ue((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Ae(e,"AbortSignal",t)}),zy=Ue((t,e)=>{if(typeof t!="function")throw new Ae(e,"Function",t)}),Ky=Ue((t,e)=>{if(typeof t!="function"||Ty(t))throw new Ae(e,"Function",t)}),Gy=Ue((t,e)=>{if(t!==void 0)throw new Ae(e,"undefined",t)});function Qy(t,e,r){if(!sf(r,t))throw new Ae(e,`('${of(r,"|")}')`,t)}var Yy=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function nf(t,e){if(typeof t>"u"||!af(Yy,t))throw new Mr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Jy(t){if(typeof t=="string")return nf(t,"hints"),t;if(Ss(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];nf(n,"hints"),r+=n,i!==e-1&&(r+=", ");}return r}throw new Mr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}ff.exports={isInt32:Cy,isUint32:By,parseFileMode:ky,validateArray:Ts,validateStringArray:Dy,validateBooleanArray:jy,validateBoolean:uf,validateBuffer:Wy,validateDictionary:qy,validateEncoding:$y,validateFunction:zy,validateInt32:My,validateInteger:xy,validateNumber:Ly,validateObject:Ny,validateOneOf:Uy,validatePlainFunction:Ky,validatePort:Hy,validateSignalName:Fy,validateString:Is,validateUint32:lf,validateUndefined:Gy,validateUnion:Qy,validateAbortSignal:Vy,validateLinkHeaderValue:Jy};});var Ut=M((TI,pf)=>{v();m();_();var ae=pf.exports={},Xe,Ze;function Rs(){throw new Error("setTimeout has not been defined")}function Cs(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Xe=setTimeout:Xe=Rs;}catch{Xe=Rs;}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Cs;}catch{Ze=Cs;}})();function cf(t){if(Xe===setTimeout)return setTimeout(t,0);if((Xe===Rs||!Xe)&&setTimeout)return Xe=setTimeout,setTimeout(t,0);try{return Xe(t,0)}catch{try{return Xe.call(null,t,0)}catch{return Xe.call(this,t,0)}}}function Xy(t){if(Ze===clearTimeout)return clearTimeout(t);if((Ze===Cs||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(t);try{return Ze(t)}catch{try{return Ze.call(null,t)}catch{return Ze.call(this,t)}}}var wt=[],Lr=!1,er,Ki=-1;function Zy(){!Lr||!er||(Lr=!1,er.length?wt=er.concat(wt):Ki=-1,wt.length&&hf());}function hf(){if(!Lr){var t=cf(Zy);Lr=!0;for(var e=wt.length;e;){for(er=wt,wt=[];++Ki<e;)er&&er[Ki].run();Ki=-1,e=wt.length;}er=null,Lr=!1,Xy(t);}}ae.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];wt.push(new df(t,e)),wt.length===1&&!Lr&&cf(hf);};function df(t,e){this.fun=t,this.array=e;}df.prototype.run=function(){this.fun.apply(null,this.array);};ae.title="browser";ae.browser=!0;ae.env={};ae.argv=[];ae.version="";ae.versions={};function _t(){}ae.on=_t;ae.addListener=_t;ae.once=_t;ae.off=_t;ae.removeListener=_t;ae.removeAllListeners=_t;ae.emit=_t;ae.prependListener=_t;ae.prependOnceListener=_t;ae.listeners=function(t){return []};ae.binding=function(t){throw new Error("process.binding is not supported")};ae.cwd=function(){return "/"};ae.chdir=function(t){throw new Error("process.chdir is not supported")};ae.umask=function(){return 0};});var tt=M((UI,Pf)=>{v();m();_();var{Symbol:Gi,SymbolAsyncIterator:gf,SymbolIterator:yf,SymbolFor:bf}=ce(),wf=Gi("kDestroyed"),_f=Gi("kIsErrored"),Bs=Gi("kIsReadable"),mf=Gi("kIsDisturbed"),eb=bf("nodejs.webstream.isClosedPromise"),tb=bf("nodejs.webstream.controllerErrorFunction");function Qi(t,e=!1){var r;return !!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Yi(t){var e;return !!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function rb(t){return !!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function et(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function vf(t){return !!(t&&!et(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Ef(t){return !!(t&&!et(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Sf(t){return !!(t&&!et(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function ib(t){return vf(t)||Ef(t)||Sf(t)}function nb(t,e){return t==null?!1:e===!0?typeof t[gf]=="function":e===!1?typeof t[yf]=="function":typeof t[gf]=="function"||typeof t[yf]=="function"}function Ji(t){if(!et(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return !!(t.destroyed||t[wf]||i!=null&&i.destroyed)}function Af(t){if(!Yi(t))return null;if(t.writableEnded===!0)return !0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function sb(t,e){if(!Yi(t))return null;if(t.writableFinished===!0)return !0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function ob(t){if(!Qi(t))return null;if(t.readableEnded===!0)return !0;let e=t._readableState;return !e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function If(t,e){if(!Qi(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Tf(t){return t&&t[Bs]!=null?t[Bs]:typeof t?.readable!="boolean"?null:Ji(t)?!1:Qi(t)&&t.readable&&!If(t)}function Rf(t){return typeof t?.writable!="boolean"?null:Ji(t)?!1:Yi(t)&&t.writable&&!Af(t)}function ab(t,e){return et(t)?Ji(t)?!0:!(e?.readable!==!1&&Tf(t)||e?.writable!==!1&&Rf(t)):null}function lb(t){var e,r;return et(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function ub(t){var e,r;return et(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function fb(t){if(!et(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Cf(t)?t._closed:null}function Cf(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Bf(t){return typeof t._sent100=="boolean"&&Cf(t)}function cb(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function hb(t){if(!et(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return !i&&Bf(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function db(t){var e;return !!(t&&((e=t[mf])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function pb(t){var e,r,i,n,o,s,a,u,c,h;return !!(t&&((e=(r=(i=(n=(o=(s=t[_f])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(c=t._readableState)===null||c===void 0?void 0:c.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}Pf.exports={kDestroyed:wf,isDisturbed:db,kIsDisturbed:mf,isErrored:pb,kIsErrored:_f,isReadable:Tf,kIsReadable:Bs,kIsClosedPromise:eb,kControllerErrorFunction:tb,isClosed:fb,isDestroyed:Ji,isDuplexNodeStream:rb,isFinished:ab,isIterable:nb,isReadableNodeStream:Qi,isReadableStream:vf,isReadableEnded:ob,isReadableFinished:If,isReadableErrored:ub,isNodeStream:et,isWebStream:ib,isWritable:Rf,isWritableNodeStream:Yi,isWritableStream:Ef,isWritableEnded:Af,isWritableFinished:sb,isWritableErrored:lb,isServerRequest:cb,isServerResponse:Bf,willEmitClose:hb,isTransformStream:Sf};});var mt=M((zI,Ms)=>{v();m();_();var Nt=Ut(),{AbortError:Df,codes:gb}=Se(),{ERR_INVALID_ARG_TYPE:yb,ERR_STREAM_PREMATURE_CLOSE:Of}=gb,{kEmptyObject:Os,once:ks}=Je(),{validateAbortSignal:bb,validateFunction:wb,validateObject:_b,validateBoolean:mb}=fi(),{Promise:vb,PromisePrototypeThen:Eb}=ce(),{isClosed:Sb,isReadable:kf,isReadableNodeStream:Ps,isReadableStream:Ab,isReadableFinished:xf,isReadableErrored:Mf,isWritable:Lf,isWritableNodeStream:Uf,isWritableStream:Ib,isWritableFinished:Nf,isWritableErrored:qf,isNodeStream:Tb,willEmitClose:Rb,kIsClosedPromise:Cb}=tt();function Bb(t){return t.setHeader&&typeof t.abort=="function"}var xs=()=>{};function jf(t,e,r){var i,n;if(arguments.length===2?(r=e,e=Os):e==null?e=Os:_b(e,"options"),wb(r,"callback"),bb(e.signal,"options.signal"),r=ks(r),Ab(t)||Ib(t))return Pb(t,e,r);if(!Tb(t))throw new yb("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:Ps(t),s=(n=e.writable)!==null&&n!==void 0?n:Uf(t),a=t._writableState,u=t._readableState,c=()=>{t.writable||g();},h=Rb(t)&&Ps(t)===o&&Uf(t)===s,d=Nf(t,!1),g=()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||o))&&(!o||y)&&r.call(t);},y=xf(t,!1),w=()=>{y=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||s))&&(!s||d)&&r.call(t);},E=N=>{r.call(t,N);},S=Sb(t),I=()=>{S=!0;let N=qf(t)||Mf(t);if(N&&typeof N!="boolean")return r.call(t,N);if(o&&!y&&Ps(t,!0)&&!xf(t,!1))return r.call(t,new Of);if(s&&!d&&!Nf(t,!1))return r.call(t,new Of);r.call(t);},C=()=>{S=!0;let N=qf(t)||Mf(t);if(N&&typeof N!="boolean")return r.call(t,N);r.call(t);},R=()=>{t.req.on("finish",g);};Bb(t)?(t.on("complete",g),h||t.on("abort",I),t.req?R():t.on("request",R)):s&&!a&&(t.on("end",c),t.on("close",c)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",I),t.on("end",w),t.on("finish",g),e.error!==!1&&t.on("error",E),t.on("close",I),S?Nt.nextTick(I):a!=null&&a.errorEmitted||u!=null&&u.errorEmitted?h||Nt.nextTick(C):(!o&&(!h||kf(t))&&(d||Lf(t)===!1)||!s&&(!h||Lf(t))&&(y||kf(t)===!1)||u&&t.req&&t.aborted)&&Nt.nextTick(C);let U=()=>{r=xs,t.removeListener("aborted",I),t.removeListener("complete",g),t.removeListener("abort",I),t.removeListener("request",R),t.req&&t.req.removeListener("finish",g),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",g),t.removeListener("end",w),t.removeListener("error",E),t.removeListener("close",I);};if(e.signal&&!S){let N=()=>{let W=r;U(),W.call(t,new Df(void 0,{cause:e.signal.reason}));};if(e.signal.aborted)Nt.nextTick(N);else {let W=r;r=ks((...K)=>{e.signal.removeEventListener("abort",N),W.apply(t,K);}),e.signal.addEventListener("abort",N);}}return U}function Pb(t,e,r){let i=!1,n=xs;if(e.signal)if(n=()=>{i=!0,r.call(t,new Df(void 0,{cause:e.signal.reason}));},e.signal.aborted)Nt.nextTick(n);else {let s=r;r=ks((...a)=>{e.signal.removeEventListener("abort",n),s.apply(t,a);}),e.signal.addEventListener("abort",n);}let o=(...s)=>{i||Nt.nextTick(()=>r.apply(t,s));};return Eb(t[Cb].promise,o,o),xs}function Ob(t,e){var r;let i=!1;return e===null&&(e=Os),(r=e)!==null&&r!==void 0&&r.cleanup&&(mb(e.cleanup,"cleanup"),i=e.cleanup),new vb((n,o)=>{let s=jf(t,e,a=>{i&&s(),a?o(a):n();});})}Ms.exports=jf;Ms.exports.finished=Ob;});var tr=M((rT,Gf)=>{v();m();_();var rt=Ut(),{aggregateTwoErrors:kb,codes:{ERR_MULTIPLE_CALLBACK:xb},AbortError:Mb}=Se(),{Symbol:$f}=ce(),{kDestroyed:Lb,isDestroyed:Ub,isFinished:Nb,isServerRequest:qb}=tt(),Hf=$f("kDestroy"),Ls=$f("kConstruct");function Vf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t));}function Db(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Vf(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Ff(this,t,e):this.once(Hf,function(o){Ff(this,kb(o,t),e);}),this)}function Ff(t,e,r){let i=!1;function n(o){if(i)return;i=!0;let s=t._readableState,a=t._writableState;Vf(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?rt.nextTick(jb,t,o):rt.nextTick(zf,t);}try{t._destroy(e||null,n);}catch(o){n(o);}}function jb(t,e){Us(t,e),zf(t);}function zf(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close");}function Us(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e));}function Fb(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1);}function Ns(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?rt.nextTick(Us,t,e):Us(t,e));}function Wb(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(Ls,e),!(t.listenerCount(Ls)>1)&&rt.nextTick($b,t);}function $b(t){let e=!1;function r(i){if(e){Ns(t,i??new xb);return}e=!0;let n=t._readableState,o=t._writableState,s=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit(Hf,i):i?Ns(t,i,!0):rt.nextTick(Hb,t);}try{t._construct(i=>{rt.nextTick(r,i);});}catch(i){rt.nextTick(r,i);}}function Hb(t){t.emit(Ls);}function Wf(t){return t?.setHeader&&typeof t.abort=="function"}function Kf(t){t.emit("close");}function Vb(t,e){t.emit("error",e),rt.nextTick(Kf,t);}function zb(t,e){!t||Ub(t)||(!e&&!Nb(t)&&(e=new Mb),qb(t)?(t.socket=null,t.destroy(e)):Wf(t)?t.abort():Wf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?rt.nextTick(Vb,t,e):rt.nextTick(Kf,t),t.destroyed||(t[Lb]=!0));}Gf.exports={construct:Wb,destroyer:zb,destroy:Db,undestroy:Fb,errorOrDestroy:Ns};});function Y(){Y.init.call(this);}function Xi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function nc(t){return t._maxListeners===void 0?Y.defaultMaxListeners:t._maxListeners}function Xf(t,e,r,i){var n,o,s,a;if(Xi(r),(o=t._events)===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=nc(t))>0&&s.length>n&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a);}return t}function Kb(){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 Zf(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Kb.bind(i);return n.listener=r,i.wrapFn=n,n}function ec(t,e,r){var i=t._events;if(i===void 0)return [];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?function(o){for(var s=new Array(o.length),a=0;a<s.length;++a)s[a]=o[a].listener||o[a];return s}(n):sc(n,n.length)}function tc(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function sc(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}var rc,ic,Ur,Qf,Yf,Jf,Be,qs=we(()=>{v();m();_();Ur=typeof Reflect=="object"?Reflect:null,Qf=Ur&&typeof Ur.apply=="function"?Ur.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};ic=Ur&&typeof Ur.ownKeys=="function"?Ur.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Yf=Number.isNaN||function(t){return t!=t};rc=Y,Y.EventEmitter=Y,Y.prototype._events=void 0,Y.prototype._eventsCount=0,Y.prototype._maxListeners=void 0;Jf=10;Object.defineProperty(Y,"defaultMaxListeners",{enumerable:!0,get:function(){return Jf},set:function(t){if(typeof t!="number"||t<0||Yf(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Jf=t;}}),Y.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;},Y.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Yf(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},Y.prototype.getMaxListeners=function(){return nc(this)},Y.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i=t==="error",n=this._events;if(n!==void 0)i=i&&n.error===void 0;else if(!i)return !1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(a===void 0)return !1;if(typeof a=="function")Qf(a,this,e);else {var u=a.length,c=sc(a,u);for(r=0;r<u;++r)Qf(c[r],this,e);}return !0},Y.prototype.addListener=function(t,e){return Xf(this,t,e,!1)},Y.prototype.on=Y.prototype.addListener,Y.prototype.prependListener=function(t,e){return Xf(this,t,e,!0)},Y.prototype.once=function(t,e){return Xi(e),this.on(t,Zf(this,t,e)),this},Y.prototype.prependOnceListener=function(t,e){return Xi(e),this.prependListener(t,Zf(this,t,e)),this},Y.prototype.removeListener=function(t,e){var r,i,n,o,s;if(Xi(e),(i=this._events)===void 0)return this;if((r=i[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():function(a,u){for(;u+1<a.length;u++)a[u]=a[u+1];a.pop();}(r,n),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||e);}return this},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(t){var e,r,i;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n,o=Object.keys(r);for(i=0;i<o.length;++i)(n=o[i])!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},Y.prototype.listeners=function(t){return ec(this,t,!0)},Y.prototype.rawListeners=function(t){return ec(this,t,!1)},Y.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):tc.call(t,e)},Y.prototype.listenerCount=tc,Y.prototype.eventNames=function(){return this._eventsCount>0?ic(this._events):[]};Be=rc;Be.EventEmitter;Be.defaultMaxListeners;Be.init;Be.listenerCount;Be.EventEmitter;Be.defaultMaxListeners;Be.init;Be.listenerCount;});var rr={};Qt(rr,{EventEmitter:()=>Gb,default:()=>Be,defaultMaxListeners:()=>Qb,init:()=>Yb,listenerCount:()=>Jb,on:()=>Xb,once:()=>Zb});var Gb,Qb,Yb,Jb,Xb,Zb,ir=we(()=>{v();m();_();qs();qs();Be.once=function(t,e){return new Promise((r,i)=>{function n(...s){o!==void 0&&t.removeListener("error",o),r(s);}let o;e!=="error"&&(o=s=>{t.removeListener(name,n),i(s);},t.once("error",o)),t.once(e,n);})};Be.on=function(t,e){let r=[],i=[],n=null,o=!1,s={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(n){let h=Promise.reject(n);return n=null,h}return o?createIterResult(void 0,!0):new Promise((h,d)=>i.push({resolve:h,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",u),o=!0;for(let c of i)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){n=c,t.removeListener(e,a),t.removeListener("error",u);},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",u),s;function a(...c){let h=i.shift();h?h.resolve(createIterResult(c,!1)):r.push(c);}function u(c){o=!0;let h=i.shift();h?h.reject(c):n=c,s.return();}};({EventEmitter:Gb,defaultMaxListeners:Qb,init:Yb,listenerCount:Jb,on:Xb,once:Zb}=Be);});var tn=M((xT,ac)=>{v();m();_();var{ArrayIsArray:ew,ObjectSetPrototypeOf:oc}=ce(),{EventEmitter:Zi}=(ir(),X(rr));function en(t){Zi.call(this,t);}oc(en.prototype,Zi.prototype);oc(en,Zi);en.prototype.pipe=function(t,e){let r=this;function i(h){t.writable&&t.write(h)===!1&&r.pause&&r.pause();}r.on("data",i);function n(){r.readable&&r.resume&&r.resume();}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,t.end());}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy());}function u(h){c(),Zi.listenerCount(this,"error")===0&&this.emit("error",h);}Ds(r,"error",u),Ds(t,"error",u);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c);}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};function Ds(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):ew(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]];}ac.exports={Stream:en,prependListener:Ds};});var ci=M(($T,rn)=>{v();m();_();var{AbortError:lc,codes:tw}=Se(),{isNodeStream:uc,isWebStream:rw,kControllerErrorFunction:iw}=tt(),nw=mt(),{ERR_INVALID_ARG_TYPE:fc}=tw,sw=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new fc(e,"AbortSignal",t)};rn.exports.addAbortSignal=function(e,r){if(sw(e,"signal"),!uc(r)&&!rw(r))throw new fc("stream",["ReadableStream","WritableStream","Stream"],r);return rn.exports.addAbortSignalNoValidate(e,r)};rn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=uc(e)?()=>{e.destroy(new lc(void 0,{cause:t.reason}));}:()=>{e[iw](new lc(void 0,{cause:t.reason}));};return t.aborted?r():(t.addEventListener("abort",r),nw(e,()=>t.removeEventListener("abort",r))),e};});var dc=M((e2,hc)=>{v();m();_();var{StringPrototypeSlice:cc,SymbolIterator:ow,TypedArrayPrototypeSet:nn,Uint8Array:aw}=ce(),{Buffer:js}=(ye(),X(_e)),{inspect:lw}=Je();hc.exports=class{constructor(){this.head=null,this.tail=null,this.length=0;}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length;}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length;}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0;}join(e){if(this.length===0)return "";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return js.alloc(0);let r=js.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)nn(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[ow](){for(let e=this.head;e;e=e.next)yield e.data;}_getString(e){let r="",i=this.head,n=0;do{let o=i.data;if(e>o.length)r+=o,e-=o.length;else {e===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=cc(o,0,e),this.head=i,i.data=cc(o,e));break}++n;}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=js.allocUnsafe(e),i=e,n=this.head,o=0;do{let s=n.data;if(e>s.length)nn(r,s,i-e),e-=s.length;else {e===s.length?(nn(r,s,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(nn(r,new aw(s.buffer,s.byteOffset,e),i-e),this.head=n,n.data=s.slice(e));break}++o;}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return lw(this,{...r,depth:0,customInspect:!1})}};});var sn=M((f2,gc)=>{v();m();_();var{MathFloor:uw,NumberIsInteger:fw}=ce(),{ERR_INVALID_ARG_VALUE:cw}=Se().codes;function hw(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function pc(t){return t?16:16*1024}function dw(t,e,r,i){let n=hw(e,i,r);if(n!=null){if(!fw(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new cw(o,n)}return uw(n)}return pc(t.objectMode)}gc.exports={getHighWaterMark:dw,getDefaultHighWaterMark:pc};});function wc(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return r===-1&&(r=e),[r,r===e?0:4-r%4]}function pw(t,e,r){for(var i,n,o=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push($e[(n=i)>>18&63]+$e[n>>12&63]+$e[n>>6&63]+$e[63&n]);return o.join("")}function vt(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,k.prototype),e}function k(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Hs(t)}return Cc(t,e,r)}function Cc(t,e,r){if(typeof t=="string")return function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!k.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|Pc(o,s),u=vt(a),c=u.write(o,s);return c!==a&&(u=u.slice(0,c)),u}(t,e);if(ArrayBuffer.isView(t))return Fs(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Et(t,ArrayBuffer)||t&&Et(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Et(t,SharedArrayBuffer)||t&&Et(t.buffer,SharedArrayBuffer)))return mc(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return k.from(i,e,r);var n=function(o){if(k.isBuffer(o)){var s=0|Ks(o.length),a=vt(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||Gs(o.length)?vt(0):Fs(o);if(o.type==="Buffer"&&Array.isArray(o.data))return Fs(o.data)}(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return k.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function Bc(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Hs(t){return Bc(t),vt(t<0?0:0|Ks(t))}function Fs(t){for(var e=t.length<0?0:0|Ks(t.length),r=vt(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function mc(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=e===void 0&&r===void 0?new Uint8Array(t):r===void 0?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,k.prototype),i}function Ks(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|t}function Pc(t,e){if(k.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Et(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Vs(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Mc(t).length;default:if(n)return i?-1:Vs(t).length;e=(""+e).toLowerCase(),n=!0;}}function yw(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return "";for(t||(t="utf8");;)switch(t){case"hex":return Iw(this,e,r);case"utf8":case"utf-8":return kc(this,e,r);case"ascii":return Sw(this,e,r);case"latin1":case"binary":return Aw(this,e,r);case"base64":return Ew(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tw(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0;}}function sr(t,e,r){var i=t[e];t[e]=t[r],t[r]=i;}function vc(t,e,r,i,n){if(t.length===0)return -1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Gs(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return -1;r=t.length-1;}else if(r<0){if(!n)return -1;r=0;}if(typeof e=="string"&&(e=k.from(e,i)),k.isBuffer(e))return e.length===0?-1:Ec(t,e,r,i,n);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ec(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Ec(t,e,r,i,n){var o,s=1,a=t.length,u=e.length;if(i!==void 0&&((i=String(i).toLowerCase())==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2;}function c(y,w){return s===1?y[w]:y.readUInt16BE(w*s)}if(n){var h=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,h===-1?0:o-h)){if(h===-1&&(h=o),o-h+1===u)return h*s}else h!==-1&&(o-=o-h),h=-1;}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var d=!0,g=0;g<u;g++)if(c(t,o+g)!==c(e,g)){d=!1;break}if(d)return o}return -1}function bw(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(Gs(a))return s;t[r+s]=a;}return s}function ww(t,e,r,i){return un(Vs(e,t.length-r),t,r,i)}function Oc(t,e,r,i){return un(function(n){for(var o=[],s=0;s<n.length;++s)o.push(255&n.charCodeAt(s));return o}(e),t,r,i)}function _w(t,e,r,i){return Oc(t,e,r,i)}function mw(t,e,r,i){return un(Mc(e),t,r,i)}function vw(t,e,r,i){return un(function(n,o){for(var s,a,u,c=[],h=0;h<n.length&&!((o-=2)<0);++h)s=n.charCodeAt(h),a=s>>8,u=s%256,c.push(u),c.push(a);return c}(e,t.length-r),t,r,i)}function Ew(t,e,r){return e===0&&r===t.length?$s.fromByteArray(t):$s.fromByteArray(t.slice(e,r))}function kc(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,u,c=t[n],h=null,d=c>239?4:c>223?3:c>191?2:1;if(n+d<=r)switch(d){case 1:c<128&&(h=c);break;case 2:(192&(o=t[n+1]))==128&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[n+1],s=t[n+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u);}h===null?(h=65533,d=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=d;}return function(g){var y=g.length;if(y<=4096)return String.fromCharCode.apply(String,g);for(var w="",E=0;E<y;)w+=String.fromCharCode.apply(String,g.slice(E,E+=4096));return w}(i)}function Sw(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function Aw(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function Iw(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=Cw[t[o]];return n}function Tw(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function be(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Pe(t,e,r,i,n,o){if(!k.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function xc(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Sc(t,e,r,i,n){return e=+e,r>>>=0,n||xc(t,0,r,4),Nr.write(t,e,r,i,23,4),r+4}function Ac(t,e,r,i,n){return e=+e,r>>>=0,n||xc(t,0,r,8),Nr.write(t,e,r,i,52,8),r+8}function Vs(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320);}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r);}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128);}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128);}else {if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128);}}return o}function Mc(t){return $s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Rw,"")).length<2)return "";for(;e.length%4!=0;)e+="=";return e}(t))}function un(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Et(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Gs(t){return t!=t}function Ic(t,e){for(var r in t)e[r]=t[r];}function or(t,e,r){return it(t,e,r)}function hi(t){var e;switch(this.encoding=function(r){var i=function(n){if(!n)return "utf8";for(var o;;)switch(n){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 n;default:if(o)return;n=(""+n).toLowerCase(),o=!0;}}(r);if(typeof i!="string"&&(zs.isEncoding===Tc||!Tc(r)))throw new Error("Unknown encoding: "+r);return i||r}(t),this.encoding){case"utf16le":this.text=Ow,this.end=kw,e=4;break;case"utf8":this.fillLast=Pw,e=4;break;case"base64":this.text=xw,this.end=Mw,e=3;break;default:return this.write=Lw,this.end=Uw,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=zs.allocUnsafe(e);}function Ws(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function Pw(t){var e=this.lastTotal-this.lastNeed,r=function(i,n,o){if((192&n[0])!=128)return i.lastNeed=0,"\uFFFD";if(i.lastNeed>1&&n.length>1){if((192&n[1])!=128)return i.lastNeed=1,"\uFFFD";if(i.lastNeed>2&&n.length>2&&(192&n[2])!=128)return i.lastNeed=2,"\uFFFD"}}(this,t);return r!==void 0?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length,void 0)}function Ow(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function kw(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function xw(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Mw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Lw(t){return t.toString(this.encoding)}function Uw(t){return t&&t.length?this.write(t):""}var Rc,$e,ke,yc,on,nr,bc,gw,St,$s,Nr,_c,Rw,Cw,an,ln,it,Bw,ar,zs,Tc,Qs=we(()=>{v();m();_();for(Rc={byteLength:function(t){var e=wc(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=wc(t),n=i[0],o=i[1],s=new yc(function(c,h,d){return 3*(h+d)/4-d}(0,n,o)),a=0,u=o>0?n-4:n;for(r=0;r<u;r+=4)e=ke[t.charCodeAt(r)]<<18|ke[t.charCodeAt(r+1)]<<12|ke[t.charCodeAt(r+2)]<<6|ke[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=ke[t.charCodeAt(r)]<<2|ke[t.charCodeAt(r+1)]>>4,s[a++]=255&e),o===1&&(e=ke[t.charCodeAt(r)]<<10|ke[t.charCodeAt(r+1)]<<4|ke[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],o=0,s=r-i;o<s;o+=16383)n.push(pw(t,o,o+16383>s?s:o+16383));return i===1?(e=t[r-1],n.push($e[e>>2]+$e[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push($e[e>>10]+$e[e>>4&63]+$e[e<<2&63]+"=")),n.join("")}},$e=[],ke=[],yc=typeof Uint8Array<"u"?Uint8Array:Array,on="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nr=0,bc=on.length;nr<bc;++nr)$e[nr]=on[nr],ke[on.charCodeAt(nr)]=nr;ke["-".charCodeAt(0)]=62,ke["_".charCodeAt(0)]=63;gw={read:function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,c=u>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=256*o+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=256*s+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else {if(o===u)return s?NaN:1/0*(y?-1:1);s+=Math.pow(2,i),o-=c;}return (y?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,r,i,n,o){var s,a,u,c=8*o-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,w=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+d>=1?g/u:g*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*u-1)*Math.pow(2,n),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=255&a,y+=w,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=255&s,y+=w,s/=256,c-=8);t[r+y-w]|=128*E;}},St={},$s=Rc,Nr=gw,_c=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;St.Buffer=k,St.SlowBuffer=function(t){return +t!=t&&(t=0),k.alloc(+t)},St.INSPECT_MAX_BYTES=50;St.kMaxLength=2147483647,k.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return !1}}(),k.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."),Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}}),k.poolSize=8192,k.from=function(t,e,r){return Cc(t,e,r)},Object.setPrototypeOf(k.prototype,Uint8Array.prototype),Object.setPrototypeOf(k,Uint8Array),k.alloc=function(t,e,r){return function(i,n,o){return Bc(i),i<=0?vt(i):n!==void 0?typeof o=="string"?vt(i).fill(n,o):vt(i).fill(n):vt(i)}(t,e,r)},k.allocUnsafe=function(t){return Hs(t)},k.allocUnsafeSlow=function(t){return Hs(t)},k.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==k.prototype},k.compare=function(t,e){if(Et(t,Uint8Array)&&(t=k.from(t,t.offset,t.byteLength)),Et(e,Uint8Array)&&(e=k.from(e,e.offset,e.byteLength)),!k.isBuffer(t)||!k.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},k.isEncoding=function(t){switch(String(t).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}},k.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return k.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=k.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(Et(o,Uint8Array)&&(o=k.from(o)),!k.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length;}return i},k.byteLength=Pc,k.prototype._isBuffer=!0,k.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)sr(this,e,e+1);return this},k.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)sr(this,e,e+3),sr(this,e+1,e+2);return this},k.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)sr(this,e,e+7),sr(this,e+1,e+6),sr(this,e+2,e+5),sr(this,e+3,e+4);return this},k.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?kc(this,0,t):yw.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(t){if(!k.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||k.compare(this,t)===0},k.prototype.inspect=function(){var t="",e=St.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},_c&&(k.prototype[_c]=k.prototype.inspect),k.prototype.compare=function(t,e,r,i,n){if(Et(t,Uint8Array)&&(t=k.from(t,t.offset,t.byteLength)),!k.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),c=t.slice(e,r),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},k.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},k.prototype.indexOf=function(t,e,r){return vc(this,t,e,r,!0)},k.prototype.lastIndexOf=function(t,e,r){return vc(this,t,e,r,!1)},k.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else {if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,i===void 0&&(i="utf8")):(i=r,r=void 0);}var n=this.length-e;if((r===void 0||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return bw(this,t,e,r);case"utf8":case"utf-8":return ww(this,t,e,r);case"ascii":return Oc(this,t,e,r);case"latin1":case"binary":return _w(this,t,e,r);case"base64":return mw(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vw(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0;}},k.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};k.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=e===void 0?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,k.prototype),i},k.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||be(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},k.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||be(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},k.prototype.readUInt8=function(t,e){return t>>>=0,e||be(t,1,this.length),this[t]},k.prototype.readUInt16LE=function(t,e){return t>>>=0,e||be(t,2,this.length),this[t]|this[t+1]<<8},k.prototype.readUInt16BE=function(t,e){return t>>>=0,e||be(t,2,this.length),this[t]<<8|this[t+1]},k.prototype.readUInt32LE=function(t,e){return t>>>=0,e||be(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},k.prototype.readUInt32BE=function(t,e){return t>>>=0,e||be(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},k.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||be(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},k.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||be(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},k.prototype.readInt8=function(t,e){return t>>>=0,e||be(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},k.prototype.readInt16LE=function(t,e){t>>>=0,e||be(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},k.prototype.readInt16BE=function(t,e){t>>>=0,e||be(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},k.prototype.readInt32LE=function(t,e){return t>>>=0,e||be(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},k.prototype.readInt32BE=function(t,e){return t>>>=0,e||be(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},k.prototype.readFloatLE=function(t,e){return t>>>=0,e||be(t,4,this.length),Nr.read(this,t,!0,23,4)},k.prototype.readFloatBE=function(t,e){return t>>>=0,e||be(t,4,this.length),Nr.read(this,t,!1,23,4)},k.prototype.readDoubleLE=function(t,e){return t>>>=0,e||be(t,8,this.length),Nr.read(this,t,!0,52,8)},k.prototype.readDoubleBE=function(t,e){return t>>>=0,e||be(t,8,this.length),Nr.read(this,t,!1,52,8)},k.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Pe(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},k.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Pe(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},k.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,1,255,0),this[e]=255&t,e+1},k.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},k.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},k.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},k.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},k.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Pe(this,t,e,r,n-1,-n);}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},k.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Pe(this,t,e,r,n-1,-n);}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},k.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},k.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},k.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},k.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},k.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Pe(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},k.prototype.writeFloatLE=function(t,e,r){return Sc(this,t,e,!0,r)},k.prototype.writeFloatBE=function(t,e,r){return Sc(this,t,e,!1,r)},k.prototype.writeDoubleLE=function(t,e,r){return Ac(this,t,e,!0,r)},k.prototype.writeDoubleBE=function(t,e,r){return Ac(this,t,e,!1,r)},k.prototype.copy=function(t,e,r,i){if(!k.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||i===0||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var o=n-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},k.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!k.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var n=t.charCodeAt(0);(i==="utf8"&&n<128||i==="latin1")&&(t=n);}}else typeof t=="number"?t&=255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=r===void 0?this.length:r>>>0,t||(t=0),typeof t=="number")for(o=e;o<r;++o)this[o]=t;else {var s=k.isBuffer(t)?t:k.from(t,i),a=s.length;if(a===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a];}return this};Rw=/[^+/0-9A-Za-z-_]/g;Cw=function(){for(var t=new Array(256),e=0;e<16;++e)for(var r=16*e,i=0;i<16;++i)t[r+i]="0123456789abcdef"[e]+"0123456789abcdef"[i];return t}();St.Buffer;St.INSPECT_MAX_BYTES;St.kMaxLength;an={},ln=St,it=ln.Buffer;it.from&&it.alloc&&it.allocUnsafe&&it.allocUnsafeSlow?an=ln:(Ic(ln,an),an.Buffer=or),or.prototype=Object.create(it.prototype),Ic(it,or),or.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return it(t,e,r)},or.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=it(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},or.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return it(t)},or.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ln.SlowBuffer(t)};Bw=an,ar={},zs=Bw.Buffer,Tc=zs.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return !0;default:return !1}};ar.StringDecoder=hi,hi.prototype.write=function(t){if(t.length===0)return "";var e,r;if(this.lastNeed){if((e=this.fillLast(t))===void 0)return "";r=this.lastNeed,this.lastNeed=0;}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},hi.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e},hi.prototype.text=function(t,e){var r=function(n,o,s){var a=o.length-1;if(a<s)return 0;var u=Ws(o[a]);return u>=0?(u>0&&(n.lastNeed=u-1),u):--a<s||u===-2?0:(u=Ws(o[a]))>=0?(u>0&&(n.lastNeed=u-2),u):--a<s||u===-2?0:(u=Ws(o[a]))>=0?(u>0&&(u===2?u=0:n.lastNeed=u-3),u):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},hi.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length;};ar.StringDecoder;ar.StringDecoder;});var Lc={};Qt(Lc,{StringDecoder:()=>Nw,default:()=>ar});var Nw,Uc=we(()=>{v();m();_();Qs();Qs();Nw=ar.StringDecoder;});var Ys=M((F2,jc)=>{v();m();_();var Nc=Ut(),{PromisePrototypeThen:qw,SymbolAsyncIterator:qc,SymbolIterator:Dc}=ce(),{Buffer:Dw}=(ye(),X(_e)),{ERR_INVALID_ARG_TYPE:jw,ERR_STREAM_NULL_VALUES:Fw}=Se().codes;function Ww(t,e,r){let i;if(typeof e=="string"||e instanceof Dw)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null);}});let n;if(e&&e[qc])n=!0,i=e[qc]();else if(e&&e[Dc])n=!1,i=e[Dc]();else throw new jw("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,u());},o._destroy=function(c,h){qw(a(c),()=>Nc.nextTick(h,c),d=>Nc.nextTick(h,d||c));};async function a(c){let h=c!=null,d=typeof i.throw=="function";if(h&&d){let{value:g,done:y}=await i.throw(c);if(await g,y)return}if(typeof i.return=="function"){let{value:g}=await i.return();await g;}}async function u(){for(;;){try{let{value:c,done:h}=n?await i.next():i.next();if(h)o.push(null);else {let d=c&&typeof c.then=="function"?await c:c;if(d===null)throw s=!1,new Fw;if(o.push(d))continue;s=!1;}}catch(c){o.destroy(c);}break}}return o}jc.exports=Ww;});var di=M((J2,Zc)=>{v();m();_();var He=Ut(),{ArrayPrototypeIndexOf:$w,NumberIsInteger:Hw,NumberIsNaN:Vw,NumberParseInt:zw,ObjectDefineProperties:$c,ObjectKeys:Kw,ObjectSetPrototypeOf:Hc,Promise:Gw,SafeSet:Qw,SymbolAsyncIterator:Yw,Symbol:Jw}=ce();Zc.exports=F;F.ReadableState=ro;var{EventEmitter:Xw}=(ir(),X(rr)),{Stream:qt,prependListener:Zw}=tn(),{Buffer:Js}=(ye(),X(_e)),{addAbortSignal:e_}=ci(),t_=mt(),H=Je().debuglog("stream",t=>{H=t;}),r_=dc(),Dr=tr(),{getHighWaterMark:i_,getDefaultHighWaterMark:n_}=sn(),{aggregateTwoErrors:Fc,codes:{ERR_INVALID_ARG_TYPE:s_,ERR_METHOD_NOT_IMPLEMENTED:o_,ERR_OUT_OF_RANGE:a_,ERR_STREAM_PUSH_AFTER_EOF:l_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:u_}}=Se(),{validateObject:f_}=fi(),lr=Jw("kPaused"),{StringDecoder:Vc}=(Uc(),X(Lc)),c_=Ys();Hc(F.prototype,qt.prototype);Hc(F,qt);var Xs=()=>{},{errorOrDestroy:qr}=Dr;function ro(t,e,r){typeof r!="boolean"&&(r=e instanceof nt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?i_(this,t,"readableHighWaterMark",r):n_(!1),this.buffer=new r_,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[lr]=null,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Vc(t.encoding),this.encoding=t.encoding);}function F(t){if(!(this instanceof F))return new F(t);let e=this instanceof nt();this._readableState=new ro(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&e_(t.signal,this)),qt.call(this,t),Dr.construct(this,()=>{this._readableState.needReadable&&fn(this,this._readableState);});}F.prototype.destroy=Dr.destroy;F.prototype._undestroy=Dr.undestroy;F.prototype._destroy=function(t,e){e(t);};F.prototype[Xw.captureRejectionSymbol]=function(t){this.destroy(t);};F.prototype.push=function(t,e){return zc(this,t,e,!1)};F.prototype.unshift=function(t,e){return zc(this,t,e,!0)};function zc(t,e,r,i){H("readableAddChunk",e);let n=t._readableState,o;if(n.objectMode||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=Js.from(e,r).toString(n.encoding):(e=Js.from(e,r),r=""))):e instanceof Js?r="":qt._isUint8Array(e)?(e=qt._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new s_("chunk",["string","Buffer","Uint8Array"],e))),o)qr(t,o);else if(e===null)n.reading=!1,p_(t,n);else if(n.objectMode||e&&e.length>0)if(i)if(n.endEmitted)qr(t,new u_);else {if(n.destroyed||n.errored)return !1;Zs(t,n,e,!0);}else if(n.ended)qr(t,new l_);else {if(n.destroyed||n.errored)return !1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?Zs(t,n,e,!1):fn(t,n)):Zs(t,n,e,!1);}else i||(n.reading=!1,fn(t,n));return !n.ended&&(n.length<n.highWaterMark||n.length===0)}function Zs(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&cn(t)),fn(t,e);}F.prototype.isPaused=function(){let t=this._readableState;return t[lr]===!0||t.flowing===!1};F.prototype.setEncoding=function(t){let e=new Vc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var h_=1073741824;function d_(t){if(t>h_)throw new a_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Wc(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:Vw(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}F.prototype.read=function(t){H("read",t),t===void 0?t=NaN:Hw(t)||(t=zw(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=d_(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return H("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?eo(this):cn(this),null;if(t=Wc(t,e),t===0&&e.ended)return e.length===0&&eo(this),null;let i=e.needReadable;if(H("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,H("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,H("reading, ended or constructing",i);else if(i){H("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark);}catch(o){qr(this,o);}e.sync=!1,e.reading||(t=Wc(r,e));}let n;return t>0?n=Jc(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&eo(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function p_(t,e){if(H("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length);}e.ended=!0,e.sync?cn(t):(e.needReadable=!1,e.emittedReadable=!0,Kc(t));}}function cn(t){let e=t._readableState;H("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(H("emitReadable",e.flowing),e.emittedReadable=!0,He.nextTick(Kc,t));}function Kc(t){let e=t._readableState;H("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Qc(t);}function fn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,He.nextTick(g_,t,e));}function g_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(H("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1;}F.prototype._read=function(t){throw new o_("_read()")};F.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Qw(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),H("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==He.stdout&&t!==He.stderr?a:S;i.endEmitted?He.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(I,C){H("onunpipe"),I===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,h());}function a(){H("onend"),t.end();}let u,c=!1;function h(){H("cleanup"),t.removeListener("close",w),t.removeListener("finish",E),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",S),r.removeListener("data",g),c=!0,u&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u();}function d(){c||(i.pipes.length===1&&i.pipes[0]===t?(H("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(H("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),u||(u=y_(r,t),t.on("drain",u));}r.on("data",g);function g(I){H("ondata");let C=t.write(I);H("dest.write",C),C===!1&&d();}function y(I){if(H("onerror",I),S(),t.removeListener("error",y),t.listenerCount("error")===0){let C=t._writableState||t._readableState;C&&!C.errorEmitted?qr(t,I):t.emit("error",I);}}Zw(t,"error",y);function w(){t.removeListener("finish",E),S();}t.once("close",w);function E(){H("onfinish"),t.removeListener("close",w),S();}t.once("finish",E);function S(){H("unpipe"),r.unpipe(t);}return t.emit("pipe",r),t.writableNeedDrain===!0?i.flowing&&d():i.flowing||(H("pipe resume"),r.resume()),t};function y_(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(H("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(H("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume();}}F.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=$w(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};F.prototype.on=function(t,e){let r=qt.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,H("on readable",i.length,i.reading),i.length?cn(this):i.reading||He.nextTick(b_,this)),r};F.prototype.addListener=F.prototype.on;F.prototype.removeListener=function(t,e){let r=qt.prototype.removeListener.call(this,t,e);return t==="readable"&&He.nextTick(Gc,this),r};F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners=function(t){let e=qt.prototype.removeAllListeners.apply(this,arguments);return (t==="readable"||t===void 0)&&He.nextTick(Gc,this),e};function Gc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[lr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null);}function b_(t){H("readable nexttick read 0"),t.read(0);}F.prototype.resume=function(){let t=this._readableState;return t.flowing||(H("resume"),t.flowing=!t.readableListening,w_(this,t)),t[lr]=!1,this};function w_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,He.nextTick(__,t,e));}function __(t,e){H("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Qc(t),e.flowing&&!e.reading&&t.read(0);}F.prototype.pause=function(){return H("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(H("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[lr]=!0,this};function Qc(t){let e=t._readableState;for(H("flow",e.flowing);e.flowing&&t.read()!==null;);}F.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause());}),t.on("end",()=>{this.push(null);}),t.on("error",i=>{qr(this,i);}),t.on("close",()=>{this.destroy();}),t.on("destroy",()=>{this.destroy();}),this._read=()=>{e&&t.resume&&(e=!1,t.resume());};let r=Kw(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t));}return this};F.prototype[Yw]=function(){return Yc(this)};F.prototype.iterator=function(t){return t!==void 0&&f_(t,"options"),Yc(this,t)};function Yc(t,e){typeof t.read!="function"&&(t=F.wrap(t,{objectMode:!0}));let r=m_(t,e);return r.stream=t,r}async function*m_(t,e){let r=Xs;function i(s){this===t?(r(),r=Xs):r=s;}t.on("readable",i);let n,o=t_(t,{writable:!1},s=>{n=s?Fc(n,s):null,r(),r=Xs;});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else {if(n)throw n;if(n===null)return;await new Gw(i);}}}catch(s){throw n=Fc(n,s),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?Dr.destroyer(t,null):(t.off("readable",i),o());}}$c(F.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return !!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t);}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return !!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t);}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t);}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});$c(ro.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[lr]!==!1},set(t){this[lr]=!!t;}}});F._fromList=Jc;function Jc(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function eo(t){let e=t._readableState;H("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,He.nextTick(v_,e,t));}function v_(t,e){if(H("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)He.nextTick(E_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy();}}}function E_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end();}F.from=function(t,e){return c_(F,t,e)};var to;function Xc(){return to===void 0&&(to={}),to}F.fromWeb=function(t,e){return Xc().newStreamReadableFromReadableStream(t,e)};F.toWeb=function(t,e){return Xc().newReadableStreamFromStreamReadable(t,e)};F.wrap=function(t,e){var r,i;return new F({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(n,o){Dr.destroyer(t,n),o(n);}}).wrap(t)};});var uo=M((aR,ch)=>{v();m();_();var ur=Ut(),{ArrayPrototypeSlice:rh,Error:S_,FunctionPrototypeSymbolHasInstance:ih,ObjectDefineProperty:nh,ObjectDefineProperties:A_,ObjectSetPrototypeOf:sh,StringPrototypeToLowerCase:I_,Symbol:T_,SymbolHasInstance:R_}=ce();ch.exports=ie;ie.WritableState=yi;var{EventEmitter:C_}=(ir(),X(rr)),pi=tn().Stream,{Buffer:hn}=(ye(),X(_e)),gn=tr(),{addAbortSignal:B_}=ci(),{getHighWaterMark:P_,getDefaultHighWaterMark:O_}=sn(),{ERR_INVALID_ARG_TYPE:k_,ERR_METHOD_NOT_IMPLEMENTED:x_,ERR_MULTIPLE_CALLBACK:oh,ERR_STREAM_CANNOT_PIPE:M_,ERR_STREAM_DESTROYED:gi,ERR_STREAM_ALREADY_FINISHED:L_,ERR_STREAM_NULL_VALUES:U_,ERR_STREAM_WRITE_AFTER_END:N_,ERR_UNKNOWN_ENCODING:ah}=Se().codes,{errorOrDestroy:jr}=gn;sh(ie.prototype,pi.prototype);sh(ie,pi);function so(){}var Fr=T_("kOnFinished");function yi(t,e,r){typeof r!="boolean"&&(r=e instanceof nt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?P_(this,t,"writableHighWaterMark",r):O_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D_.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,pn(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fr]=[];}function pn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0;}yi.prototype.getBuffer=function(){return rh(this.buffered,this.bufferedIndex)};nh(yi.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function ie(t){let e=this instanceof nt();if(!e&&!ih(ie,this))return new ie(t);this._writableState=new yi(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&B_(t.signal,this)),pi.call(this,t),gn.construct(this,()=>{let r=this._writableState;r.writing||ao(this,r),lo(this,r);});}nh(ie,R_,{__proto__:null,value:function(t){return ih(this,t)?!0:this!==ie?!1:t&&t._writableState instanceof yi}});ie.prototype.pipe=function(){jr(this,new M_);};function lh(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else {if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!hn.isEncoding(r))throw new ah(r);typeof i!="function"&&(i=so);}if(e===null)throw new U_;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=hn.from(e,r),r="buffer");else if(e instanceof hn)r="buffer";else if(pi._isUint8Array(e))e=pi._uint8ArrayToBuffer(e),r="buffer";else throw new k_("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new N_:n.destroyed&&(o=new gi("write")),o?(ur.nextTick(i,o),jr(t,o,!0),o):(n.pendingcb++,q_(t,n,e,r,i))}ie.prototype.write=function(t,e,r){return lh(this,t,e,r)===!0};ie.prototype.cork=function(){this._writableState.corked++;};ie.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||ao(this,t));};ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=I_(e)),!hn.isEncoding(e))throw new ah(e);return this._writableState.defaultEncoding=e,this};function q_(t,e,r,i,n){let o=e.objectMode?1:r.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==so&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function eh(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new gi("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1;}function th(t,e,r,i){--e.pendingcb,i(r),oo(e),jr(t,r);}function D_(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){jr(t,new oh);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?ur.nextTick(th,t,r,e,n):th(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&ao(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},ur.nextTick(j_,r.afterWriteTickInfo)):uh(t,r,1,n));}function j_({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,uh(t,e,r,i)}function uh(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&oo(e),lo(t,e);}function oo(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:s}=t.buffered[n],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new gi("write"));}let r=t[Fr].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new gi("end"));}pn(t);}function ao(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,o=r.length-i;if(!o)return;let s=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let a=e.allNoop?so:c=>{for(let h=s;h<r.length;++h)r[h].callback(c);},u=e.allNoop&&s===0?r:rh(r,s);u.allBuffers=e.allBuffers,eh(t,e,!0,e.length,u,"",a),pn(e);}else {do{let{chunk:a,encoding:u,callback:c}=r[s];r[s++]=null;let h=n?1:a.length;eh(t,e,!1,h,a,u,c);}while(s<r.length&&!e.writing);s===r.length?pn(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s;}e.bufferProcessing=!1;}ie.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new x_("_write()")};ie.prototype._writev=null;ie.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let o=lh(this,t,e);o instanceof S_&&(n=o);}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,lo(this,i,!0),i.ended=!0):i.finished?n=new L_("end"):i.destroyed&&(n=new gi("end"))),typeof r=="function"&&(n||i.finished?ur.nextTick(r,n):i[Fr].push(r)),this};function dn(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function F_(t,e){let r=!1;function i(n){if(r){jr(t,n??oh());return}if(r=!0,e.pendingcb--,n){let o=e[Fr].splice(0);for(let s=0;s<o.length;s++)o[s](n);jr(t,n,e.sync);}else dn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,ur.nextTick(no,t,e));}e.sync=!0,e.pendingcb++;try{t._final(i);}catch(n){i(n);}e.sync=!1;}function W_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,F_(t,e)):(e.prefinished=!0,t.emit("prefinish")));}function lo(t,e,r){dn(e)&&(W_(t,e),e.pendingcb===0&&(r?(e.pendingcb++,ur.nextTick((i,n)=>{dn(n)?no(i,n):n.pendingcb--;},t,e)):dn(e)&&(e.pendingcb++,no(t,e))));}function no(t,e){e.pendingcb--,e.finished=!0;let r=e[Fr].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy();}}A_(ie.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t);}},writable:{__proto__:null,get(){let t=this._writableState;return !!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t);}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return !!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var $_=gn.destroy;ie.prototype.destroy=function(t,e){let r=this._writableState;return !r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Fr].length)&&ur.nextTick(oo,r),$_.call(this,t,e),this};ie.prototype._undestroy=gn.undestroy;ie.prototype._destroy=function(t,e){e(t);};ie.prototype[C_.captureRejectionSymbol]=function(t){this.destroy(t);};var io;function fh(){return io===void 0&&(io={}),io}ie.fromWeb=function(t,e){return fh().newStreamWritableFromWritableStream(t,e)};ie.toWeb=function(t){return fh().newWritableStreamFromStreamWritable(t)};});var Sh=M((bR,Eh)=>{v();m();_();var fo=Ut(),H_=(ye(),X(_e)),{isReadable:V_,isWritable:z_,isIterable:hh,isNodeStream:K_,isReadableNodeStream:dh,isWritableNodeStream:ph,isDuplexNodeStream:G_}=tt(),gh=mt(),{AbortError:vh,codes:{ERR_INVALID_ARG_TYPE:Q_,ERR_INVALID_RETURN_VALUE:yh}}=Se(),{destroyer:Wr}=tr(),Y_=nt(),J_=di(),{createDeferredPromise:bh}=Je(),wh=Ys(),_h=globalThis.Blob||H_.Blob,X_=typeof _h<"u"?function(e){return e instanceof _h}:function(e){return !1},Z_=globalThis.AbortController||Hi().AbortController,{FunctionPrototypeCall:mh}=ce(),fr=class extends Y_{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0);}};Eh.exports=function t(e,r){if(G_(e))return e;if(dh(e))return yn({readable:e});if(ph(e))return yn({writable:e});if(K_(e))return yn({writable:!1,readable:!1});if(typeof e=="function"){let{value:n,write:o,final:s,destroy:a}=e0(e);if(hh(n))return wh(fr,n,{objectMode:!0,write:o,final:s,destroy:a});let u=n?.then;if(typeof u=="function"){let c,h=mh(u,n,d=>{if(d!=null)throw new yh("nully","body",d)},d=>{Wr(c,d);});return c=new fr({objectMode:!0,readable:!1,write:o,final(d){s(async()=>{try{await h,fo.nextTick(d,null);}catch(g){fo.nextTick(d,g);}});},destroy:a})}throw new yh("Iterable, AsyncIterable or AsyncFunction",r,n)}if(X_(e))return t(e.arrayBuffer());if(hh(e))return wh(fr,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?dh(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?ph(e?.writable)?e?.writable:t(e.writable):void 0;return yn({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return mh(i,e,o=>{o!=null&&n.push(o),n.push(null);},o=>{Wr(n,o);}),n=new fr({objectMode:!0,writable:!1,read(){}})}throw new Q_(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function e0(t){let{promise:e,resolve:r}=bh(),i=new Z_,n=i.signal;return {value:t(async function*(){for(;;){let s=e;e=null;let{chunk:a,done:u,cb:c}=await s;if(fo.nextTick(c),u)return;if(n.aborted)throw new vh(void 0,{cause:n.reason});(({promise:e,resolve:r}=bh())),yield a;}}(),{signal:n}),write(s,a,u){let c=r;r=null,c({chunk:s,done:!1,cb:u});},final(s){let a=r;r=null,a({done:!0,cb:s});},destroy(s,a){i.abort(),a(s);}}}function yn(t){let e=t.readable&&typeof t.readable.read!="function"?J_.wrap(t.readable):t.readable,r=t.writable,i=!!V_(e),n=!!z_(r),o,s,a,u,c;function h(d){let g=u;u=null,g?g(d):d&&c.destroy(d);}return c=new fr({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(gh(r,d=>{n=!1,d&&Wr(e,d),h(d);}),c._write=function(d,g,y){r.write(d,g)?y():o=y;},c._final=function(d){r.end(),s=d;},r.on("drain",function(){if(o){let d=o;o=null,d();}}),r.on("finish",function(){if(s){let d=s;s=null,d();}})),i&&(gh(e,d=>{i=!1,d&&Wr(e,d),h(d);}),e.on("readable",function(){if(a){let d=a;a=null,d();}}),e.on("end",function(){c.push(null);}),c._read=function(){for(;;){let d=e.read();if(d===null){a=c._read;return}if(!c.push(d))return}}),c._destroy=function(d,g){!d&&u!==null&&(d=new vh),a=null,o=null,s=null,u===null?g(d):(u=g,Wr(r,d),Wr(e,d));},c}});var nt=M((RR,Th)=>{v();m();_();var{ObjectDefineProperties:t0,ObjectGetOwnPropertyDescriptor:At,ObjectKeys:r0,ObjectSetPrototypeOf:Ah}=ce();Th.exports=Ve;var po=di(),Ne=uo();Ah(Ve.prototype,po.prototype);Ah(Ve,po);{let t=r0(Ne.prototype);for(let e=0;e<t.length;e++){let r=t[e];Ve.prototype[r]||(Ve.prototype[r]=Ne.prototype[r]);}}function Ve(t){if(!(this instanceof Ve))return new Ve(t);po.call(this,t),Ne.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0;}t0(Ve.prototype,{writable:{__proto__:null,...At(Ne.prototype,"writable")},writableHighWaterMark:{__proto__:null,...At(Ne.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...At(Ne.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...At(Ne.prototype,"writableBuffer")},writableLength:{__proto__:null,...At(Ne.prototype,"writableLength")},writableFinished:{__proto__:null,...At(Ne.prototype,"writableFinished")},writableCorked:{__proto__:null,...At(Ne.prototype,"writableCorked")},writableEnded:{__proto__:null,...At(Ne.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...At(Ne.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t);}}});var co;function Ih(){return co===void 0&&(co={}),co}Ve.fromWeb=function(t,e){return Ih().newStreamDuplexFromReadableWritablePair(t,e)};Ve.toWeb=function(t){return Ih().newReadableWritablePairFromDuplex(t)};var ho;Ve.from=function(t){return ho||(ho=Sh()),ho(t,"body")};});var bo=M((NR,Ch)=>{v();m();_();var{ObjectSetPrototypeOf:Rh,Symbol:i0}=ce();Ch.exports=It;var{ERR_METHOD_NOT_IMPLEMENTED:n0}=Se().codes,yo=nt(),{getHighWaterMark:s0}=sn();Rh(It.prototype,yo.prototype);Rh(It,yo);var bi=i0("kCallback");function It(t){if(!(this instanceof It))return new It(t);let e=t?s0(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),yo.call(this,t),this._readableState.sync=!1,this[bi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",o0);}function go(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t();}):(this.push(null),t&&t());}function o0(){this._final!==go&&go.call(this);}It.prototype._final=go;It.prototype._transform=function(t,e,r){throw new n0("_transform()")};It.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(t,e,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),n.ended||o===i.length||i.length<i.highWaterMark?r():this[bi]=r;});};It.prototype._read=function(){if(this[bi]){let t=this[bi];this[bi]=null,t();}};});var _o=M((KR,Ph)=>{v();m();_();var{ObjectSetPrototypeOf:Bh}=ce();Ph.exports=$r;var wo=bo();Bh($r.prototype,wo.prototype);Bh($r,wo);function $r(t){if(!(this instanceof $r))return new $r(t);wo.call(this,t);}$r.prototype._transform=function(t,e,r){r(null,t);};});var mn=M((iC,Lh)=>{v();m();_();var wi=Ut(),{ArrayIsArray:a0,Promise:l0,SymbolAsyncIterator:u0}=ce(),_n=mt(),{once:f0}=Je(),c0=tr(),Oh=nt(),{aggregateTwoErrors:h0,codes:{ERR_INVALID_ARG_TYPE:Ro,ERR_INVALID_RETURN_VALUE:mo,ERR_MISSING_ARGS:d0,ERR_STREAM_DESTROYED:p0,ERR_STREAM_PREMATURE_CLOSE:g0},AbortError:y0}=Se(),{validateFunction:b0,validateAbortSignal:w0}=fi(),{isIterable:cr,isReadable:vo,isReadableNodeStream:wn,isNodeStream:kh,isTransformStream:Hr,isWebStream:_0,isReadableStream:Eo,isReadableEnded:m0}=tt(),v0=globalThis.AbortController||Hi().AbortController,So,Ao;function xh(t,e,r){let i=!1;t.on("close",()=>{i=!0;});let n=_n(t,{readable:e,writable:r},o=>{i=!o;});return {destroy:o=>{i||(i=!0,c0.destroyer(t,o||new p0("pipe")));},cleanup:n}}function E0(t){return b0(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Io(t){if(cr(t))return t;if(wn(t))return S0(t);throw new Ro("val",["Readable","Iterable","AsyncIterable"],t)}async function*S0(t){Ao||(Ao=di()),yield*Ao.prototype[u0].call(t);}async function bn(t,e,r,{end:i}){let n,o=null,s=c=>{if(c&&(n=c),o){let h=o;o=null,h();}},a=()=>new l0((c,h)=>{n?h(n):o=()=>{n?h(n):c();};});e.on("drain",s);let u=_n(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let c of t)e.write(c)||await a();i&&e.end(),await a(),r();}catch(c){r(n!==c?h0(n,c):c);}finally{u(),e.off("drain",s);}}async function To(t,e,r,{end:i}){Hr(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r();}catch(o){try{await n.abort(o),r(o);}catch(s){r(s);}}}function A0(...t){return Mh(t,f0(E0(t)))}function Mh(t,e,r){if(t.length===1&&a0(t[0])&&(t=t[0]),t.length<2)throw new d0("streams");let i=new v0,n=i.signal,o=r?.signal,s=[];w0(o,"options.signal");function a(){y(new y0);}o?.addEventListener("abort",a);let u,c,h=[],d=0;function g(C){y(C,--d===0);}function y(C,R){if(C&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=C),!(!u&&!R)){for(;h.length;)h.shift()(u);o?.removeEventListener("abort",a),i.abort(),R&&(u||s.forEach(U=>U()),wi.nextTick(e,u,c));}}let w;for(let C=0;C<t.length;C++){let R=t[C],U=C<t.length-1,N=C>0,W=U||r?.end!==!1,K=C===t.length-1;if(kh(R)){let z=function(Q){Q&&Q.name!=="AbortError"&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(Q);};if(W){let{destroy:Q,cleanup:de}=xh(R,U,N);h.push(Q),vo(R)&&K&&s.push(de);}R.on("error",z),vo(R)&&K&&s.push(()=>{R.removeListener("error",z);});}if(C===0)if(typeof R=="function"){if(w=R({signal:n}),!cr(w))throw new mo("Iterable, AsyncIterable or Stream","source",w)}else cr(R)||wn(R)||Hr(R)?w=R:w=Oh.from(R);else if(typeof R=="function"){if(Hr(w)){var E;w=Io((E=w)===null||E===void 0?void 0:E.readable);}else w=Io(w);if(w=R(w,{signal:n}),U){if(!cr(w,!0))throw new mo("AsyncIterable",`transform[${C-1}]`,w)}else {var S;So||(So=_o());let z=new So({objectMode:!0}),Q=(S=w)===null||S===void 0?void 0:S.then;if(typeof Q=="function")d++,Q.call(w,pe=>{c=pe,pe!=null&&z.write(pe),W&&z.end(),wi.nextTick(g);},pe=>{z.destroy(pe),wi.nextTick(g,pe);});else if(cr(w,!0))d++,bn(w,z,g,{end:W});else if(Eo(w)||Hr(w)){let pe=w.readable||w;d++,bn(pe,z,g,{end:W});}else throw new mo("AsyncIterable or Promise","destination",w);w=z;let{destroy:de,cleanup:Gt}=xh(w,!1,!0);h.push(de),K&&s.push(Gt);}}else if(kh(R)){if(wn(w)){d+=2;let z=I0(w,R,g,{end:W});vo(R)&&K&&s.push(z);}else if(Hr(w)||Eo(w)){let z=w.readable||w;d++,bn(z,R,g,{end:W});}else if(cr(w))d++,bn(w,R,g,{end:W});else throw new Ro("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],w);w=R;}else if(_0(R)){if(wn(w))d++,To(Io(w),R,g,{end:W});else if(Eo(w)||cr(w))d++,To(w,R,g,{end:W});else if(Hr(w))d++,To(w.readable,R,g,{end:W});else throw new Ro("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],w);w=R;}else w=Oh.from(R);}return (n!=null&&n.aborted||o!=null&&o.aborted)&&wi.nextTick(a),w}function I0(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new g0);}),t.pipe(e,{end:!1}),i){let s=function(){n=!0,e.end();};m0(t)?wi.nextTick(s):t.once("end",s);}else r();return _n(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(s);}),_n(e,{readable:!1,writable:!0},r)}Lh.exports={pipelineImpl:Mh,pipeline:A0};});var Bo=M((dC,Fh)=>{v();m();_();var{pipeline:T0}=mn(),vn=nt(),{destroyer:R0}=tr(),{isNodeStream:En,isReadable:Uh,isWritable:Nh,isWebStream:Co,isTransformStream:hr,isWritableStream:qh,isReadableStream:Dh}=tt(),{AbortError:C0,codes:{ERR_INVALID_ARG_VALUE:jh,ERR_MISSING_ARGS:B0}}=Se(),P0=mt();Fh.exports=function(...e){if(e.length===0)throw new B0("streams");if(e.length===1)return vn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=vn.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=vn.from(e[y]);}for(let y=0;y<e.length;++y)if(!(!En(e[y])&&!Co(e[y]))){if(y<e.length-1&&!(Uh(e[y])||Dh(e[y])||hr(e[y])))throw new jh(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Nh(e[y])||qh(e[y])||hr(e[y])))throw new jh(`streams[${y}]`,r[y],"must be writable")}let i,n,o,s,a;function u(y){let w=s;s=null,w?w(y):y?a.destroy(y):!g&&!d&&a.destroy();}let c=e[0],h=T0(e,u),d=!!(Nh(c)||qh(c)||hr(c)),g=!!(Uh(h)||Dh(h)||hr(h));if(a=new vn({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(h!=null&&h.writableObjectMode),writable:d,readable:g}),d){if(En(c))a._write=function(w,E,S){c.write(w,E)?S():i=S;},a._final=function(w){c.end(),n=w;},c.on("drain",function(){if(i){let w=i;i=null,w();}});else if(Co(c)){let E=(hr(c)?c.writable:c).getWriter();a._write=async function(S,I,C){try{await E.ready,E.write(S).catch(()=>{}),C();}catch(R){C(R);}},a._final=async function(S){try{await E.ready,E.close().catch(()=>{}),n=S;}catch(I){S(I);}};}let y=hr(h)?h.readable:h;P0(y,()=>{if(n){let w=n;n=null,w();}});}if(g){if(En(h))h.on("readable",function(){if(o){let y=o;o=null,y();}}),h.on("end",function(){a.push(null);}),a._read=function(){for(;;){let y=h.read();if(y===null){o=a._read;return}if(!a.push(y))return}};else if(Co(h)){let w=(hr(h)?h.readable:h).getReader();a._read=async function(){for(;;)try{let{value:E,done:S}=await w.read();if(!a.push(E))return;if(S){a.push(null);return}}catch{return}};}}return a._destroy=function(y,w){!y&&s!==null&&(y=new C0),o=null,i=null,n=null,s===null?w(y):(s=w,En(h)&&R0(h,y));},a};});var Qh=M((SC,ko)=>{v();m();_();var Vh=globalThis.AbortController||Hi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:O0,ERR_INVALID_ARG_TYPE:_i,ERR_MISSING_ARGS:k0,ERR_OUT_OF_RANGE:x0},AbortError:st}=Se(),{validateAbortSignal:dr,validateInteger:M0,validateObject:pr}=fi(),L0=ce().Symbol("kWeak"),{finished:U0}=mt(),N0=Bo(),{addAbortSignalNoValidate:q0}=ci(),{isWritable:D0,isNodeStream:j0}=tt(),{ArrayPrototypePush:F0,MathFloor:W0,Number:$0,NumberIsNaN:H0,Promise:Wh,PromiseReject:$h,PromisePrototypeThen:V0,Symbol:zh}=ce(),Sn=zh("kEmpty"),Hh=zh("kEof");function z0(t,e){if(e!=null&&pr(e,"options"),e?.signal!=null&&dr(e.signal,"options.signal"),j0(t)&&!D0(t))throw new O0("stream",t,"must be writable");let r=N0(this,t);return e!=null&&e.signal&&q0(e.signal,r),r}function An(t,e){if(typeof t!="function")throw new _i("fn",["Function","AsyncFunction"],t);e!=null&&pr(e,"options"),e?.signal!=null&&dr(e.signal,"options.signal");let r=1;return e?.concurrency!=null&&(r=W0(e.concurrency)),M0(r,"concurrency",1),async function*(){var n,o;let s=new Vh,a=this,u=[],c=s.signal,h={signal:c},d=()=>s.abort();e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted&&d(),e==null||(o=e.signal)===null||o===void 0||o.addEventListener("abort",d);let g,y,w=!1;function E(){w=!0;}async function S(){try{for await(let R of a){var I;if(w)return;if(c.aborted)throw new st;try{R=t(R,h);}catch(U){R=$h(U);}R!==Sn&&(typeof((I=R)===null||I===void 0?void 0:I.catch)=="function"&&R.catch(E),u.push(R),g&&(g(),g=null),!w&&u.length&&u.length>=r&&await new Wh(U=>{y=U;}));}u.push(Hh);}catch(R){let U=$h(R);V0(U,void 0,E),u.push(U);}finally{var C;w=!0,g&&(g(),g=null),e==null||(C=e.signal)===null||C===void 0||C.removeEventListener("abort",d);}}S();try{for(;;){for(;u.length>0;){let I=await u[0];if(I===Hh)return;if(c.aborted)throw new st;I!==Sn&&(yield I),u.shift(),y&&(y(),y=null);}await new Wh(I=>{g=I;});}}finally{s.abort(),w=!0,y&&(y(),y=null);}}.call(this)}function K0(t=void 0){return t!=null&&pr(t,"options"),t?.signal!=null&&dr(t.signal,"options.signal"),async function*(){let r=0;for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new st({cause:t.signal.reason});yield [r++,n];}}.call(this)}async function Kh(t,e=void 0){for await(let r of Oo.call(this,t,e))return !0;return !1}async function G0(t,e=void 0){if(typeof t!="function")throw new _i("fn",["Function","AsyncFunction"],t);return !await Kh.call(this,async(...r)=>!await t(...r),e)}async function Q0(t,e){for await(let r of Oo.call(this,t,e))return r}async function Y0(t,e){if(typeof t!="function")throw new _i("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n),Sn}for await(let i of An.call(this,r,e));}function Oo(t,e){if(typeof t!="function")throw new _i("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:Sn}return An.call(this,r,e)}var Po=class extends k0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value";}};async function J0(t,e,r){var i;if(typeof t!="function")throw new _i("reducer",["Function","AsyncFunction"],t);r!=null&&pr(r,"options"),r?.signal!=null&&dr(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let c=new st(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await U0(this.destroy(c)),c}let o=new Vh,s=o.signal;if(r!=null&&r.signal){let c={once:!0,[L0]:this};r.signal.addEventListener("abort",()=>o.abort(),c);}let a=!1;try{for await(let c of this){var u;if(a=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new st;n?e=await t(e,c,{signal:s}):(e=c,n=!0);}if(!a&&!n)throw new Po}finally{o.abort();}return e}async function X0(t){t!=null&&pr(t,"options"),t?.signal!=null&&dr(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new st(void 0,{cause:t.signal.reason});F0(e,i);}return e}function Z0(t,e){let r=An.call(this,t,e);return async function*(){for await(let n of r)yield*n;}.call(this)}function Gh(t){if(t=$0(t),H0(t))return 0;if(t<0)throw new x0("number",">= 0",t);return t}function em(t,e=void 0){return e!=null&&pr(e,"options"),e?.signal!=null&&dr(e.signal,"options.signal"),t=Gh(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new st;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new st;t--<=0&&(yield o);}}.call(this)}function tm(t,e=void 0){return e!=null&&pr(e,"options"),e?.signal!=null&&dr(e.signal,"options.signal"),t=Gh(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new st;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new st;if(t-- >0)yield o;else return}}.call(this)}ko.exports.streamReturningOperators={asIndexedPairs:K0,drop:em,filter:Oo,flatMap:Z0,map:An,take:tm,compose:z0};ko.exports.promiseReturningOperators={every:G0,forEach:Y0,reduce:J0,toArray:X0,some:Kh,find:Q0};});var xo=M((xC,Yh)=>{v();m();_();var{ArrayPrototypePop:rm,Promise:im}=ce(),{isIterable:nm,isNodeStream:sm,isWebStream:om}=tt(),{pipelineImpl:am}=mn(),{finished:lm}=mt();Mo();function um(...t){return new im((e,r)=>{let i,n,o=t[t.length-1];if(o&&typeof o=="object"&&!sm(o)&&!nm(o)&&!om(o)){let s=rm(t);i=s.signal,n=s.end;}am(t,(s,a)=>{s?r(s):e(a);},{signal:i,end:n});})}Yh.exports={finished:lm,pipeline:um};});var Mo=M(($C,sd)=>{v();m();_();var{Buffer:fm}=(ye(),X(_e)),{ObjectDefineProperty:Tt,ObjectKeys:Zh,ReflectApply:ed}=ce(),{promisify:{custom:td}}=Je(),{streamReturningOperators:Jh,promiseReturningOperators:Xh}=Qh(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:rd}}=Se(),cm=Bo(),{pipeline:id}=mn(),{destroyer:hm}=tr(),nd=mt(),Lo=xo(),Uo=tt(),le=sd.exports=tn().Stream;le.isDisturbed=Uo.isDisturbed;le.isErrored=Uo.isErrored;le.isReadable=Uo.isReadable;le.Readable=di();for(let t of Zh(Jh)){let r=function(...i){if(new.target)throw rd();return le.Readable.from(ed(e,this,i))};let e=Jh[t];Tt(r,"name",{__proto__:null,value:e.name}),Tt(r,"length",{__proto__:null,value:e.length}),Tt(le.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0});}for(let t of Zh(Xh)){let r=function(...n){if(new.target)throw rd();return ed(e,this,n)};let e=Xh[t];Tt(r,"name",{__proto__:null,value:e.name}),Tt(r,"length",{__proto__:null,value:e.length}),Tt(le.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0});}le.Writable=uo();le.Duplex=nt();le.Transform=bo();le.PassThrough=_o();le.pipeline=id;var{addAbortSignal:dm}=ci();le.addAbortSignal=dm;le.finished=nd;le.destroy=hm;le.compose=cm;Tt(le,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Lo}});Tt(id,td,{__proto__:null,enumerable:!0,get(){return Lo.pipeline}});Tt(nd,td,{__proto__:null,enumerable:!0,get(){return Lo.finished}});le.Stream=le;le._isUint8Array=function(e){return e instanceof Uint8Array};le._uint8ArrayToBuffer=function(e){return fm.from(e.buffer,e.byteOffset,e.byteLength)};});var Dt=M((ZC,ue)=>{v();m();_();var he=Mo(),pm=xo(),gm=he.Readable.destroy;ue.exports=he.Readable;ue.exports._uint8ArrayToBuffer=he._uint8ArrayToBuffer;ue.exports._isUint8Array=he._isUint8Array;ue.exports.isDisturbed=he.isDisturbed;ue.exports.isErrored=he.isErrored;ue.exports.isReadable=he.isReadable;ue.exports.Readable=he.Readable;ue.exports.Writable=he.Writable;ue.exports.Duplex=he.Duplex;ue.exports.Transform=he.Transform;ue.exports.PassThrough=he.PassThrough;ue.exports.addAbortSignal=he.addAbortSignal;ue.exports.finished=he.finished;ue.exports.destroy=he.destroy;ue.exports.destroy=gm;ue.exports.pipeline=he.pipeline;ue.exports.compose=he.compose;Object.defineProperty(he,"promises",{configurable:!0,enumerable:!0,get(){return pm}});ue.exports.Stream=he.Stream;ue.exports.default=ue.exports;});var od=M((uB,qo)=>{v();m();_();typeof Object.create=="function"?qo.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}:qo.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e;}};});var ud=M((_B,ld)=>{v();m();_();var{Buffer:ze}=(ye(),X(_e)),ad=Symbol.for("BufferList");function ee(t){if(!(this instanceof ee))return new ee(t);ee._init.call(this,t);}ee._init=function(e){Object.defineProperty(this,ad,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e);};ee.prototype._new=function(e){return new ee(e)};ee.prototype._offset=function(e){if(e===0)return [0,0];let r=0;for(let i=0;i<this._bufs.length;i++){let n=r+this._bufs[i].length;if(e<n||i===this._bufs.length-1)return [i,e-r];r=n;}};ee.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let i=0;i<e;i++)r+=this._bufs[i].length;return r};ee.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};ee.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};ee.prototype.copy=function(e,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||ze.alloc(0);let o=!!e,s=this._offset(i),a=n-i,u=a,c=o&&r||0,h=s[1];if(i===0&&n===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:ze.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(e,c),c+=this._bufs[d].length;return e}if(u<=this._bufs[s[0]].length-h)return o?this._bufs[s[0]].copy(e,r,h,h+u):this._bufs[s[0]].slice(h,h+u);o||(e=ze.allocUnsafe(a));for(let d=s[0];d<this._bufs.length;d++){let g=this._bufs[d].length-h;if(u>g)this._bufs[d].copy(e,c,h),c+=g;else {this._bufs[d].copy(e,c,h,h+u),c+=g;break}u-=g,h&&(h=0);}return e.length>c?e.slice(0,c):e};ee.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let i=this._offset(e),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!==0&&(o[0]=o[0].slice(i[1])),this._new(o)};ee.prototype.toString=function(e,r,i){return this.slice(r,i).toString(e)};ee.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else {this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ee.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};ee.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(ze.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(ze.from(e));return this};ee.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length;};ee.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=ze.from([t]):typeof t=="string"?t=ze.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=ze.from(t.buffer,t.byteOffset,t.byteLength):ze.isBuffer(t)||(t=ze.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let i=this._offset(e),n=i[0],o=i[1];for(;n<this._bufs.length;n++){let s=this._bufs[n];for(;o<s.length;)if(s.length-o>=t.length){let u=s.indexOf(t,o);if(u!==-1)return this._reverseOffset([n,u]);o=s.length-t.length+1;}else {let u=this._reverseOffset([n,o]);if(this._match(u,t))return u;o++;}o=0;}return -1};ee.prototype._match=function(t,e){if(this.length-t<e.length)return !1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return !1;return !0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?ee.prototype[r]=function(i,n){return this.slice(i,i+n)[r](0,n)}:ee.prototype[r]=function(i=0){return this.slice(i,i+t[r])[r](0)};})(e);})();ee.prototype._isBufferList=function(e){return e instanceof ee||ee.isBufferList(e)};ee.isBufferList=function(e){return e!=null&&e[ad]};ld.exports=ee;});var fd=M((BB,In)=>{v();m();_();var Do=Dt().Duplex,ym=od(),mi=ud();function Ee(t){if(!(this instanceof Ee))return new Ee(t);if(typeof t=="function"){this._callback=t;let e=function(i){this._callback&&(this._callback(i),this._callback=null);}.bind(this);this.on("pipe",function(i){i.on("error",e);}),this.on("unpipe",function(i){i.removeListener("error",e);}),t=null;}mi._init.call(this,t),Do.call(this);}ym(Ee,Do);Object.assign(Ee.prototype,mi.prototype);Ee.prototype._new=function(e){return new Ee(e)};Ee.prototype._write=function(e,r,i){this._appendBuffer(e),typeof i=="function"&&i();};Ee.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e);};Ee.prototype.end=function(e){Do.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null);};Ee.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e);};Ee.prototype._isBufferList=function(e){return e instanceof Ee||e instanceof mi||Ee.isBufferList(e)};Ee.isBufferList=mi.isBufferList;In.exports=Ee;In.exports.BufferListStream=Ee;In.exports.BufferList=mi;});var hd=M((DB,cd)=>{v();m();_();var jo=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null;}};cd.exports=jo;});var Fo=M((QB,dd)=>{v();m();_();var L=dd.exports,{Buffer:Oe}=(ye(),X(_e));L.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"};L.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0};L.requiredHeaderFlagsErrors={};for(let t in L.requiredHeaderFlags){let e=L.requiredHeaderFlags[t];L.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+L.types[t]+" packet";}L.codes={};for(let t in L.types){let e=L.types[t];L.codes[e]=t;}L.CMD_SHIFT=4;L.CMD_MASK=240;L.DUP_MASK=8;L.QOS_MASK=3;L.QOS_SHIFT=1;L.RETAIN_MASK=1;L.VARBYTEINT_MASK=127;L.VARBYTEINT_FIN_MASK=128;L.VARBYTEINT_MAX=268435455;L.SESSIONPRESENT_MASK=1;L.SESSIONPRESENT_HEADER=Oe.from([L.SESSIONPRESENT_MASK]);L.CONNACK_HEADER=Oe.from([L.codes.connack<<L.CMD_SHIFT]);L.USERNAME_MASK=128;L.PASSWORD_MASK=64;L.WILL_RETAIN_MASK=32;L.WILL_QOS_MASK=24;L.WILL_QOS_SHIFT=3;L.WILL_FLAG_MASK=4;L.CLEAN_SESSION_MASK=2;L.CONNECT_HEADER=Oe.from([L.codes.connect<<L.CMD_SHIFT]);L.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11};L.propertiesCodes={};for(let t in L.properties){let e=L.properties[t];L.propertiesCodes[e]=t;}L.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function jt(t){return [0,1,2].map(e=>[0,1].map(r=>[0,1].map(i=>{let n=Oe.alloc(1);return n.writeUInt8(L.codes[t]<<L.CMD_SHIFT|(r?L.DUP_MASK:0)|e<<L.QOS_SHIFT|i,0,!0),n})))}L.PUBLISH_HEADER=jt("publish");L.SUBSCRIBE_HEADER=jt("subscribe");L.SUBSCRIBE_OPTIONS_QOS_MASK=3;L.SUBSCRIBE_OPTIONS_NL_MASK=1;L.SUBSCRIBE_OPTIONS_NL_SHIFT=2;L.SUBSCRIBE_OPTIONS_RAP_MASK=1;L.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;L.SUBSCRIBE_OPTIONS_RH_MASK=3;L.SUBSCRIBE_OPTIONS_RH_SHIFT=4;L.SUBSCRIBE_OPTIONS_RH=[0,16,32];L.SUBSCRIBE_OPTIONS_NL=4;L.SUBSCRIBE_OPTIONS_RAP=8;L.SUBSCRIBE_OPTIONS_QOS=[0,1,2];L.UNSUBSCRIBE_HEADER=jt("unsubscribe");L.ACKS={unsuback:jt("unsuback"),puback:jt("puback"),pubcomp:jt("pubcomp"),pubrel:jt("pubrel"),pubrec:jt("pubrec")};L.SUBACK_HEADER=Oe.from([L.codes.suback<<L.CMD_SHIFT]);L.VERSION3=Oe.from([3]);L.VERSION4=Oe.from([4]);L.VERSION5=Oe.from([5]);L.VERSION131=Oe.from([131]);L.VERSION132=Oe.from([132]);L.QOS=[0,1,2].map(t=>Oe.from([t]));L.EMPTY={pingreq:Oe.from([L.codes.pingreq<<4,0]),pingresp:Oe.from([L.codes.pingresp<<4,0]),disconnect:Oe.from([L.codes.disconnect<<4,0])};L.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"};L.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};L.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};L.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"};L.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};L.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"};});var gd=M((sP,pd)=>{v();m();_();var Vr=1e3,zr=Vr*60,Kr=zr*60,gr=Kr*24,bm=gr*7,wm=gr*365.25;pd.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return _m(t);if(r==="number"&&isFinite(t))return e.long?vm(t):mm(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _m(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*wm;case"weeks":case"week":case"w":return r*bm;case"days":case"day":case"d":return r*gr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Kr;case"minutes":case"minute":case"mins":case"min":case"m":return r*zr;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function mm(t){var e=Math.abs(t);return e>=gr?Math.round(t/gr)+"d":e>=Kr?Math.round(t/Kr)+"h":e>=zr?Math.round(t/zr)+"m":e>=Vr?Math.round(t/Vr)+"s":t+"ms"}function vm(t){var e=Math.abs(t);return e>=gr?Tn(t,e,gr,"day"):e>=Kr?Tn(t,e,Kr,"hour"):e>=zr?Tn(t,e,zr,"minute"):e>=Vr?Tn(t,e,Vr,"second"):t+" ms"}function Tn(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var bd=M((gP,yd)=>{v();m();_();function Em(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=n,r.enabled=s,r.humanize=gd(),r.destroy=c,Object.keys(t).forEach(h=>{r[h]=t[h];}),r.names=[],r.skips=[],r.formatters={};function e(h){let d=0;for(let g=0;g<h.length;g++)d=(d<<5)-d+h.charCodeAt(g),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(h){let d,g=null,y,w;function E(...S){if(!E.enabled)return;let I=E,C=Number(new Date),R=C-(d||C);I.diff=R,I.prev=d,I.curr=C,d=C,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let U=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(W,K)=>{if(W==="%%")return "%";U++;let z=r.formatters[K];if(typeof z=="function"){let Q=S[U];W=z.call(I,Q),S.splice(U,1),U--;}return W}),r.formatArgs.call(I,S),(I.log||r.log).apply(I,S);}return E.namespace=h,E.useColors=r.useColors(),E.color=r.selectColor(h),E.extend=i,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(y!==r.namespaces&&(y=r.namespaces,w=r.enabled(h)),w),set:S=>{g=S;}}),typeof r.init=="function"&&r.init(E),E}function i(h,d){let g=r(this.namespace+(typeof d>"u"?":":d)+h);return g.log=this.log,g}function n(h){r.save(h),r.namespaces=h,r.names=[],r.skips=[];let d,g=(typeof h=="string"?h:"").split(/[\s,]+/),y=g.length;for(d=0;d<y;d++)g[d]&&(h=g[d].replace(/\*/g,".*?"),h[0]==="-"?r.skips.push(new RegExp("^"+h.slice(1)+"$")):r.names.push(new RegExp("^"+h+"$")));}function o(){let h=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),h}function s(h){if(h[h.length-1]==="*")return !0;let d,g;for(d=0,g=r.skips.length;d<g;d++)if(r.skips[d].test(h))return !1;for(d=0,g=r.names.length;d<g;d++)if(r.names[d].test(h))return !0;return !1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function u(h){return h instanceof Error?h.stack||h.message:h}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return r.enable(r.load()),r}yd.exports=Em;});var ot=M((xe,Rn)=>{v();m();_();xe.formatArgs=Am;xe.save=Im;xe.load=Tm;xe.useColors=Sm;xe.storage=Rm();xe.destroy=(()=>{let t=!1;return ()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();xe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Sm(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof B<"u"&&B.userAgent&&B.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof B<"u"&&B.userAgent&&B.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof B<"u"&&B.userAgent&&B.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Am(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Rn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r));}),t.splice(i,0,e);}xe.log=console.debug||console.log||(()=>{});function Im(t){try{t?xe.storage.setItem("debug",t):xe.storage.removeItem("debug");}catch{}}function Tm(){let t;try{t=xe.storage.getItem("debug");}catch{}return !t&&typeof P<"u"&&"env"in P&&(t=P.env.DEBUG),t}function Rm(){try{return localStorage}catch{}}Rn.exports=bd()(xe);var{formatters:Cm}=Rn.exports;Cm.j=function(t){try{return JSON.stringify(t)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});var md=M((MP,_d)=>{v();m();_();var Bm=fd(),{EventEmitter:Pm}=(ir(),X(rr)),wd=hd(),V=Fo(),D=ot()("mqtt-packet:parser"),Wo=class t extends Pm{constructor(){super(),this.parser=this.constructor.parser;}static parser(e){return this instanceof t?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new t().parser(e)}_resetState(){D("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new wd,this.error=null,this._list=Bm(),this._stateCounter=0;}parse(e){for(this.error&&this._resetState(),this._list.append(e),D("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,D("parse: state complete. _stateCounter is now: %d",this._stateCounter),D("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return D("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),r=e>>V.CMD_SHIFT;this.packet.cmd=V.types[r];let i=e&15,n=V.requiredHeaderFlags[r];return n!=null&&i!==n?this._emitError(new Error(V.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&V.RETAIN_MASK)!==0,this.packet.qos=e>>V.QOS_SHIFT&V.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&V.DUP_MASK)!==0,D("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),D("_parseLength %d",e.value),!!e}_parsePayload(){D("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"));}e=!0;}return D("_parsePayload complete result: %s",e),e}_parseConnect(){D("_parseConnect");let e,r,i,n,o={},s=this.packet,a=this._parseString();if(a===null)return this._emitError(new Error("Cannot parse protocolId"));if(a!=="MQTT"&&a!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(s.protocolId=a,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),s.protocolVersion!==3&&s.protocolVersion!==4&&s.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));o.username=this._list.readUInt8(this._pos)&V.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&V.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&V.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&V.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&V.WILL_QOS_MASK)>>V.WILL_QOS_SHIFT;if(o.will)s.will={},s.will.retain=u,s.will.qos=c;else {if(u)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(s.clean=(this._list.readUInt8(this._pos)&V.CLEAN_SESSION_MASK)!==0,this._pos++,s.keepalive=this._parseNum(),s.keepalive===-1)return this._emitError(new Error("Packet too short"));if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.properties=d);}let h=this._parseString();if(h===null)return this._emitError(new Error("Packet too short"));if(s.clientId=h,D("_parseConnect: packet.clientId: %s",s.clientId),o.will){if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.will.properties=d);}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(s.will.topic=e,D("_parseConnect: packet.will.topic: %s",s.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));s.will.payload=r,D("_parseConnect: packet.will.paylaod: %s",s.will.payload);}if(o.username){if(n=this._parseString(),n===null)return this._emitError(new Error("Cannot parse username"));s.username=n,D("_parseConnect: packet.username: %s",s.username);}if(o.password){if(i=this._parseBuffer(),i===null)return this._emitError(new Error("Cannot parse password"));s.password=i;}return this.settings=s,D("_parseConnect: complete"),s}_parseConnack(){D("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let r=this._list.readUInt8(this._pos++);if(r>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(r&V.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else {if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++);}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let i=this._parseProperties();Object.getOwnPropertyNames(i).length&&(e.properties=i);}D("_parseConnack: complete");}_parsePublish(){D("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}e.payload=this._list.slice(this._pos,e.length),D("_parsePublish: payload from buffer list: %o",e.payload);}}_parseSubscribe(){D("_parseSubscribe");let e=this.packet,r,i,n,o,s,a,u;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(e.properties=c);}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(r=this._parseString(),r===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(i=this._parseByte(),this.settings.protocolVersion===5){if(i&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(i&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=i&V.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(i>>V.SUBSCRIBE_OPTIONS_NL_SHIFT&V.SUBSCRIBE_OPTIONS_NL_MASK)!==0,s=(i>>V.SUBSCRIBE_OPTIONS_RAP_SHIFT&V.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,o=i>>V.SUBSCRIBE_OPTIONS_RH_SHIFT&V.SUBSCRIBE_OPTIONS_RH_MASK,o>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));u={topic:r,qos:n},this.settings.protocolVersion===5?(u.nl=a,u.rap=s,u.rh=o):this.settings.bridgeMode&&(u.rh=0,u.rap=!0,u.nl=!0),D("_parseSubscribe: push subscription `%s` to subscription",u),e.subscriptions.push(u);}}}_parseSuback(){D("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let r=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!V.MQTT5_SUBACK_CODES[r])return this._emitError(new Error("Invalid suback code"))}else if(r>2&&r!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(r);}}}_parseUnsubscribe(){D("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let r=this._parseString();if(r===null)return this._emitError(new Error("Cannot parse topic"));D("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r);}}}_parseUnsuback(){D("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&e.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let r=this._parseProperties();for(Object.getOwnPropertyNames(r).length&&(e.properties=r),e.granted=[];this._pos<this.packet.length;){let i=this._list.readUInt8(this._pos++);if(!V.MQTT5_UNSUBACK_CODES[i])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(i);}}}_parseConfirmation(){D("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!V.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!V.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}D("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode);}else e.reasonCode=0;if(e.length>3){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}}return !0}_parseDisconnect(){let e=this.packet;if(D("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),V.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}return D("_parseDisconnect result: true"),!0}_parseAuth(){D("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!V.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let r=this._parseProperties();return Object.getOwnPropertyNames(r).length&&(e.properties=r),D("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(D("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),i=r+this._pos;if(r===-1||i>this._list.length||i>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,i);return this._pos+=r,D("_parseString: result: %s",n),n}_parseStringPair(){return D("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),r=e+this._pos;if(e===-1||r>this._list.length||r>this.packet.length)return null;let i=this._list.slice(this._pos,r);return this._pos+=e,D("_parseBuffer: result: %o",i),i}_parseNum(){if(this._list.length-this._pos<2)return -1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,D("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return -1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,D("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){D("_parseVarByteNum");let r=4,i=0,n=1,o=0,s=!1,a,u=this._pos?this._pos:0;for(;i<r&&u+i<this._list.length;){if(a=this._list.readUInt8(u+i++),o+=n*(a&V.VARBYTEINT_MASK),n*=128,!(a&V.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=i)break}return !s&&i===r&&this._list.length>=i&&this._emitError(new Error("Invalid variable byte integer")),u&&(this._pos+=i),s?e?s={bytes:i,value:o}:s=o:s=!1,D("_parseVarByteNum: result: %o",s),s}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),D("_parseByte: result: %o",e),e}_parseByType(e){switch(D("_parseByType: type: %s",e),e){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){D("_parseProperties");let e=this._parseVarByteNum(),i=this._pos+e,n={};for(;this._pos<i;){let o=this._parseByte();if(!o)return this._emitError(new Error("Cannot parse property code type")),!1;let s=V.propertiesCodes[o];if(!s)return this._emitError(new Error("Unknown property")),!1;if(s==="userProperties"){n[s]||(n[s]=Object.create(null));let a=this._parseByType(V.propertiesTypes[s]);if(n[s][a.name])if(Array.isArray(n[s][a.name]))n[s][a.name].push(a.value);else {let u=n[s][a.name];n[s][a.name]=[u],n[s][a.name].push(a.value);}else n[s][a.name]=a.value;continue}n[s]?Array.isArray(n[s])?n[s].push(this._parseByType(V.propertiesTypes[s])):(n[s]=[n[s]],n[s].push(this._parseByType(V.propertiesTypes[s]))):n[s]=this._parseByType(V.propertiesTypes[s]);}return n}_newPacket(){return D("_newPacket"),this.packet&&(this._list.consume(this.packet.length),D("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),D("_newPacket: new packet"),this.packet=new wd,this._pos=0,!0}_emitError(e){D("_emitError",e),this.error=e,this.emit("error",e);}};_d.exports=Wo;});var Ad=M((HP,Sd)=>{v();m();_();var{Buffer:vi}=(ye(),X(_e)),Om=65536,vd={},km=vi.isBuffer(vi.from([1,2]).subarray(0,1));function Ed(t){let e=vi.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,0+1),e}function xm(){for(let t=0;t<Om;t++)vd[t]=Ed(t);}function Mm(t){let r=0,i=0,n=vi.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),n.writeUInt8(r,i++);while(t>0&&i<4);return t>0&&(i=0),km?n.subarray(0,i):n.slice(0,i)}function Lm(t){let e=vi.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Sd.exports={cache:vd,generateCache:xm,generateNumber:Ed,genBufVariableByteInt:Mm,generate4ByteBuffer:Lm};});var Id=M((eO,$o)=>{v();m();_();typeof P>"u"||!P.version||P.version.indexOf("v0.")===0||P.version.indexOf("v1.")===0&&P.version.indexOf("v1.8.")!==0?$o.exports={nextTick:Um}:$o.exports=P;function Um(t,e,r,i){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,s;switch(n){case 0:case 1:return P.nextTick(t);case 2:return P.nextTick(function(){t.call(null,e);});case 3:return P.nextTick(function(){t.call(null,e,r);});case 4:return P.nextTick(function(){t.call(null,e,r,i);});default:for(o=new Array(n-1),s=0;s<o.length;)o[s++]=arguments[s];return P.nextTick(function(){t.apply(null,o);})}}});var zo=M((fO,xd)=>{v();m();_();var j=Fo(),{Buffer:q}=(ye(),X(_e)),Nm=q.allocUnsafe(0),qm=q.from([0]),Ei=Ad(),Dm=Id().nextTick,qe=ot()("mqtt-packet:writeToStream"),Cn=Ei.cache,jm=Ei.generateNumber,Fm=Ei.generateCache,Ho=Ei.genBufVariableByteInt,Wm=Ei.generate4ByteBuffer,Ie=Vo,Bn=!0;function Od(t,e,r){switch(qe("generate called"),e.cork&&(e.cork(),Dm($m,e)),Bn&&(Bn=!1,Fm()),qe("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return Hm(t,e);case"connack":return Vm(t,e,r);case"publish":return zm(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return Km(t,e,r);case"subscribe":return Gm(t,e,r);case"suback":return Qm(t,e,r);case"unsubscribe":return Ym(t,e,r);case"unsuback":return Jm(t,e,r);case"pingreq":case"pingresp":return Xm(t,e);case"disconnect":return Zm(t,e,r);case"auth":return e1(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Od,"cacheNumbers",{get(){return Ie===Vo},set(t){t?((!Cn||Object.keys(Cn).length===0)&&(Bn=!0),Ie=Vo):(Bn=!1,Ie=t1);}});function $m(t){t.uncork();}function Hm(t,e,r){let i=t||{},n=i.protocolId||"MQTT",o=i.protocolVersion||4,s=i.will,a=i.clean,u=i.keepalive||0,c=i.clientId||"",h=i.username,d=i.password,g=i.properties;a===void 0&&(a=!0);let y=0;if(!n||typeof n!="string"&&!q.isBuffer(n))return e.destroy(new Error("Invalid protocolId")),!1;if(y+=n.length+2,o!==3&&o!==4&&o!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(y+=1,(typeof c=="string"||q.isBuffer(c))&&(c||o>=4)&&(c||a))y+=q.byteLength(c)+2;else {if(o<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(a*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof u!="number"||u<0||u>65535||u%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;y+=2,y+=1;let w,E;if(o===5){if(w=Ft(e,g),!w)return !1;y+=w.length;}if(s){if(typeof s!="object")return e.destroy(new Error("Invalid will")),!1;if(!s.topic||typeof s.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(y+=q.byteLength(s.topic)+2,y+=2,s.payload)if(s.payload.length>=0)typeof s.payload=="string"?y+=q.byteLength(s.payload):y+=s.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(E={},o===5){if(E=Ft(e,s.properties),!E)return !1;y+=E.length;}}let S=!1;if(h!=null)if(Pd(h))S=!0,y+=q.byteLength(h)+2;else return e.destroy(new Error("Invalid username")),!1;if(d!=null){if(!S)return e.destroy(new Error("Username is required to use password")),!1;if(Pd(d))y+=kd(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(j.CONNECT_HEADER),De(e,y),Gr(e,n),i.bridgeMode&&(o+=128),e.write(o===131?j.VERSION131:o===132?j.VERSION132:o===4?j.VERSION4:o===5?j.VERSION5:j.VERSION3);let I=0;return I|=h!=null?j.USERNAME_MASK:0,I|=d!=null?j.PASSWORD_MASK:0,I|=s&&s.retain?j.WILL_RETAIN_MASK:0,I|=s&&s.qos?s.qos<<j.WILL_QOS_SHIFT:0,I|=s?j.WILL_FLAG_MASK:0,I|=a?j.CLEAN_SESSION_MASK:0,e.write(q.from([I])),Ie(e,u),o===5&&w.write(),Gr(e,c),s&&(o===5&&E.write(),yr(e,s.topic),Gr(e,s.payload)),h!=null&&Gr(e,h),d!=null&&Gr(e,d),!0}function Vm(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=i===5?n.reasonCode:n.returnCode,s=n.properties,a=2;if(typeof o!="number")return e.destroy(new Error("Invalid return code")),!1;let u=null;if(i===5){if(u=Ft(e,s),!u)return !1;a+=u.length;}return e.write(j.CONNACK_HEADER),De(e,a),e.write(n.sessionPresent?j.SESSIONPRESENT_HEADER:qm),e.write(q.from([o])),u?.write(),!0}function zm(t,e,r){qe("publish: packet: %o",t);let i=r?r.protocolVersion:4,n=t||{},o=n.qos||0,s=n.retain?j.RETAIN_MASK:0,a=n.topic,u=n.payload||Nm,c=n.messageId,h=n.properties,d=0;if(typeof a=="string")d+=q.byteLength(a)+2;else if(q.isBuffer(a))d+=a.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(q.isBuffer(u)?d+=u.length:d+=q.byteLength(u),o&&typeof c!="number")return e.destroy(new Error("Invalid messageId")),!1;o&&(d+=2);let g=null;if(i===5){if(g=Ft(e,h),!g)return !1;d+=g.length;}return e.write(j.PUBLISH_HEADER[o][n.dup?1:0][s?1:0]),De(e,d),Ie(e,kd(a)),e.write(a),o>0&&Ie(e,c),g?.write(),qe("publish: payload: %o",u),e.write(u)}function Km(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.cmd||"puback",s=n.messageId,a=n.dup&&o==="pubrel"?j.DUP_MASK:0,u=0,c=n.reasonCode,h=n.properties,d=i===5?3:2;if(o==="pubrel"&&(u=1),typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;let g=null;if(i===5&&typeof h=="object"){if(g=Si(e,h,r,d),!g)return !1;d+=g.length;}return e.write(j.ACKS[o][u][a][0]),d===3&&(d+=c!==0?1:-1),De(e,d),Ie(e,s),i===5&&d!==2&&e.write(q.from([c])),g!==null?g.write():d===4&&e.write(q.from([0])),!0}function Gm(t,e,r){qe("subscribe: packet: ");let i=r?r.protocolVersion:4,n=t||{},o=n.dup?j.DUP_MASK:0,s=n.messageId,a=n.subscriptions,u=n.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;c+=2;let h=null;if(i===5){if(h=Ft(e,u),!h)return !1;c+=h.length;}if(typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){let y=a[g].topic,w=a[g].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof w!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(i===5){if(typeof(a[g].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(a[g].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let I=a[g].rh||0;if(typeof I!="number"||I>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=q.byteLength(y)+2+1;}else return e.destroy(new Error("Invalid subscriptions")),!1;qe("subscribe: writing to stream: %o",j.SUBSCRIBE_HEADER),e.write(j.SUBSCRIBE_HEADER[1][o?1:0][0]),De(e,c),Ie(e,s),h!==null&&h.write();let d=!0;for(let g of a){let y=g.topic,w=g.qos,E=+g.nl,S=+g.rap,I=g.rh,C;yr(e,y),C=j.SUBSCRIBE_OPTIONS_QOS[w],i===5&&(C|=E?j.SUBSCRIBE_OPTIONS_NL:0,C|=S?j.SUBSCRIBE_OPTIONS_RAP:0,C|=I?j.SUBSCRIBE_OPTIONS_RH[I]:0),d=e.write(q.from([C]));}return d}function Qm(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.granted,a=n.properties,u=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(u+=2,typeof s=="object"&&s.length)for(let h=0;h<s.length;h+=1){if(typeof s[h]!="number")return e.destroy(new Error("Invalid qos vector")),!1;u+=1;}else return e.destroy(new Error("Invalid qos vector")),!1;let c=null;if(i===5){if(c=Si(e,a,r,u),!c)return !1;u+=c.length;}return e.write(j.SUBACK_HEADER),De(e,u),Ie(e,o),c!==null&&c.write(),e.write(q.from(s))}function Ym(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?j.DUP_MASK:0,a=n.unsubscriptions,u=n.properties,c=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){if(typeof a[g]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;c+=q.byteLength(a[g])+2;}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let h=null;if(i===5){if(h=Ft(e,u),!h)return !1;c+=h.length;}e.write(j.UNSUBSCRIBE_HEADER[1][s?1:0][0]),De(e,c),Ie(e,o),h!==null&&h.write();let d=!0;for(let g=0;g<a.length;g++)d=yr(e,a[g]);return d}function Jm(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?j.DUP_MASK:0,a=n.granted,u=n.properties,c=n.cmd,h=0,d=2;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(i===5)if(typeof a=="object"&&a.length)for(let y=0;y<a.length;y+=1){if(typeof a[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1;}else return e.destroy(new Error("Invalid qos vector")),!1;let g=null;if(i===5){if(g=Si(e,u,r,d),!g)return !1;d+=g.length;}return e.write(j.ACKS[c][h][s][0]),De(e,d),Ie(e,o),g!==null&&g.write(),i===5&&e.write(q.from(a)),!0}function Xm(t,e,r){return e.write(j.EMPTY[t.cmd])}function Zm(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0,u=null;if(i===5){if(u=Si(e,s,r,a),!u)return !1;a+=u.length;}return e.write(q.from([j.codes.disconnect<<4])),De(e,a),i===5&&e.write(q.from([o])),u!==null&&u.write(),!0}function e1(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0;i!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let u=Si(e,s,r,a);return u?(a+=u.length,e.write(q.from([j.codes.auth<<4])),De(e,a),e.write(q.from([o])),u!==null&&u.write(),!0):!1}var Td={};function De(t,e){if(e>j.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Td[e];return r||(r=Ho(e),e<16384&&(Td[e]=r)),qe("writeVarByteInt: writing to stream: %o",r),t.write(r)}function yr(t,e){let r=q.byteLength(e);return Ie(t,r),qe("writeString: %s",e),t.write(e,"utf8")}function Rd(t,e,r){yr(t,e),yr(t,r);}function Vo(t,e){return qe("writeNumberCached: number: %d",e),qe("writeNumberCached: %o",Cn[e]),t.write(Cn[e])}function t1(t,e){let r=jm(e);return qe("writeNumberGenerated: %o",r),t.write(r)}function r1(t,e){let r=Wm(e);return qe("write4ByteNumber: %o",r),t.write(r)}function Gr(t,e){typeof e=="string"?yr(t,e):e?(Ie(t,e.length),t.write(e)):Ie(t,0);}function Ft(t,e){if(typeof e!="object"||e.length!=null)return {length:1,write(){Bd(t,{},0);}};let r=0;function i(o,s){let a=j.propertiesTypes[o],u=0;switch(a){case"byte":{if(typeof s!="boolean")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+1;break}case"int8":{if(typeof s!="number"||s<0||s>255)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+1;break}case"binary":{if(s&&s===null)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+q.byteLength(s)+2;break}case"int16":{if(typeof s!="number"||s<0||s>65535)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+2;break}case"int32":{if(typeof s!="number"||s<0||s>4294967295)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+4;break}case"var":{if(typeof s!="number"||s<0||s>268435455)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+q.byteLength(Ho(s));break}case"string":{if(typeof s!="string")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=1+2+q.byteLength(s.toString());break}case"pair":{if(typeof s!="object")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;u+=Object.getOwnPropertyNames(s).reduce((c,h)=>{let d=s[h];return Array.isArray(d)?c+=d.reduce((g,y)=>(g+=1+2+q.byteLength(h.toString())+2+q.byteLength(y.toString()),g),0):c+=1+2+q.byteLength(h.toString())+2+q.byteLength(s[h].toString()),c},0);break}default:return t.destroy(new Error(`Invalid property ${o}: ${s}`)),!1}return u}if(e)for(let o in e){let s=0,a=0,u=e[o];if(Array.isArray(u))for(let c=0;c<u.length;c++){if(a=i(o,u[c]),!a)return !1;s+=a;}else {if(a=i(o,u),!a)return !1;s=a;}if(!s)return !1;r+=s;}return {length:q.byteLength(Ho(r))+r,write(){Bd(t,e,r);}}}function Si(t,e,r,i){let n=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=Ft(t,e);if(o)for(;i+s.length>o;){let a=n.shift();if(a&&e[a])delete e[a],s=Ft(t,e);else return !1}return s}function Cd(t,e,r){switch(j.propertiesTypes[e]){case"byte":{t.write(q.from([j.properties[e]])),t.write(q.from([+r]));break}case"int8":{t.write(q.from([j.properties[e]])),t.write(q.from([r]));break}case"binary":{t.write(q.from([j.properties[e]])),Gr(t,r);break}case"int16":{t.write(q.from([j.properties[e]])),Ie(t,r);break}case"int32":{t.write(q.from([j.properties[e]])),r1(t,r);break}case"var":{t.write(q.from([j.properties[e]])),De(t,r);break}case"string":{t.write(q.from([j.properties[e]])),yr(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(n=>{let o=r[n];Array.isArray(o)?o.forEach(s=>{t.write(q.from([j.properties[e]])),Rd(t,n.toString(),s.toString());}):(t.write(q.from([j.properties[e]])),Rd(t,n.toString(),o.toString()));});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Bd(t,e,r){De(t,r);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==null){let n=e[i];if(Array.isArray(n))for(let o=0;o<n.length;o++)Cd(t,i,n[o]);else Cd(t,i,n);}}function kd(t){return t?t instanceof q?t.length:q.byteLength(t):0}function Pd(t){return typeof t=="string"||t instanceof q}xd.exports=Od;});var Ud=M((mO,Ld)=>{v();m();_();var i1=zo(),{EventEmitter:n1}=(ir(),X(rr)),{Buffer:Md}=(ye(),X(_e));function s1(t,e){let r=new Ko;return i1(t,r,e),r.concat()}var Ko=class extends n1{constructor(){super(),this._array=new Array(20),this._i=0;}write(e){return this._array[this._i++]=e,!0}concat(){let e=0,r=new Array(this._array.length),i=this._array,n=0,o;for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?r[o]=i[o].length:r[o]=Md.byteLength(i[o]),e+=r[o];let s=Md.allocUnsafe(e);for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?(i[o].copy(s,n),n+=r[o]):(s.write(i[o],n),n+=r[o]);return s}destroy(e){e&&this.emit("error",e);}};Ld.exports=s1;});var Nd=M(Pn=>{v();m();_();Pn.parser=md().parser;Pn.generate=Ud();Pn.writeToStream=zo();});var Yo=M(Qo=>{v();m();_();Object.defineProperty(Qo,"__esModule",{value:!0});var Go=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535));}allocate(){let e=this.nextId++;return this.nextId===65536&&(this.nextId=1),e}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(e){return !0}deallocate(e){}clear(){}};Qo.default=Go;});var Dd=M((YO,qd)=>{v();m();_();qd.exports=o1;function Qr(t){return t instanceof x?x.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function o1(t){if(t=t||{},t.circles)return a1(t);return t.proto?i:r;function e(n,o){for(var s=Object.keys(n),a=new Array(s.length),u=0;u<s.length;u++){var c=s[u],h=n[c];typeof h!="object"||h===null?a[c]=h:h instanceof Date?a[c]=new Date(h):ArrayBuffer.isView(h)?a[c]=Qr(h):a[c]=o(h);}return a}function r(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,r);if(n instanceof Map)return new Map(e(Array.from(n),r));if(n instanceof Set)return new Set(e(Array.from(n),r));var o={};for(var s in n)if(Object.hasOwnProperty.call(n,s)!==!1){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),r)):a instanceof Set?o[s]=new Set(e(Array.from(a),r)):ArrayBuffer.isView(a)?o[s]=Qr(a):o[s]=r(a);}return o}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,i);if(n instanceof Map)return new Map(e(Array.from(n),i));if(n instanceof Set)return new Set(e(Array.from(n),i));var o={};for(var s in n){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),i)):a instanceof Set?o[s]=new Set(e(Array.from(a),i)):ArrayBuffer.isView(a)?o[s]=Qr(a):o[s]=i(a);}return o}}function a1(t){var e=[],r=[];return t.proto?o:n;function i(s,a){for(var u=Object.keys(s),c=new Array(u.length),h=0;h<u.length;h++){var d=u[h],g=s[d];if(typeof g!="object"||g===null)c[d]=g;else if(g instanceof Date)c[d]=new Date(g);else if(ArrayBuffer.isView(g))c[d]=Qr(g);else {var y=e.indexOf(g);y!==-1?c[d]=r[y]:c[d]=a(g);}}return c}function n(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,n);if(s instanceof Map)return new Map(i(Array.from(s),n));if(s instanceof Set)return new Set(i(Array.from(s),n));var a={};e.push(s),r.push(a);for(var u in s)if(Object.hasOwnProperty.call(s,u)!==!1){var c=s[u];if(typeof c!="object"||c===null)a[u]=c;else if(c instanceof Date)a[u]=new Date(c);else if(c instanceof Map)a[u]=new Map(i(Array.from(c),n));else if(c instanceof Set)a[u]=new Set(i(Array.from(c),n));else if(ArrayBuffer.isView(c))a[u]=Qr(c);else {var h=e.indexOf(c);h!==-1?a[u]=r[h]:a[u]=n(c);}}return e.pop(),r.pop(),a}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,o);if(s instanceof Map)return new Map(i(Array.from(s),o));if(s instanceof Set)return new Set(i(Array.from(s),o));var a={};e.push(s),r.push(a);for(var u in s){var c=s[u];if(typeof c!="object"||c===null)a[u]=c;else if(c instanceof Date)a[u]=new Date(c);else if(c instanceof Map)a[u]=new Map(i(Array.from(c),o));else if(c instanceof Set)a[u]=new Set(i(Array.from(c),o));else if(ArrayBuffer.isView(c))a[u]=Qr(c);else {var h=e.indexOf(c);h!==-1?a[u]=r[h]:a[u]=o(c);}}return e.pop(),r.pop(),a}}});var Fd=M((ok,jd)=>{v();m();_();jd.exports=Dd()();});var $d=M(Yr=>{v();m();_();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.validateTopics=Yr.validateTopic=void 0;function Wd(t){let e=t.split("/");for(let r=0;r<e.length;r++)if(e[r]!=="+"){if(e[r]==="#")return r===e.length-1;if(e[r].indexOf("+")!==-1||e[r].indexOf("#")!==-1)return !1}return !0}Yr.validateTopic=Wd;function l1(t){if(t.length===0)return "empty_topic_list";for(let e=0;e<t.length;e++)if(!Wd(t[e]))return t[e];return null}Yr.validateTopics=l1;});var Zo=M(Xo=>{v();m();_();Object.defineProperty(Xo,"__esModule",{value:!0});var u1=Dt(),f1={objectMode:!0},c1={clean:!0},Jo=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},c1),e),this._inflights=new Map;}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new u1.Readable(f1),r=[],i=!1,n=0;return this._inflights.forEach((o,s)=>{r.push(o);}),e._read=()=>{!i&&n<r.length?e.push(r[n++]):e.push(null);},e.destroy=o=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close");},0),e},e}del(e,r){let i=this._inflights.get(e.messageId);return i?(this._inflights.delete(e.messageId),r(null,i)):r&&r(new Error("missing packet")),this}get(e,r){let i=this._inflights.get(e.messageId);return i?r(null,i):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e();}};Xo.default=Jo;});var Vd=M(ea=>{v();m();_();Object.defineProperty(ea,"__esModule",{value:!0});var Hd=[0,16,128,131,135,144,145,151,153],h1=(t,e,r)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),n=e.payload,{qos:o}=e,{messageId:s}=e,{options:a}=t;if(t.options.protocolVersion===5){let u;if(e.properties&&(u=e.properties.topicAlias),typeof u<"u")if(i.length===0)if(u>0&&u<=65535){let c=t.topicAliasRecv.getTopicByAlias(u);if(c)i=c,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,u);else {t.log("handlePublish :: unregistered topic alias. alias: %d",u),t.emit("error",new Error("Received unregistered Topic Alias"));return}}else {t.log("handlePublish :: topic alias out of range. alias: %d",u),t.emit("error",new Error("Received Topic Alias is out of range"));return}else if(t.topicAliasRecv.put(i,u))t.log("handlePublish :: registered topic: %s - alias: %d",i,u);else {t.log("handlePublish :: topic alias out of range. alias: %d",u),t.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(t.log("handlePublish: qos %d",o),o){case 2:{a.customHandleAcks(i,n,e,(u,c)=>{if(typeof u=="number"&&(c=u,u=null),u)return t.emit("error",u);if(Hd.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for pubrec"));c?t._sendPacket({cmd:"pubrec",messageId:s,reasonCode:c},r):t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:s},r);});});break}case 1:{a.customHandleAcks(i,n,e,(u,c)=>{if(typeof u=="number"&&(c=u,u=null),u)return t.emit("error",u);if(Hd.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for puback"));c||t.emit("message",i,n,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:s,reasonCode:c},r);});});break}case 0:t.emit("message",i,n,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};ea.default=h1;});var Jr=M(Wt=>{v();m();_();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.nextTick=Wt.applyMixin=Wt.ErrorWithReasonCode=void 0;var ta=class t extends Error{constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode";}};Wt.ErrorWithReasonCode=ta;function d1(t,e,r=!1){var i;let n=[e];for(;;){let o=n[0],s=Object.getPrototypeOf(o);if(s?.prototype)n.unshift(s);else break}for(let o of n)for(let s of Object.getOwnPropertyNames(o.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,(i=Object.getOwnPropertyDescriptor(o.prototype,s))!==null&&i!==void 0?i:Object.create(null));}Wt.applyMixin=d1;Wt.nextTick=typeof(P===null||P===void 0?void 0:P.nextTick)=="function"?P.nextTick:t=>{setTimeout(t,0);};});var Ai=M(br=>{v();m();_();Object.defineProperty(br,"__esModule",{value:!0});br.ReasonCodes=void 0;br.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var p1=(t,e)=>{let{messageId:r}=e,i=e.cmd,n=null,o=t.outgoing[r]?t.outgoing[r].cb:null,s;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(t.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${br.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e);})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:r};let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${br.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e);})):t._sendPacket(n);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let a=e.granted;for(let u=0;u<a.length;u++)if(a[u]&128){let c=t.messageIdToTopic[r];c&&c.forEach(h=>{delete t._resubscribeTopics[h];});}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(null,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),o(null);break}default:t.emit("error",new Error("unrecognized packet type"));}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty");};br.default=p1;});var Kd=M(ra=>{v();m();_();Object.defineProperty(ra,"__esModule",{value:!0});var zd=Jr(),g1=Ai(),y1=(t,e)=>{let{options:r}=t,i=r.protocolVersion,n=i===5?e.reasonCode:e.returnCode;if(i!==5){let o=new zd.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,n);t.emit("error",o);return}t.handleAuth(e,(o,s)=>{if(o){t.emit("error",o);return}if(n===24)t.reconnecting=!1,t._sendPacket(s);else {let a=new zd.ErrorWithReasonCode(`Connection refused: ${g1.ReasonCodes[n]}`,n);t.emit("error",a);}});};ra.default=y1;});var Xd=M(kn=>{v();m();_();Object.defineProperty(kn,"__esModule",{value:!0});kn.LRUCache=void 0;var Ii=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Qd=new Set,ia=typeof P=="object"&&P?P:{},Yd=(t,e,r,i)=>{typeof ia.emitWarning=="function"?ia.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`);},On=globalThis.AbortController,Gd=globalThis.AbortSignal;if(typeof On>"u"){Gd=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n);}},On=class{constructor(){e();}signal=new Gd;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i);}}};let t=ia.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Yd("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var b1=t=>!Qd.has(t),$t=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Jd=t=>$t(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Xr:null:null,Xr=class extends Array{constructor(e){super(e),this.fill(0);}},na=class t{heap;length;static#l=!1;static create(e){let r=Jd(e);if(!r)return [];t.#l=!0;let i=new t(e,r);return t.#l=!1,i}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},sa=class t{#l;#c;#p;#g;#B;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#y;#n;#r;#e;#u;#h;#a;#s;#b;#o;#E;#S;#w;#_;#I;#f;static unsafeExposeInternals(e){return {starts:e.#S,ttls:e.#w,sizes:e.#E,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#b,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,i,n,o)=>e.#k(r,i,n,o),moveToTail:r=>e.#C(r),indexes:r=>e.#m(r),rindexes:r=>e.#v(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#c}get calculatedSize(){return this.#y}get size(){return this.#i}get fetchMethod(){return this.#B}get dispose(){return this.#p}get disposeAfter(){return this.#g}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:g,maxSize:y=0,maxEntrySize:w=0,sizeCalculation:E,fetchMethod:S,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:U,ignoreFetchAbort:N}=e;if(r!==0&&!$t(r))throw new TypeError("max option must be a nonnegative integer");let W=r?Jd(r):Array;if(!W)throw new Error("invalid max value: "+r);if(this.#l=r,this.#c=y,this.maxEntrySize=w||this.#c,this.sizeCalculation=E,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=S,this.#I=!!S,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new W(r),this.#h=new W(r),this.#a=0,this.#s=0,this.#b=na.create(r),this.#i=0,this.#y=0,typeof c=="function"&&(this.#p=c),typeof h=="function"?(this.#g=h,this.#o=[]):(this.#g=void 0,this.#o=void 0),this.#_=!!this.#p,this.#f=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!U,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#c!==0&&!$t(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!$t(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q();}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=$t(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!$t(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x();}if(this.#l===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#c){let K="LRU_CACHE_UNBOUNDED";b1(K)&&(Qd.add(K),Yd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,t));}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#x(){let e=new Xr(this.#l),r=new Xr(this.#l);this.#w=e,this.#S=r,this.#M=(o,s,a=Ii.now())=>{if(r[o]=s!==0?a:0,e[o]=s,s!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#d(o)&&this.delete(this.#r[o]);},s+1);u.unref&&u.unref();}},this.#T=o=>{r[o]=e[o]!==0?Ii.now():0;},this.#A=(o,s)=>{if(e[s]){let a=e[s],u=r[s];o.ttl=a,o.start=u,o.now=i||n();let c=o.now-u;o.remainingTTL=a-c;}};let i=0,n=()=>{let o=Ii.now();if(this.ttlResolution>0){i=o;let s=setTimeout(()=>i=0,this.ttlResolution);s.unref&&s.unref();}return o};this.getRemainingTTL=o=>{let s=this.#n.get(o);if(s===void 0)return 0;let a=e[s],u=r[s];if(a===0||u===0)return 1/0;let c=(i||n())-u;return a-c},this.#d=o=>e[o]!==0&&r[o]!==0&&(i||n())-r[o]>e[o];}#T=()=>{};#A=()=>{};#M=()=>{};#d=()=>!1;#q(){let e=new Xr(this.#l);this.#y=0,this.#E=e,this.#R=r=>{this.#y-=e[r],e[r]=0;},this.#L=(r,i,n,o)=>{if(this.#t(i))return 0;if(!$t(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(i,r),!$t(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#P=(r,i,n)=>{if(e[r]=i,this.#c){let o=this.#c-e[r];for(;this.#y>o;)this.#O(!0);}this.#y+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#y);};}#R=e=>{};#P=(e,r,i)=>{};#L=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#m({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#s;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r];}*#v({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r];}#U(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#m())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#m()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#m())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;if(o!==void 0&&e(o,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(e,r=this){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this);}}rforEach(e,r=this){for(let i of this.#v()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this);}}purgeStale(){let e=!1;for(let r of this.#v({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#m({allowStale:!0})){let i=this.#r[r],n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0||i===void 0)continue;let s={value:o};if(this.#w&&this.#S){s.ttl=this.#w[r];let a=Ii.now()-this.#S[r];s.start=Math.floor(Date.now()-a);}this.#E&&(s.size=this.#E[r]),e.unshift([i,s]);}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=Ii.now()-n;}this.set(r,i.value,i);}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:c=this.noUpdateTTL}=i,h=this.#L(e,r,i.size||0,a);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let d=this.#i===0?void 0:this.#n.get(e);if(d===void 0)d=this.#i===0?this.#s:this.#b.length!==0?this.#b.pop():this.#i===this.#l?this.#O(!1):this.#i,this.#r[d]=e,this.#e[d]=r,this.#n.set(e,d),this.#u[this.#s]=d,this.#h[d]=this.#s,this.#s=d,this.#i++,this.#P(d,h,u),u&&(u.set="add"),c=!1;else {this.#C(d);let g=this.#e[d];if(r!==g){if(this.#I&&this.#t(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=g;y!==void 0&&!s&&(this.#_&&this.#p?.(y,e,"set"),this.#f&&this.#o?.push([y,e,"set"]));}else s||(this.#_&&this.#p?.(g,e,"set"),this.#f&&this.#o?.push([g,e,"set"]));if(this.#R(d),this.#P(d,h,u),this.#e[d]=r,u){u.set="replace";let y=g&&this.#t(g)?g.__staleWhileFetching:g;y!==void 0&&(u.oldValue=y);}}else u&&(u.set="update");}if(n!==0&&!this.#w&&this.#x(),this.#w&&(c||this.#M(d,n,o),u&&this.#A(u,d)),!s&&this.#f&&this.#o){let g=this.#o,y;for(;y=g?.shift();)this.#g?.(...y);}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r);}}}#O(e){let r=this.#a,i=this.#r[r],n=this.#e[r];return this.#I&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,i,"evict"),this.#f&&this.#o?.push([n,i,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#b.push(r)),this.#i===1?(this.#a=this.#s=0,this.#b.length=0):this.#a=this.#u[r],this.#n.delete(i),this.#i--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,o=this.#n.get(e);if(o!==void 0){let s=this.#e[o];if(this.#t(s)&&s.__staleWhileFetching===void 0)return !1;if(this.#d(o))n&&(n.has="stale",this.#A(n,o));else return i&&this.#T(o),n&&(n.has="hit",this.#A(n,o)),!0}else n&&(n.has="miss");return !1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(e);if(n!==void 0&&(i||!this.#d(n))){let o=this.#e[n];return this.#t(o)?o.__staleWhileFetching:o}}#k(e,r,i,n){let o=r===void 0?void 0:this.#e[r];if(this.#t(o))return o;let s=new On,{signal:a}=i;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let u={signal:s.signal,options:i,context:n},c=(E,S=!1)=>{let{aborted:I}=s.signal,C=i.ignoreFetchAbort&&E!==void 0;if(i.status&&(I&&!S?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,C&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),I&&!C&&!S)return d(s.signal.reason);let R=y;return this.#e[r]===y&&(E===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,E,u.options))),E},h=E=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=E),d(E)),d=E=>{let{aborted:S}=s.signal,I=S&&i.allowStaleOnFetchAbort,C=I||i.allowStaleOnFetchRejection,R=C||i.noDeleteOnFetchRejection,U=y;if(this.#e[r]===y&&(!R||U.__staleWhileFetching===void 0?this.delete(e):I||(this.#e[r]=U.__staleWhileFetching)),C)return i.status&&U.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),U.__staleWhileFetching;if(U.__returned===U)throw E},g=(E,S)=>{let I=this.#B?.(e,o,u);I&&I instanceof Promise&&I.then(C=>E(C===void 0?void 0:C),S),s.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(E(void 0),i.allowStaleOnFetchAbort&&(E=C=>c(C,!0)));});};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(g).then(c,h),w=Object.assign(y,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,w,{...u.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=w,w}#t(e){if(!this.#I)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof On}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:E,forceRefresh:S=!1,status:I,signal:C}=r;if(!this.#I)return I&&(I.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:I});let R={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:y,status:I,signal:C},U=this.#n.get(e);if(U===void 0){I&&(I.fetch="miss");let N=this.#k(e,U,R,E);return N.__returned=N}else {let N=this.#e[U];if(this.#t(N)){let de=i&&N.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",de&&(I.returnedStale=!0)),de?N.__staleWhileFetching:N.__returned=N}let W=this.#d(U);if(!S&&!W)return I&&(I.fetch="hit"),this.#C(U),n&&this.#T(U),I&&this.#A(I,U),N;let K=this.#k(e,U,R,E),Q=K.__staleWhileFetching!==void 0&&i;return I&&(I.fetch=W?"stale":"refresh",Q&&W&&(I.returnedStale=!0)),Q?K.__staleWhileFetching:K.__returned=K}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=r,a=this.#n.get(e);if(a!==void 0){let u=this.#e[a],c=this.#t(u);return s&&this.#A(s,a),this.#d(a)?(s&&(s.get="stale"),c?(s&&i&&u.__staleWhileFetching!==void 0&&(s.returnedStale=!0),i?u.__staleWhileFetching:void 0):(o||this.delete(e),s&&i&&(s.returnedStale=!0),i?u:void 0)):(s&&(s.get="hit"),c?u.__staleWhileFetching:(this.#C(a),n&&this.#T(a),u))}else s&&(s.get="miss");}#N(e,r){this.#h[r]=e,this.#u[e]=r;}#C(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#N(this.#h[e],this.#u[e]),this.#N(this.#s,e),this.#s=e);}delete(e){let r=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.clear();else {this.#R(i);let n=this.#e[i];this.#t(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,e,"delete"),this.#f&&this.#o?.push([n,e,"delete"])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s?this.#s=this.#h[i]:i===this.#a?this.#a=this.#u[i]:(this.#u[this.#h[i]]=this.#u[i],this.#h[this.#u[i]]=this.#h[i]),this.#i--,this.#b.push(i);}}if(this.#f&&this.#o?.length){let i=this.#o,n;for(;n=i?.shift();)this.#g?.(...n);}return r}clear(){for(let e of this.#v({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let i=this.#r[e];this.#_&&this.#p?.(r,i,"delete"),this.#f&&this.#o?.push([r,i,"delete"]);}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#w&&this.#S&&(this.#w.fill(0),this.#S.fill(0)),this.#E&&this.#E.fill(0),this.#a=0,this.#s=0,this.#b.length=0,this.#y=0,this.#i=0,this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r);}}};kn.LRUCache=sa;});var at=M(Ht=>{v();m();_();Object.defineProperty(Ht,"t",{value:!0});Ht.ContainerIterator=Ht.Container=Ht.Base=void 0;var oa=class{constructor(e=0){this.iteratorType=e;}equals(e){return this.o===e.o}};Ht.ContainerIterator=oa;var xn=class{constructor(){this.i=0;}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};Ht.Base=xn;var aa=class extends xn{};Ht.Container=aa;});var Zd=M(Mn=>{v();m();_();Object.defineProperty(Mn,"t",{value:!0});Mn.default=void 0;var w1=at(),la=class extends w1.Base{constructor(e=[]){super(),this.S=[];let r=this;e.forEach(function(i){r.push(i);});}clear(){this.i=0,this.S=[];}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},_1=la;Mn.default=_1;});var ep=M(Ln=>{v();m();_();Object.defineProperty(Ln,"t",{value:!0});Ln.default=void 0;var m1=at(),ua=class extends m1.Base{constructor(e=[]){super(),this.j=0,this.q=[];let r=this;e.forEach(function(i){r.push(i);});}clear(){this.q=[],this.i=this.j=0;}push(e){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let i=this.i;for(let n=0;n<i;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=e;}else this.q[this.j+this.i]=e;return ++this.i}pop(){if(this.i===0)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(this.i!==0)return this.q[this.j]}},v1=ua;Ln.default=v1;});var tp=M(Un=>{v();m();_();Object.defineProperty(Un,"t",{value:!0});Un.default=void 0;var E1=at(),fa=class extends E1.Base{constructor(e=[],r=function(n,o){return n>o?-1:n<o?1:0},i=!0){if(super(),this.v=r,Array.isArray(e))this.C=i?[...e]:e;else {this.C=[];let o=this;e.forEach(function(s){o.C.push(s);});}this.i=this.C.length;let n=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,n);}m(e){let r=this.C[e];for(;e>0;){let i=e-1>>1,n=this.C[i];if(this.v(n,r)<=0)break;this.C[e]=n,e=i;}this.C[e]=r;}k(e,r){let i=this.C[e];for(;e<r;){let n=e<<1|1,o=n+1,s=this.C[n];if(o<this.i&&this.v(s,this.C[o])>0&&(n=o,s=this.C[o]),this.v(s,i)>=0)break;this.C[e]=s,e=n;}this.C[e]=i;}clear(){this.i=0,this.C.length=0;}push(e){this.C.push(e),this.m(this.i),this.i+=1;}pop(){if(this.i===0)return;let e=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let r=this.C.indexOf(e);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(e){let r=this.C.indexOf(e);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return [...this.C]}},S1=fa;Un.default=S1;});var qn=M(Nn=>{v();m();_();Object.defineProperty(Nn,"t",{value:!0});Nn.default=void 0;var A1=at(),ca=class extends A1.Container{},I1=ca;Nn.default=I1;});var lt=M(ha=>{v();m();_();Object.defineProperty(ha,"t",{value:!0});ha.throwIteratorAccessError=T1;function T1(){throw new RangeError("Iterator access denied!")}});var pa=M(jn=>{v();m();_();Object.defineProperty(jn,"t",{value:!0});jn.RandomIterator=void 0;var R1=at(),Dn=lt(),da=class extends R1.ContainerIterator{constructor(e,r){super(r),this.o=e,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0, Dn.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0, Dn.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0, Dn.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0, Dn.throwIteratorAccessError)(),this.o-=1,this});}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e);}};jn.RandomIterator=da;});var rp=M(Fn=>{v();m();_();Object.defineProperty(Fn,"t",{value:!0});Fn.default=void 0;var C1=P1(qn()),B1=pa();function P1(t){return t&&t.t?t:{default:t}}var wr=class t extends B1.RandomIterator{constructor(e,r,i){super(e,i),this.container=r;}copy(){return new t(this.o,this.container,this.iteratorType)}},ga=class extends C1.default{constructor(e=[],r=!0){if(super(),Array.isArray(e))this.J=r?[...e]:e,this.i=e.length;else {this.J=[];let i=this;e.forEach(function(n){i.pushBack(n);});}}clear(){this.i=0,this.J.length=0;}begin(){return new wr(0,this)}end(){return new wr(this.i,this)}rBegin(){return new wr(this.i-1,this,1)}rEnd(){return new wr(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let r=0;for(let i=0;i<this.i;++i)this.J[i]!==e&&(this.J[r++]=this.J[i]);return this.i=this.J.length=r,this.i}eraseElementByIterator(e){let r=e.o;return e=e.next(),this.eraseElementByPos(r),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=r;}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(i).fill(r)),this.i+=i,this.i}find(e){for(let r=0;r<this.i;++r)if(this.J[r]===e)return new wr(r,this);return this.end()}reverse(){this.J.reverse();}unique(){let e=1;for(let r=1;r<this.i;++r)this.J[r]!==this.J[r-1]&&(this.J[e++]=this.J[r]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e);}forEach(e){for(let r=0;r<this.i;++r)e(this.J[r],r,this);}[Symbol.iterator](){return function*(){yield*this.J;}.bind(this)()}},O1=ga;Fn.default=O1;});var ip=M(Wn=>{v();m();_();Object.defineProperty(Wn,"t",{value:!0});Wn.default=void 0;var k1=M1(qn()),x1=at(),_r=lt();function M1(t){return t&&t.t?t:{default:t}}var mr=class t extends x1.ContainerIterator{constructor(e,r,i,n){super(n),this.o=e,this.h=r,this.container=i,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0, _r.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0, _r.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0, _r.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0, _r.throwIteratorAccessError)(),this.o=this.o.L,this});}get pointer(){return this.o===this.h&&(0, _r.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0, _r.throwIteratorAccessError)(),this.o.l=e;}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},ya=class extends k1.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let r=this;e.forEach(function(i){r.pushBack(i);});}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1;}G(e,r){let i=r.B,n={l:e,L:r,B:i};r.B=n,i.L=n,r===this.h&&(this.p=n),i===this.h&&(this._=n),this.i+=1;}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h;}begin(){return new mr(this.p,this.h,this)}end(){return new mr(this.h,this.h,this)}rBegin(){return new mr(this._,this.h,this,1)}rEnd(){return new mr(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}eraseElementByValue(e){let r=this.p;for(;r!==this.h;)r.l===e&&this.V(r),r=r.B;return this.i}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0, _r.throwIteratorAccessError)(),e=e.next(),this.V(r),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;i.l=r;}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(i<=0)return this.i;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else {let n=this.p;for(let s=1;s<e;++s)n=n.B;let o=n.B;for(this.i+=i;i--;)n.B={l:r,L:n},n.B.L=n,n=n.B;n.B=o,o.L=n;}return this.i}find(e){let r=this.p;for(;r!==this.h;){if(r.l===e)return new mr(r,this.h,this);r=r.B;}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,r=this._,i=0;for(;i<<1<this.i;){let n=e.l;e.l=r.l,r.l=n,e=e.B,r=r.L,i+=1;}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let r=e;for(;r.B!==this.h&&r.l===r.B.l;)r=r.B,this.i-=1;e.B=r.B,e.B.L=e,e=e.B;}return this.i}sort(e){if(this.i<=1)return;let r=[];this.forEach(function(n){r.push(n);}),r.sort(e);let i=this.p;r.forEach(function(n){i.l=n,i=i.B;});}merge(e){let r=this;if(this.i===0)e.forEach(function(i){r.pushBack(i);});else {let i=this.p;e.forEach(function(n){for(;i!==r.h&&i.l<=n;)i=i.B;r.G(n,i.L);});}return this.i}forEach(e){let r=this.p,i=0;for(;r!==this.h;)e(r.l,i++,this),r=r.B;}[Symbol.iterator](){return function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B;}.bind(this)()}},L1=ya;Wn.default=L1;});var np=M($n=>{v();m();_();Object.defineProperty($n,"t",{value:!0});$n.default=void 0;var U1=q1(qn()),N1=pa();function q1(t){return t&&t.t?t:{default:t}}var vr=class t extends N1.RandomIterator{constructor(e,r,i){super(e,i),this.container=r;}copy(){return new t(this.o,this.container,this.iteratorType)}},ba=class extends U1.default{constructor(e=[],r=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=r,this.P=Math.max(Math.ceil(i/this.F),1);for(let s=0;s<this.P;++s)this.A.push(new Array(this.F));let n=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-i%this.F>>1;let o=this;e.forEach(function(s){o.pushBack(s);});}T(){let e=[],r=Math.max(this.P>>1,1);for(let i=0;i<r;++i)e[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)e[e.length]=this.A[i];for(let i=0;i<this.R;++i)e[e.length]=this.A[i];e[e.length]=[...this.A[this.R]],this.j=r,this.R=e.length-1;for(let i=0;i<r;++i)e[e.length]=new Array(this.F);this.A=e,this.P=e.length;}O(e){let r=this.D+e+1,i=r%this.F,n=i-1,o=this.j+(r-i)/this.F;return i===0&&(o-=1),o%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:o,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1;}begin(){return new vr(0,this)}end(){return new vr(this.i,this)}rBegin(){return new vr(this.i-1,this,1)}rEnd(){return new vr(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(this.i===0)return;let e=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.A[r][i]}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:n}=this.O(e);this.A[i][n]=r;}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else {let n=[];for(let o=e;o<this.i;++o)n.push(this.getElementByPos(o));this.cut(e-1);for(let o=0;o<i;++o)this.pushBack(r);for(let o=0;o<n.length;++o)this.pushBack(n[o]);}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.R=r,this.N=i,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else {let r=[];for(let n=e+1;n<this.i;++n)r.push(this.getElementByPos(n));this.cut(e),this.popBack();let i=this;r.forEach(function(n){i.pushBack(n);});}return this.i}eraseElementByValue(e){if(this.i===0)return 0;let r=[];for(let n=0;n<this.i;++n){let o=this.getElementByPos(n);o!==e&&r.push(o);}let i=r.length;for(let n=0;n<i;++n)this.setElementByPos(n,r[n]);return this.cut(i-1)}eraseElementByIterator(e){let r=e.o;return this.eraseElementByPos(r),e=e.next(),e}find(e){for(let r=0;r<this.i;++r)if(this.getElementByPos(r)===e)return new vr(r,this);return this.end()}reverse(){let e=0,r=this.i-1;for(;e<r;){let i=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(r)),this.setElementByPos(r,i),e+=1,r-=1;}}unique(){if(this.i<=1)return this.i;let e=1,r=this.getElementByPos(0);for(let i=1;i<this.i;++i){let n=this.getElementByPos(i);n!==r&&(r=n,this.setElementByPos(e++,n));}for(;this.i>e;)this.popBack();return this.i}sort(e){let r=[];for(let i=0;i<this.i;++i)r.push(this.getElementByPos(i));r.sort(e);for(let i=0;i<this.i;++i)this.setElementByPos(i,r[i]);}shrinkToFit(){if(this.i===0)return;let e=[];this.forEach(function(r){e.push(r);}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let r=0;r<this.P;++r)this.A.push(new Array(this.F));for(let r=0;r<e.length;++r)this.pushBack(e[r]);}forEach(e){for(let r=0;r<this.i;++r)e(this.getElementByPos(r),r,this);}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e);}.bind(this)()}},D1=ba;$n.default=D1;});var sp=M(Zr=>{v();m();_();Object.defineProperty(Zr,"t",{value:!0});Zr.TreeNodeEnableIndex=Zr.TreeNode=void 0;var Hn=class{constructor(e,r){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=r;}L(){let e=this;if(e.ee===1&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else {let r=e.tt;for(;r.U===e;)e=r,r=e.tt;e=r;}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}else {let r=e.tt;for(;r.W===e;)e=r,r=e.tt;return e.W!==r?r:e}}te(){let e=this.tt,r=this.W,i=r.U;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.U=this,this.tt=r,this.W=i,i&&(i.tt=this),r}se(){let e=this.tt,r=this.U,i=r.W;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.W=this,this.tt=r,this.U=i,i&&(i.tt=this),r}};Zr.TreeNode=Hn;var wa=class extends Hn{constructor(){super(...arguments),this.rt=1;}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt);}};Zr.TreeNodeEnableIndex=wa;});var ma=M(Vn=>{v();m();_();Object.defineProperty(Vn,"t",{value:!0});Vn.default=void 0;var op=sp(),j1=at(),ap=lt(),_a=class extends j1.Container{constructor(e=function(i,n){return i<n?-1:i>n?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=op.TreeNodeEnableIndex,this.M=function(i,n,o){let s=this.ne(i,n,o);if(s){let a=s.tt;for(;a!==this.h;)a.rt+=1,a=a.tt;let u=this.he(s);if(u){let{parentNode:c,grandParent:h,curNode:d}=u;c.ie(),h.ie(),d.ie();}}return this.i},this.V=function(i){let n=this.fe(i);for(;n!==this.h;)n.rt-=1,n=n.tt;}):(this.re=op.TreeNode,this.M=function(i,n,o){let s=this.ne(i,n,o);return s&&this.he(s),this.i},this.V=this.fe),this.h=new this.re;}X(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)e=e.W;else if(n>0)i=e,e=e.U;else return e}return i}Z(e,r){let i=this.h;for(;e;)this.v(e.u,r)<=0?e=e.W:(i=e,e=e.U);return i}$(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)i=e,e=e.W;else if(n>0)e=e.U;else return e}return i}rr(e,r){let i=this.h;for(;e;)this.v(e.u,r)<0?(i=e,e=e.W):e=e.U;return i}ue(e){for(;;){let r=e.tt;if(r===this.h)return;if(e.ee===1){e.ee=0;return}if(e===r.U){let i=r.W;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.te():r.te();else if(i.W&&i.W.ee===1){i.ee=r.ee,r.ee=0,i.W.ee=0,r===this.Y?this.Y=r.te():r.te();return}else i.U&&i.U.ee===1?(i.ee=1,i.U.ee=0,i.se()):(i.ee=1,e=r);}else {let i=r.U;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.se():r.se();else if(i.U&&i.U.ee===1){i.ee=r.ee,r.ee=0,i.U.ee=0,r===this.Y?this.Y=r.se():r.se();return}else i.W&&i.W.ee===1?(i.ee=1,i.W.ee=0,i.te()):(i.ee=1,e=r);}}}fe(e){if(this.i===1)return this.clear(),this.h;let r=e;for(;r.U||r.W;){if(r.W)for(r=r.W;r.U;)r=r.U;else r=r.U;[e.u,r.u]=[r.u,e.u],[e.l,r.l]=[r.l,e.l],e=r;}this.h.U===r?this.h.U=r.tt:this.h.W===r&&(this.h.W=r.tt),this.ue(r);let i=r.tt;return r===i.U?i.U=void 0:i.W=void 0,this.i-=1,this.Y.ee=0,i}oe(e,r){return e===void 0?!1:this.oe(e.U,r)||r(e)?!0:this.oe(e.W,r)}he(e){for(;;){let r=e.tt;if(r.ee===0)return;let i=r.tt;if(r===i.U){let n=i.W;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.W){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=i),r.W=e.U,i.U=e.W,e.U=r,e.W=i,i===this.Y)this.Y=e,this.h.tt=e;else {let o=i.tt;o.U===i?o.U=e:o.W=e;}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.se():i.se(),i.ee=1;}else {let n=i.U;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.U){if(e.ee=0,e.U&&(e.U.tt=i),e.W&&(e.W.tt=r),i.W=e.U,r.U=e.W,e.U=i,e.W=r,i===this.Y)this.Y=e,this.h.tt=e;else {let o=i.tt;o.U===i?o.U=e:o.W=e;}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.te():i.te(),i.ee=1;}return}}ne(e,r,i){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,r),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let n,o=this.h.U,s=this.v(o.u,e);if(s===0){o.l=r;return}else if(s>0)o.U=new this.re(e,r),o.U.tt=o,n=o.U,this.h.U=n;else {let a=this.h.W,u=this.v(a.u,e);if(u===0){a.l=r;return}else if(u<0)a.W=new this.re(e,r),a.W.tt=a,n=a.W,this.h.W=n;else {if(i!==void 0){let c=i.o;if(c!==this.h){let h=this.v(c.u,e);if(h===0){c.l=r;return}else if(h>0){let d=c.L(),g=this.v(d.u,e);if(g===0){d.l=r;return}else g<0&&(n=new this.re(e,r),d.W===void 0?(d.W=n,n.tt=d):(c.U=n,n.tt=c));}}}if(n===void 0)for(n=this.Y;;){let c=this.v(n.u,e);if(c>0){if(n.U===void 0){n.U=new this.re(e,r),n.U.tt=n,n=n.U;break}n=n.U;}else if(c<0){if(n.W===void 0){n.W=new this.re(e,r),n.W.tt=n,n=n.W;break}n=n.W;}else {n.l=r;return}}}}return this.i+=1,n}I(e,r){for(;e;){let i=this.v(e.u,r);if(i<0)e=e.W;else if(i>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0;}updateKeyByIterator(e,r){let i=e.o;if(i===this.h&&(0, ap.throwIteratorAccessError)(),this.i===1)return i.u=r,!0;if(i===this.h.U)return this.v(i.B().u,r)>0?(i.u=r,!0):!1;if(i===this.h.W)return this.v(i.L().u,r)<0?(i.u=r,!0):!1;let n=i.L().u;if(this.v(n,r)>=0)return !1;let o=i.B().u;return this.v(o,r)<=0?!1:(i.u=r,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=0,i=this;return this.oe(this.Y,function(n){return e===r?(i.V(n),!0):(r+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return !1;let r=this.I(this.Y,e);return r===this.h?!1:(this.V(r),!0)}eraseElementByIterator(e){let r=e.o;r===this.h&&(0, ap.throwIteratorAccessError)();let i=r.W===void 0;return e.iteratorType===0?i&&e.next():(!i||r.U===void 0)&&e.next(),this.V(r),e}forEach(e){let r=0;for(let i of this)e(i,r++,this);}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r,i=0;for(let n of this){if(i===e){r=n;break}i+=1;}return r}getHeight(){if(this.i===0)return 0;let e=function(r){return r?Math.max(e(r.U),e(r.W))+1:0};return e(this.Y)}},F1=_a;Vn.default=F1;});var Ea=M(Kn=>{v();m();_();Object.defineProperty(Kn,"t",{value:!0});Kn.default=void 0;var W1=at(),zn=lt(),va=class extends W1.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0, zn.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0, zn.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0, zn.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0, zn.throwIteratorAccessError)(),this.o=this.o.L(),this});}get index(){let e=this.o,r=this.h.tt;if(e===this.h)return r?r.rt-1:0;let i=0;for(e.U&&(i+=e.U.rt);e!==r;){let n=e.tt;e===n.W&&(i+=1,n.U&&(i+=n.U.rt)),e=n;}return i}},$1=va;Kn.default=$1;});var up=M(Gn=>{v();m();_();Object.defineProperty(Gn,"t",{value:!0});Gn.default=void 0;var H1=lp(ma()),V1=lp(Ea()),z1=lt();function lp(t){return t&&t.t?t:{default:t}}var Ke=class t extends V1.default{constructor(e,r,i,n){super(e,r,n),this.container=i;}get pointer(){return this.o===this.h&&(0, z1.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Sa=class extends H1.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.insert(o);});}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W));}begin(){return new Ke(this.h.U||this.h,this.h,this)}end(){return new Ke(this.h,this.h,this)}rBegin(){return new Ke(this.h.W||this.h,this.h,this,1)}rEnd(){return new Ke(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,r){return this.M(e,void 0,r)}find(e){let r=this.I(this.Y,e);return new Ke(r,this.h,this)}lowerBound(e){let r=this.X(this.Y,e);return new Ke(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new Ke(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new Ke(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new Ke(r,this.h,this)}union(e){let r=this;return e.forEach(function(i){r.insert(i);}),this.i}[Symbol.iterator](){return this.K(this.Y)}},K1=Sa;Gn.default=K1;});var cp=M(Qn=>{v();m();_();Object.defineProperty(Qn,"t",{value:!0});Qn.default=void 0;var G1=fp(ma()),Q1=fp(Ea()),Y1=lt();function fp(t){return t&&t.t?t:{default:t}}var Ge=class t extends Q1.default{constructor(e,r,i,n){super(e,r,n),this.container=i;}get pointer(){this.o===this.h&&(0, Y1.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Aa=class extends G1.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.setElement(o[0],o[1]);});}*K(e){e!==void 0&&(yield*this.K(e.U),yield [e.u,e.l],yield*this.K(e.W));}begin(){return new Ge(this.h.U||this.h,this.h,this)}end(){return new Ge(this.h,this.h,this)}rBegin(){return new Ge(this.h.W||this.h,this.h,this,1)}rEnd(){return new Ge(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return [e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return [e.u,e.l]}lowerBound(e){let r=this.X(this.Y,e);return new Ge(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new Ge(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new Ge(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new Ge(r,this.h,this)}setElement(e,r,i){return this.M(e,r,i)}find(e){let r=this.I(this.Y,e);return new Ge(r,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let r=this;return e.forEach(function(i){r.setElement(i[0],i[1]);}),this.i}[Symbol.iterator](){return this.K(this.Y)}},J1=Aa;Qn.default=J1;});var Ta=M(Ia=>{v();m();_();Object.defineProperty(Ia,"t",{value:!0});Ia.default=X1;function X1(t){let e=typeof t;return e==="object"&&t!==null||e==="function"}});var Pa=M(ei=>{v();m();_();Object.defineProperty(ei,"t",{value:!0});ei.HashContainerIterator=ei.HashContainer=void 0;var hp=at(),Ra=Z1(Ta()),Ti=lt();function Z1(t){return t&&t.t?t:{default:t}}var Ca=class extends hp.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0, Ti.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0, Ti.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0, Ti.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0, Ti.throwIteratorAccessError)(),this.o=this.o.L,this});}};ei.HashContainerIterator=Ca;var Ba=class extends hp.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h;}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1;}M(e,r,i){i===void 0&&(i=(0, Ra.default)(e));let n;if(i){let o=e[this.HASH_TAG];if(o!==void 0)return this.H[o].l=r,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),n={u:e,l:r,L:this._,B:this.h},this.H.push(n);}else {let o=this.g[e];if(o)return o.l=r,this.i;n={u:e,l:r,L:this._,B:this.h},this.g[e]=n;}return this.i===0?(this.p=n,this.h.B=n):this._.B=n,this._=n,this.h.L=n,++this.i}I(e,r){if(r===void 0&&(r=(0, Ra.default)(e)),r){let i=e[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(r){delete r.u[e];}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h;}eraseElementByKey(e,r){let i;if(r===void 0&&(r=(0, Ra.default)(e)),r){let n=e[this.HASH_TAG];if(n===void 0)return !1;delete e[this.HASH_TAG],i=this.H[n],delete this.H[n];}else {if(i=this.g[e],i===void 0)return !1;delete this.g[e];}return this.V(i),!0}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0, Ti.throwIteratorAccessError)(),this.V(r),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}};ei.HashContainer=Ba;});var pp=M(Yn=>{v();m();_();Object.defineProperty(Yn,"t",{value:!0});Yn.default=void 0;var dp=Pa(),ev=lt(),Er=class t extends dp.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i;}get pointer(){return this.o===this.h&&(0, ev.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Oa=class extends dp.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.insert(i);});}begin(){return new Er(this.p,this.h,this)}end(){return new Er(this.h,this.h,this)}rBegin(){return new Er(this._,this.h,this,1)}rEnd(){return new Er(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,r){return this.M(e,void 0,r)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.u}find(e,r){let i=this.I(e,r);return new Er(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e(i.u,r++,this),i=i.B;}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B;}.bind(this)()}},tv=Oa;Yn.default=tv;});var yp=M(Jn=>{v();m();_();Object.defineProperty(Jn,"t",{value:!0});Jn.default=void 0;var gp=Pa(),rv=nv(Ta()),iv=lt();function nv(t){return t&&t.t?t:{default:t}}var Sr=class t extends gp.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i;}get pointer(){this.o===this.h&&(0, iv.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},ka=class extends gp.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.setElement(i[0],i[1]);});}begin(){return new Sr(this.p,this.h,this)}end(){return new Sr(this.h,this.h,this)}rBegin(){return new Sr(this._,this.h,this,1)}rEnd(){return new Sr(this.h,this.h,this,1)}front(){if(this.i!==0)return [this.p.u,this.p.l]}back(){if(this.i!==0)return [this._.u,this._.l]}setElement(e,r,i){return this.M(e,r,i)}getElementByKey(e,r){if(r===void 0&&(r=(0, rv.default)(e)),r){let n=e[this.HASH_TAG];return n!==void 0?this.H[n].l:void 0}let i=this.g[e];return i?i.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return [r.u,r.l]}find(e,r){let i=this.I(e,r);return new Sr(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e([i.u,i.l],r++,this),i=i.B;}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield [e.u,e.l],e=e.B;}.bind(this)()}},sv=ka;Jn.default=sv;});var bp=M(je=>{v();m();_();Object.defineProperty(je,"t",{value:!0});Object.defineProperty(je,"Deque",{enumerable:!0,get:function(){return cv.default}});Object.defineProperty(je,"HashMap",{enumerable:!0,get:function(){return gv.default}});Object.defineProperty(je,"HashSet",{enumerable:!0,get:function(){return pv.default}});Object.defineProperty(je,"LinkList",{enumerable:!0,get:function(){return fv.default}});Object.defineProperty(je,"OrderedMap",{enumerable:!0,get:function(){return dv.default}});Object.defineProperty(je,"OrderedSet",{enumerable:!0,get:function(){return hv.default}});Object.defineProperty(je,"PriorityQueue",{enumerable:!0,get:function(){return lv.default}});Object.defineProperty(je,"Queue",{enumerable:!0,get:function(){return av.default}});Object.defineProperty(je,"Stack",{enumerable:!0,get:function(){return ov.default}});Object.defineProperty(je,"Vector",{enumerable:!0,get:function(){return uv.default}});var ov=ut(Zd()),av=ut(ep()),lv=ut(tp()),uv=ut(rp()),fv=ut(ip()),cv=ut(np()),hv=ut(up()),dv=ut(cp()),pv=ut(pp()),gv=ut(yp());function ut(t){return t&&t.t?t:{default:t}}});var _p=M((mN,wp)=>{v();m();_();var yv=bp().OrderedSet,ft=ot()("number-allocator:trace"),bv=ot()("number-allocator:error");function Te(t,e){this.low=t,this.high=e;}Te.prototype.equals=function(t){return this.low===t.low&&this.high===t.high};Te.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0};function ct(t,e){if(!(this instanceof ct))return new ct(t,e);this.min=t,this.max=e,this.ss=new yv([],(r,i)=>r.compare(i)),ft("Create"),this.clear();}ct.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low};ct.prototype.alloc=function(){if(this.ss.size()===0)return ft("alloc():empty"),null;let t=this.ss.begin(),e=t.pointer.low,r=t.pointer.high,i=e;return i+1<=r?this.ss.updateKeyByIterator(t,new Te(e+1,r)):this.ss.eraseElementByPos(0),ft("alloc():"+i),i};ct.prototype.use=function(t){let e=new Te(t,t),r=this.ss.lowerBound(e);if(!r.equals(this.ss.end())){let i=r.pointer.low,n=r.pointer.high;return r.pointer.equals(e)?(this.ss.eraseElementByIterator(r),ft("use():"+t),!0):i>t?!1:i===t?(this.ss.updateKeyByIterator(r,new Te(i+1,n)),ft("use():"+t),!0):n===t?(this.ss.updateKeyByIterator(r,new Te(i,n-1)),ft("use():"+t),!0):(this.ss.updateKeyByIterator(r,new Te(t+1,n)),this.ss.insert(new Te(i,t-1)),ft("use():"+t),!0)}return ft("use():failed"),!1};ct.prototype.free=function(t){if(t<this.min||t>this.max){bv("free():"+t+" is out of range");return}let e=new Te(t,t),r=this.ss.upperBound(e);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(e);return}r.pre();let i=r.pointer.high;r.pointer.high+1===t?this.ss.updateKeyByIterator(r,new Te(i,t)):this.ss.insert(e);}else if(r.equals(this.ss.begin()))if(t+1===r.pointer.low){let i=r.pointer.high;this.ss.updateKeyByIterator(r,new Te(t,i));}else this.ss.insert(e);else {let i=r.pointer.low,n=r.pointer.high;r.pre();let o=r.pointer.low;r.pointer.high+1===t?t+1===i?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new Te(o,n))):this.ss.updateKeyByIterator(r,new Te(o,t)):t+1===i?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new Te(t,n))):this.ss.insert(e);}ft("free():"+t);};ct.prototype.clear=function(){ft("clear()"),this.ss.clear(),this.ss.insert(new Te(this.min,this.max));};ct.prototype.intervalCount=function(){return this.ss.size()};ct.prototype.dump=function(){console.log("length:"+this.ss.size());for(let t of this.ss)console.log(t);};wp.exports=ct;});var xa=M((PN,mp)=>{v();m();_();var wv=_p();mp.exports.NumberAllocator=wv;});var vp=M(La=>{v();m();_();Object.defineProperty(La,"__esModule",{value:!0});var _v=Xd(),mv=xa(),Ma=class{constructor(e){e>0&&(this.aliasToTopic=new _v.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new mv.NumberAllocator(1,e),this.max=e,this.length=0);}put(e,r){if(r===0||r>this.max)return !1;let i=this.aliasToTopic.get(r);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(r,e),this.topicToAlias[e]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let r=this.topicToAlias[e];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0;}getLruAlias(){let e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};La.default=Ma;});var Ep=M(Ri=>{v();m();_();var vv=Ri&&Ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ri,"__esModule",{value:!0});var Ev=Ai(),Sv=vv(vp()),Av=Jr(),Iv=(t,e)=>{t.log("_handleConnack");let{options:r}=t,n=r.protocolVersion===5?e.reasonCode:e.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new Sv.default(e.properties.topicAliasMaximum));}e.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=e.properties.serverKeepAlive,t._shiftPingInterval()),e.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=e.properties.maximumPacketSize);}if(n===0)t.reconnecting=!1,t._onConnect(e);else if(n>0){let o=new Av.ErrorWithReasonCode(`Connection refused: ${Ev.ReasonCodes[n]}`,n);t.emit("error",o);}};Ri.default=Iv;});var Sp=M(Ua=>{v();m();_();Object.defineProperty(Ua,"__esModule",{value:!0});var Tv=(t,e,r)=>{t.log("handling pubrel packet");let i=typeof r<"u"?r:t.noop,{messageId:n}=e,o={cmd:"pubcomp",messageId:n};t.incomingStore.get(e,(s,a)=>{s?t._sendPacket(o,i):(t.emit("message",a.topic,a.payload,a),t.handleMessage(a,u=>{if(u)return i(u);t.incomingStore.del(a,t.noop),t._sendPacket(o,i);}));});};Ua.default=Tv;});var Ap=M(Ci=>{v();m();_();var Bi=Ci&&Ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ci,"__esModule",{value:!0});var Rv=Bi(Vd()),Cv=Bi(Kd()),Bv=Bi(Ep()),Pv=Bi(Ai()),Ov=Bi(Sp()),kv=(t,e,r)=>{let{options:i}=t;if(i.protocolVersion===5&&i.properties&&i.properties.maximumPacketSize&&i.properties.maximumPacketSize<e.length)return t.emit("error",new Error(`exceeding packets size ${e.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0, Rv.default)(t,e,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0, Pv.default)(t,e),r();break;case"pubrel":(0, Ov.default)(t,e,r);break;case"connack":(0, Bv.default)(t,e),r();break;case"auth":(0, Cv.default)(t,e),r();break;case"pingresp":t.pingResp=!0,r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};Ci.default=kv;});var Ip=M(ti=>{v();m();_();var xv=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});ti.TypedEventEmitter=void 0;var Mv=xv((ir(),X(rr))),Lv=Jr(),Xn=class{};ti.TypedEventEmitter=Xn;(0, Lv.applyMixin)(Xn,Mv.default);});var Pi=M(Ar=>{v();m();_();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.isReactNativeBrowser=Ar.isWebWorker=void 0;var Uv=()=>typeof window<"u"&&typeof window.document<"u",Tp=()=>{var t,e;return !!(typeof self=="object"&&(!((e=(t=self?.constructor)===null||t===void 0?void 0:t.name)===null||e===void 0)&&e.includes("WorkerGlobalScope")))},Rp=()=>typeof B<"u"&&B.product==="ReactNative",Nv=Uv()||Tp()||Rp();Ar.isWebWorker=Tp();Ar.isReactNativeBrowser=Rp();Ar.default=Nv;});var Bp=M((Zn,Cp)=>{v();m();_();(function(t,e){typeof Zn=="object"&&typeof Cp<"u"?e(Zn):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}));})(Zn,function(t){var e=function(g){return function(y){var w=g(y);return y.add(w),w}},r=function(g){return function(y,w){return g.set(y,w),w}},i=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,o=n*2,s=function(g,y){return function(w){var E=y.get(w),S=E===void 0?w.size:E<o?E+1:0;if(!w.has(S))return g(w,S);if(w.size<n){for(;w.has(S);)S=Math.floor(Math.random()*o);return g(w,S)}if(w.size>i)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;w.has(S);)S=Math.floor(Math.random()*i);return g(w,S)}},a=new WeakMap,u=r(a),c=s(u,a),h=e(c);t.addUniqueNumber=h,t.generateUniqueNumber=c;});});var Op=M((es,Pp)=>{v();m();_();(function(t,e){typeof es=="object"&&typeof Pp<"u"?e(es,Bp()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t.fastUniqueNumbers));})(es,function(t,e){var r=function(s){return s.method!==void 0&&s.method==="call"},i=function(s){return s.error===null&&typeof s.id=="number"},n=function(s){var a=new Map([[0,function(){}]]),u=new Map([[0,function(){}]]),c=new Map,h=new Worker(s);h.addEventListener("message",function(E){var S=E.data;if(r(S)){var I=S.params,C=I.timerId,R=I.timerType;if(R==="interval"){var U=a.get(C);if(typeof U=="number"){var N=c.get(U);if(N===void 0||N.timerId!==C||N.timerType!==R)throw new Error("The timer is in an undefined state.")}else if(typeof U<"u")U();else throw new Error("The timer is in an undefined state.")}else if(R==="timeout"){var W=u.get(C);if(typeof W=="number"){var K=c.get(W);if(K===void 0||K.timerId!==C||K.timerType!==R)throw new Error("The timer is in an undefined state.")}else if(typeof W<"u")W(),u.delete(C);else throw new Error("The timer is in an undefined state.")}}else if(i(S)){var z=S.id,Q=c.get(z);if(Q===void 0)throw new Error("The timer is in an undefined state.");var de=Q.timerId,Gt=Q.timerType;c.delete(z),Gt==="interval"?a.delete(de):u.delete(de);}else {var pe=S.error.message;throw new Error(pe)}});var d=function(S){var I=e.generateUniqueNumber(c);c.set(I,{timerId:S,timerType:"interval"}),a.set(S,I),h.postMessage({id:I,method:"clear",params:{timerId:S,timerType:"interval"}});},g=function(S){var I=e.generateUniqueNumber(c);c.set(I,{timerId:S,timerType:"timeout"}),u.set(S,I),h.postMessage({id:I,method:"clear",params:{timerId:S,timerType:"timeout"}});},y=function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=e.generateUniqueNumber(a);return a.set(C,function(){S(),typeof a.get(C)=="function"&&h.postMessage({id:null,method:"set",params:{delay:I,now:performance.now(),timerId:C,timerType:"interval"}});}),h.postMessage({id:null,method:"set",params:{delay:I,now:performance.now(),timerId:C,timerType:"interval"}}),C},w=function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=e.generateUniqueNumber(u);return u.set(C,S),h.postMessage({id:null,method:"set",params:{delay:I,now:performance.now(),timerId:C,timerType:"timeout"}}),C};return {clearInterval:d,clearTimeout:g,setInterval:y,setTimeout:w}};t.load=n;});});var xp=M((ts,kp)=>{v();m();_();(function(t,e){typeof ts=="object"&&typeof kp<"u"?e(ts,Op()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimers={},t.workerTimersBroker));})(ts,function(t,e){var r=function(h,d){var g=null;return function(){if(g!==null)return g;var y=new Blob([d],{type:"application/javascript; charset=utf-8"}),w=URL.createObjectURL(y);return g=h(w),setTimeout(function(){return URL.revokeObjectURL(w)}),g}},i=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,n=r(e.load,i),o=function(h){return n().clearInterval(h)},s=function(h){return n().clearTimeout(h)},a=function(){var h;return (h=n()).setInterval.apply(h,arguments)},u=function(){var h;return (h=n()).setTimeout.apply(h,arguments)};t.clearInterval=o,t.clearTimeout=s,t.setInterval=a,t.setTimeout=u;});});var Np=M(Rt=>{v();m();_();var qv=Rt&&Rt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),Dv=Rt&&Rt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),jv=Rt&&Rt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&qv(e,t,r);return Dv(e,t),e};Object.defineProperty(Rt,"__esModule",{value:!0});var Na=jv(Pi()),Mp=xp(),Lp={set:Mp.setTimeout,clear:Mp.clearTimeout},Up={set:(t,e)=>setTimeout(t,e),clear:t=>clearTimeout(t)},Fv=t=>{switch(t){case"native":return Up;case"worker":return Lp;case"auto":default:return Na.default&&!Na.isWebWorker&&!Na.isReactNativeBrowser?Lp:Up}};Rt.default=Fv;});var Da=M(Oi=>{v();m();_();var Wv=Oi&&Oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oi,"__esModule",{value:!0});var $v=Wv(Np()),qa=class{constructor(e,r,i){this.keepalive=e*1e3,this.checkPing=r,this.timer=(0, $v.default)(i),this.reschedule();}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null);}reschedule(){this.clear(),this.timerId=this.timer.set(()=>{this.checkPing(),this.timerId&&this.reschedule();},this.keepalive);}};Oi.default=qa;});var ns=M(Qe=>{v();m();_();var Hv=Qe&&Qe.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),Vv=Qe&&Qe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),Wp=Qe&&Qe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Hv(e,t,r);return Vv(e,t),e},Vt=Qe&&Qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qe,"__esModule",{value:!0});var zv=Vt(Gu()),ja=Vt(Nd()),Kv=Vt(Yo()),Gv=Dt(),qp=Vt(Fd()),Dp=Wp($d()),Qv=Vt(ot()),rs=Vt(Zo()),Yv=Vt(Ap()),Wa=Jr(),Jv=Ip(),Xv=Vt(Da()),jp=Wp(Pi()),Fa=globalThis.setImmediate||((...t)=>{let e=t.shift();(0, Wa.nextTick)(()=>{e(...t);});}),Fp={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},is=class t extends Jv.TypedEventEmitter{static defaultId(){return `mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in Fp)typeof this.options[i]>"u"?this.options[i]=Fp[i]:this.options[i]=r[i];this.log=this.options.log||(0, Qv.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),jp.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",jp.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId=typeof r.clientId=="string"?r.clientId:t.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=r.protocolVersion===5&&r.customHandleAcks?r.customHandleAcks:(...i)=>{i[3](null,0);},this.options.writeCache||(ja.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new Kv.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new rs.default,this.incomingStore=r.incomingStore||new rs.default,this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new zv.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,n=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let s=null;if(!o){this._resubscribe();return}s=o.packet,this.log("deliver :: call _sendPacket for %o",s);let a=!0;s.messageId&&s.messageId!==0&&(this.messageIdProvider.register(s.messageId)||(a=!1)),a?this._sendPacket(s,u=>{o.cb&&o.cb(u),n();}):(this.log("messageId: %d has already used. The message is skipped and removed.",s.messageId),n());};this.log("connect :: sending queued packets"),n();}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect();}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect());}handleAuth(e,r){r();}handleMessage(e,r){r();}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;let r=new Gv.Writable,i=ja.default.parser(this.options),n=null,o=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",h=>{this.log("parser :: on packet push to packets array."),o.push(h);});let s=()=>{this.log("work :: getting next packet in queue");let h=o.shift();if(h)this.log("work :: packet pulled from queue"),(0, Yv.default)(this,h,a);else {this.log("work :: no packets in queue");let d=n;n=null,this.log("work :: done flag is %s",!!d),d&&d();}},a=()=>{if(o.length)(0, Wa.nextTick)(s);else {let h=n;n=null,h();}};r._write=(h,d,g)=>{n=g,this.log("writable stream :: parsing buffer"),i.parse(h),s();};let u=h=>{this.log("streamErrorHandler :: error",h.message),h.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",h)):this.noop(h);};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(r),this.stream.on("error",u),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close");}),this.log("connect: sending packet `connect`");let c={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(c.will=Object.assign(Object.assign({},this.options.will),{payload:(e=this.options.will)===null||e===void 0?void 0:e.payload})),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(c),i.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let h=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(h);}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0);},this.options.connectTimeout),this}publish(e,r,i,n){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:o}=this;typeof i=="function"&&(n=i,i=null),i=i||{},i=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),i);let{qos:a,retain:u,dup:c,properties:h,cbStorePut:d}=i;if(this._checkDisconnecting(n))return this;let g=()=>{let y=0;if((a===1||a===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let w={cmd:"publish",topic:e,payload:r,qos:a,retain:u,messageId:y,dup:c};switch(o.protocolVersion===5&&(w.properties=h),this.log("publish :: qos",a),a){case 1:case 2:this.outgoing[w.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",w.cmd),this._sendPacket(w,void 0,d);break;default:this.log("MqttClient:publish: packet cmd: %s",w.cmd),this._sendPacket(w,n,d);break}return !0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,cbStorePut:i.cbStorePut,callback:n}),this}publishAsync(e,r,i){return new Promise((n,o)=>{this.publish(e,r,i,(s,a)=>{s?o(s):n(a);});})}subscribe(e,r,i){let n=this.options.protocolVersion;typeof r=="function"&&(i=r),i=i||this.noop;let o=!1,s=[];typeof e=="string"?(e=[e],s=e):Array.isArray(e)?s=e:typeof e=="object"&&(o=e.resubscribe,delete e.resubscribe,s=Object.keys(e));let a=Dp.validateTopics(s);if(a!==null)return Fa(i,new Error(`Invalid topic ${a}`)),this;if(this._checkDisconnecting(i))return this.log("subscribe: discconecting true"),this;let u={qos:0};n===5&&(u.nl=!1,u.rap=!1,u.rh=0),r=Object.assign(Object.assign({},u),r);let c=r.properties,h=[],d=(y,w)=>{if(w=w||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,y)||this._resubscribeTopics[y].qos<w.qos||o){let E={topic:y,qos:w.qos};n===5&&(E.nl=w.nl,E.rap=w.rap,E.rh=w.rh,E.properties=c),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",E.topic,E.qos),h.push(E);}};if(Array.isArray(e)?e.forEach(y=>{this.log("subscribe: array topic %s",y),d(y);}):Object.keys(e).forEach(y=>{this.log("subscribe: object topic %s, %o",y,e[y]),d(y,e[y]);}),!h.length)return i(null,[]),this;let g=()=>{let y=this._nextId();if(y===null)return this.log("No messageId left"),!1;let w={cmd:"subscribe",subscriptions:h,messageId:y};if(c&&(w.properties=c),this.options.resubscribe){this.log("subscribe :: resubscribe true");let E=[];h.forEach(S=>{if(this.options.reconnectPeriod>0){let I={qos:S.qos};n===5&&(I.nl=S.nl||!1,I.rap=S.rap||!1,I.rh=S.rh||0,I.properties=S.properties),this._resubscribeTopics[S.topic]=I,E.push(S.topic);}}),this.messageIdToTopic[w.messageId]=E;}return this.outgoing[w.messageId]={volatile:!0,cb(E,S){if(!E){let{granted:I}=S;for(let C=0;C<I.length;C+=1)h[C].qos=I[C];}i(E,h);}},this.log("subscribe :: call _sendPacket"),this._sendPacket(w),!0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,callback:i}),this}subscribeAsync(e,r){return new Promise((i,n)=>{this.subscribe(e,r,(o,s)=>{o?n(o):i(s);});})}unsubscribe(e,r,i){typeof e=="string"&&(e=[e]),typeof r=="function"&&(i=r),i=i||this.noop;let n=Dp.validateTopics(e);if(n!==null)return Fa(i,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(i))return this;let o=()=>{let s=this._nextId();if(s===null)return this.log("No messageId left"),!1;let a={cmd:"unsubscribe",messageId:s,unsubscriptions:[]};return typeof e=="string"?a.unsubscriptions=[e]:Array.isArray(e)&&(a.unsubscriptions=e),this.options.resubscribe&&a.unsubscriptions.forEach(u=>{delete this._resubscribeTopics[u];}),typeof r=="object"&&r.properties&&(a.properties=r.properties),this.outgoing[a.messageId]={volatile:!0,cb:i},this.log("unsubscribe: call _sendPacket"),this._sendPacket(a),!0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:i}),this}unsubscribeAsync(e,r){return new Promise((i,n)=>{this.unsubscribe(e,r,(o,s)=>{o?n(o):i(s);});})}end(e,r,i){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(i=i||r,r=e,e=!1),typeof r!="object"&&(i=i||r,r=null),this.log("end :: cb? %s",!!i),(!i||typeof i!="function")&&(i=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(s=>{this.outgoingStore.close(a=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),i){let u=s||a;this.log("end :: closeStores: invoking callback with args"),i(u);}});}),this._deferredReconnect&&this._deferredReconnect();},o=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0, Wa.nextTick)(n);},r);};return this.disconnecting?(i(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,r){return new Promise((i,n)=>{this.end(e,r,o=>{o?n(o):i();});})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:r}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{r(new Error("Message removed"));});}return this}reconnect(e){this.log("client reconnect");let r=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new rs.default,this.outgoingStore=this.options.outgoingStore||new rs.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect();};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e]);}));}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e]);}));}_removeTopicAliasAndRecoverTopicName(e){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,i),i.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(i=this.topicAliasSend.getTopicByAlias(r),typeof i>"u")return new Error("Unregistered Topic Alias");e.topic=i;}r&&delete e.properties.topicAlias;}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect();}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect());}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect();},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...");}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null);}_cleanUp(e,r,i={}){if(r&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",r)),this.log("_cleanUp :: forced? %s",e),e)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else {let n=Object.assign({cmd:"disconnect"},i);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(n,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),Fa(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId);});});});}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),r&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",r),r());}_storeAndSend(e,r,i){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n=e,o;if(n.cmd==="publish"&&(n=(0, qp.default)(e),o=this._removeTopicAliasAndRecoverTopicName(n),o))return r&&r(o);this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i(),this._writePacket(e,r);});}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.topicAliasSend)if(r){if(i.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",i,r),!this.topicAliasSend.put(i,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}else i.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(i),r?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",i,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(i,r),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",i,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(i),r&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",i,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e);}_writePacket(e,r){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");let i=ja.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",i),!i&&r&&r!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",r)):r&&(this.log("_writePacket :: invoking cb"),r());}_sendPacket(e,r,i,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),i=i||this.noop,r=r||this.noop;let o=this._applyTopicAlias(e);if(o){r(o);return}if(!this.connected){if(e.cmd==="auth"){this._writePacket(e,r);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(e,r,i);return}if(n){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,i);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,i);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId);}_storePacket(e,r,i){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),i=i||this.noop;let n=e;if(n.cmd==="publish"){n=(0, qp.default)(e);let s=this._removeTopicAliasAndRecoverTopicName(n);if(s)return r&&r(s)}let o=n.qos||0;o===0&&this.queueQoSZero||n.cmd!=="publish"?this.queue.push({packet:n,cb:r}):o>0?(r=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i();})):r&&r(new Error("No connection to broker"));}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=new Xv.default(this.options.keepalive,()=>{this._checkPing();},this.options.timerVariant));}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule();}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.emit("error",new Error("Keepalive timeout")),this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0));}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let r=0;r<e.length;r++){let i={};i[e[r]]=this._resubscribeTopics[e[r]],i.resubscribe=!0,this.subscribe(i,{properties:i[e[r]].properties});}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1;}_onConnect(e){if(this.disconnected){this.emit("connect",e);return}this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;let r=()=>{let i=this.outgoingStore.createStream(),n=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o();},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={};};this.once("close",n),i.on("error",a=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",a);});let s=()=>{if(!i)return;let a=i.read(1),u;if(!a){i.once("readable",s);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[a.messageId]){s();return}!this.disconnecting&&!this.reconnectTimer?(u=this.outgoing[a.messageId]?this.outgoing[a.messageId].cb:null,this.outgoing[a.messageId]={volatile:!1,cb(c,h){u&&u(c,h),s();}},this._packetIdsDuringStoreProcessing[a.messageId]=!0,this.messageIdProvider.register(a.messageId)?this._sendPacket(a,void 0,void 0,!0):this.log("messageId: %d has already used.",a.messageId)):i.destroy&&i.destroy();};i.on("end",()=>{let a=!0;for(let u in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[u]){a=!1;break}this.removeListener("close",n),a?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):r();}),s();};r();}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return !1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0);}_removeOutgoingAndStoreMessage(e,r){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(i,n)=>{r(i,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue();});}};is.VERSION="5.5.2";Qe.default=is;});var $p=M(Ha=>{v();m();_();Object.defineProperty(Ha,"__esModule",{value:!0});var Zv=xa(),$a=class{constructor(){this.numberAllocator=new Zv.NumberAllocator(1,65535);}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e);}clear(){this.numberAllocator.clear();}};Ha.default=$a;});function Ir(t){throw new RangeError(iE[t])}function Hp(t,e){let r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]);let n=function(o,s){let a=[],u=o.length;for(;u--;)a[u]=s(o[u]);return a}((t=t.replace(rE,".")).split("."),e).join(".");return i+n}function Gp(t){let e=[],r=0,i=t.length;for(;r<i;){let n=t.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){let o=t.charCodeAt(r++);(64512&o)==56320?e.push(((1023&n)<<10)+(1023&o)+65536):(e.push(n),r--);}else e.push(n);}return e}var eE,tE,rE,iE,ht,Va,Vp,Qp,zp,Kp,zt,Yp=we(()=>{v();m();_();eE=/^xn--/,tE=/[^\0-\x7E]/,rE=/[\x2E\u3002\uFF0E\uFF61]/g,iE={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ht=Math.floor,Va=String.fromCharCode;Vp=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Qp=function(t,e,r){let i=0;for(t=r?ht(t/700):t>>1,t+=ht(t/e);t>455;i+=36)t=ht(t/35);return ht(i+36*t/(t+38))},zp=function(t){let e=[],r=t.length,i=0,n=128,o=72,s=t.lastIndexOf("-");s<0&&(s=0);for(let u=0;u<s;++u)t.charCodeAt(u)>=128&&Ir("not-basic"),e.push(t.charCodeAt(u));for(let u=s>0?s+1:0;u<r;){let c=i;for(let d=1,g=36;;g+=36){u>=r&&Ir("invalid-input");let y=(a=t.charCodeAt(u++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(y>=36||y>ht((2147483647-i)/d))&&Ir("overflow"),i+=y*d;let w=g<=o?1:g>=o+26?26:g-o;if(y<w)break;let E=36-w;d>ht(2147483647/E)&&Ir("overflow"),d*=E;}let h=e.length+1;o=Qp(i-c,h,c==0),ht(i/h)>2147483647-n&&Ir("overflow"),n+=ht(i/h),i%=h,e.splice(i++,0,n);}var a;return String.fromCodePoint(...e)},Kp=function(t){let e=[],r=(t=Gp(t)).length,i=128,n=0,o=72;for(let u of t)u<128&&e.push(Va(u));let s=e.length,a=s;for(s&&e.push("-");a<r;){let u=2147483647;for(let h of t)h>=i&&h<u&&(u=h);let c=a+1;u-i>ht((2147483647-n)/c)&&Ir("overflow"),n+=(u-i)*c,i=u;for(let h of t)if(h<i&&++n>2147483647&&Ir("overflow"),h==i){let d=n;for(let g=36;;g+=36){let y=g<=o?1:g>=o+26?26:g-o;if(d<y)break;let w=d-y,E=36-y;e.push(Va(Vp(y+w%E,0))),d=ht(w/E);}e.push(Va(Vp(d,0))),o=Qp(n,c,a==s),n=0,++a;}++n,++i;}return e.join("")},zt={version:"2.1.0",ucs2:{decode:Gp,encode:t=>String.fromCodePoint(...t)},decode:zp,encode:Kp,toASCII:function(t){return Hp(t,function(e){return tE.test(e)?"xn--"+Kp(e):e})},toUnicode:function(t){return Hp(t,function(e){return eE.test(e)?zp(e.slice(4).toLowerCase()):e})}};zt.decode;zt.encode;zt.toASCII;zt.toUnicode;zt.ucs2;zt.version;});function nE(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var sE,ki,oE,dt,Jp=we(()=>{v();m();_();sE=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var c,h,d,g,y=t[u].replace(o,"%20"),w=y.indexOf(r);w>=0?(c=y.substr(0,w),h=y.substr(w+1)):(c=y,h=""),d=decodeURIComponent(c),g=decodeURIComponent(h),nE(n,d)?Array.isArray(n[d])?n[d].push(g):n[d]=[n[d],g]:n[d]=g;}return n},ki=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return ""}},oE=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(n){var o=encodeURIComponent(ki(n))+r;return Array.isArray(t[n])?t[n].map(function(s){return o+encodeURIComponent(ki(s))}).join(e):o+encodeURIComponent(ki(t[n]))}).join(e):i?encodeURIComponent(ki(i))+r+encodeURIComponent(ki(t)):""},dt={};dt.decode=dt.parse=sE,dt.encode=dt.stringify=oE;dt.decode;dt.encode;dt.parse;dt.stringify;});function za(){throw new Error("setTimeout has not been defined")}function Ka(){throw new Error("clearTimeout has not been defined")}function eg(t){if(Bt===setTimeout)return setTimeout(t,0);if((Bt===za||!Bt)&&setTimeout)return Bt=setTimeout,setTimeout(t,0);try{return Bt(t,0)}catch{try{return Bt.call(null,t,0)}catch{return Bt.call(this||ii,t,0)}}}function aE(){ri&&Tr&&(ri=!1,Tr.length?Ot=Tr.concat(Ot):ss=-1,Ot.length&&tg());}function tg(){if(!ri){var t=eg(aE);ri=!0;for(var e=Ot.length;e;){for(Tr=Ot,Ot=[];++ss<e;)Tr&&Tr[ss].run();ss=-1,e=Ot.length;}Tr=null,ri=!1,function(r){if(Pt===clearTimeout)return clearTimeout(r);if((Pt===Ka||!Pt)&&clearTimeout)return Pt=clearTimeout,clearTimeout(r);try{Pt(r);}catch{try{return Pt.call(null,r)}catch{return Pt.call(this||ii,r)}}}(t);}}function Xp(t,e){(this||ii).fun=t,(this||ii).array=e;}function Ct(){}var Zp,Bt,Pt,ii,fe,Tr,Ot,ri,ss,ne,rg=we(()=>{v();m();_();ii=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,fe=Zp={};(function(){try{Bt=typeof setTimeout=="function"?setTimeout:za;}catch{Bt=za;}try{Pt=typeof clearTimeout=="function"?clearTimeout:Ka;}catch{Pt=Ka;}})();Ot=[],ri=!1,ss=-1;fe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ot.push(new Xp(t,e)),Ot.length!==1||ri||eg(tg);},Xp.prototype.run=function(){(this||ii).fun.apply(null,(this||ii).array);},fe.title="browser",fe.browser=!0,fe.env={},fe.argv=[],fe.version="",fe.versions={},fe.on=Ct,fe.addListener=Ct,fe.once=Ct,fe.off=Ct,fe.removeListener=Ct,fe.removeAllListeners=Ct,fe.emit=Ct,fe.prependListener=Ct,fe.prependOnceListener=Ct,fe.listeners=function(t){return []},fe.binding=function(t){throw new Error("process.binding is not supported")},fe.cwd=function(){return "/"},fe.chdir=function(t){throw new Error("process.chdir is not supported")},fe.umask=function(){return 0};ne=Zp;ne.addListener;ne.argv;ne.binding;ne.browser;ne.chdir;ne.cwd;ne.emit;ne.env;ne.listeners;ne.nextTick;ne.off;ne.on;ne.once;ne.prependListener;ne.prependOnceListener;ne.removeAllListeners;ne.removeListener;ne.title;ne.umask;ne.version;ne.versions;});function lE(){if(ig)return Ga;ig=!0;var t=Ga={},e,r;function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch{e=i;}try{typeof clearTimeout=="function"?r=clearTimeout:r=n;}catch{r=n;}})();function o(E){if(e===setTimeout)return setTimeout(E,0);if((e===i||!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||ni,E,0)}}}function s(E){if(r===clearTimeout)return clearTimeout(E);if((r===n||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(E);try{return r(E)}catch{try{return r.call(null,E)}catch{return r.call(this||ni,E)}}}var a=[],u=!1,c,h=-1;function d(){!u||!c||(u=!1,c.length?a=c.concat(a):h=-1,a.length&&g());}function g(){if(!u){var E=o(d);u=!0;for(var S=a.length;S;){for(c=a,a=[];++h<S;)c&&c[h].run();h=-1,S=a.length;}c=null,u=!1,s(E);}}t.nextTick=function(E){var S=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)S[I-1]=arguments[I];a.push(new y(E,S)),a.length===1&&!u&&o(g);};function y(E,S){(this||ni).fun=E,(this||ni).array=S;}y.prototype.run=function(){(this||ni).fun.apply(null,(this||ni).array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function w(){}return t.on=w,t.addListener=w,t.once=w,t.off=w,t.removeListener=w,t.removeAllListeners=w,t.emit=w,t.prependListener=w,t.prependOnceListener=w,t.listeners=function(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},Ga}var Ga,ig,ni,re,Qa=we(()=>{v();m();_();Ga={},ig=!1,ni=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;re=lE();re.platform="browser";re.addListener;re.argv;re.binding;re.browser;re.chdir;re.cwd;re.emit;re.env;re.listeners;re.nextTick;re.off;re.on;re.once;re.prependListener;re.prependOnceListener;re.removeAllListeners;re.removeListener;re.title;re.umask;re.version;re.versions;});function uE(){if(ng)return Ya;ng=!0;var t=re;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",u=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else {if(d===47)break;d=47;}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",u=0):(a=a.slice(0,y),u=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2);}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),u=g-c-1;c=g,h=0;}else d===46&&h!==-1?++h:h=-1;}return a}function i(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var n={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(u===void 0&&(u=t.cwd()),h=u),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47);}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return ".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u);}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return "";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,h=c-u,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,w=h<y?h:y,E=-1,S=0;S<=w;++S){if(S===w){if(y>w){if(a.charCodeAt(d+S)===47)return a.slice(d+S+1);if(S===0)return a.slice(d+S)}else h>w&&(s.charCodeAt(u+S)===47?E=S:S===0&&(E=0));break}var I=s.charCodeAt(u+S),C=a.charCodeAt(d+S);if(I!==C)break;I===47&&(E=S);}var R="";for(S=u+E+1;S<=c;++S)(S===c||s.charCodeAt(S)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return ".";for(var a=s.charCodeAt(0),u=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return "";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var w=s.charCodeAt(d);if(w===47){if(!h){u=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(w===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y));}return u===c?c=y:c===-1&&(c=s.length),s.slice(u,c)}else {for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){u=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){u=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1);}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,w=!0,E=s.length-1,S=0;E>=h;--E){if(u=s.charCodeAt(E),u===47){if(!w){g=E+1;break}continue}y===-1&&(w=!1,y=E+1),u===46?d===-1?d=E:S!==1&&(S=1):d!==-1&&(S=-1);}return d===-1||y===-1||S===0||S===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Ya=n,Ya}var Ya,ng,Ja,sg=we(()=>{v();m();_();Qa();Ya={},ng=!1;Ja=uE();});var dg={};Qt(dg,{URL:()=>DE,Url:()=>ME,default:()=>Z,fileURLToPath:()=>cg,format:()=>LE,parse:()=>qE,pathToFileURL:()=>hg,resolve:()=>UE,resolveObject:()=>NE});function Fe(){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 xi(t,e,r){if(t&&pt.isObject(t)&&t instanceof Fe)return t;var i=new Fe;return i.parse(t,e,r),i}function bE(){if(ug)return el;ug=!0;var t=ne;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",u=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else {if(d===47)break;d=47;}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",u=0):(a=a.slice(0,y),u=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2);}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),u=g-c-1;c=g,h=0;}else d===46&&h!==-1?++h:h=-1;}return a}function i(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var n={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(u===void 0&&(u=t.cwd()),h=u),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47);}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return ".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u);}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return "";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,h=c-u,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,w=h<y?h:y,E=-1,S=0;S<=w;++S){if(S===w){if(y>w){if(a.charCodeAt(d+S)===47)return a.slice(d+S+1);if(S===0)return a.slice(d+S)}else h>w&&(s.charCodeAt(u+S)===47?E=S:S===0&&(E=0));break}var I=s.charCodeAt(u+S),C=a.charCodeAt(d+S);if(I!==C)break;I===47&&(E=S);}var R="";for(S=u+E+1;S<=c;++S)(S===c||s.charCodeAt(S)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return ".";for(var a=s.charCodeAt(0),u=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return "";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var w=s.charCodeAt(d);if(w===47){if(!h){u=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(w===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y));}return u===c?c=y:c===-1&&(c=s.length),s.slice(u,c)}else {for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){u=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){u=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1);}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,w=!0,E=s.length-1,S=0;E>=h;--E){if(u=s.charCodeAt(E),u===47){if(!w){g=E+1;break}continue}y===-1&&(w=!1,y=E+1),u===46?d===-1?d=E:S!==1&&(S=1):d!==-1&&(S=-1);}return d===-1||y===-1||S===0||S===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,el=n,el}function BE(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 rl?PE(t):OE(t)}function PE(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]==="%"){let n=r.codePointAt(i+2)||32;if(r[i+1]==="2"&&n===102||r[i+1]==="5"&&n===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(SE,"\\"),r=decodeURIComponent(r),e!=="")return `\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<vE||i>EE||n!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function OE(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function kE(t){let e=fg.resolve(t),r=t.charCodeAt(t.length-1);(r===mE||rl&&r===_E)&&e[e.length-1]!==fg.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(AE,"%25")),!rl&&e.includes("\\")&&(e=e.replace(IE,"%5C")),e.includes(`
|
|
5
|
-
`)&&(e=e.replace(TE,"%0A")),e.includes("\r")&&(e=e.replace(RE,"%0D")),e.includes(" ")&&(e=e.replace(CE,"%09")),i.pathname=e,i}function cg(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 il?YE(t):JE(t)}function YE(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]==="%"){let n=r.codePointAt(i+2)||32;if(r[i+1]==="2"&&n===102||r[i+1]==="5"&&n===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(HE,"\\"),r=decodeURIComponent(r),e!=="")return `\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<WE||i>$E||n!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function JE(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function hg(t){let e=Ja.resolve(t),r=t.charCodeAt(t.length-1);(r===FE||il&&r===jE)&&e[e.length-1]!==Ja.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(VE,"%25")),!il&&e.includes("\\")&&(e=e.replace(zE,"%5C")),e.includes(`
|
|
6
|
-
`)
|
|
7
|
-
`," "]),tl=["'"].concat(pE),og=["%","/","?",";","#"].concat(tl),ag=["/","?","#"],lg=/^[+a-z0-9A-Z_-]{0,63}$/,gE=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,yE={javascript:!0,"javascript:":!0},Xa={javascript:!0,"javascript:":!0},si={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Za=dt;Fe.prototype.parse=function(t,e,r){if(!pt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&t.split("#").length===1){var a=dE.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?Za.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=cE.exec(s);if(u){var c=(u=u[0]).toLowerCase();this.protocol=c,s=s.substr(u.length);}if(r||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var h=s.substr(0,2)==="//";!h||u&&Xa[u]||(s=s.substr(2),this.slashes=!0);}if(!Xa[u]&&(h||u&&!si[u])){for(var d,g,y=-1,w=0;w<ag.length;w++)(E=s.indexOf(ag[w]))!==-1&&(y===-1||E<y)&&(y=E);for((g=y===-1?s.lastIndexOf("@"):s.lastIndexOf("@",y))!==-1&&(d=s.slice(0,g),s=s.slice(g+1),this.auth=decodeURIComponent(d)),y=-1,w=0;w<og.length;w++){var E;(E=s.indexOf(og[w]))!==-1&&(y===-1||E<y)&&(y=E);}y===-1&&(y=s.length),this.host=s.slice(0,y),s=s.slice(y),this.parseHost(),this.hostname=this.hostname||"";var S=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!S)for(var I=this.hostname.split(/\./),C=(w=0,I.length);w<C;w++){var R=I[w];if(R&&!R.match(lg)){for(var U="",N=0,W=R.length;N<W;N++)R.charCodeAt(N)>127?U+="x":U+=R[N];if(!U.match(lg)){var K=I.slice(0,w),z=I.slice(w+1),Q=R.match(gE);Q&&(K.push(Q[1]),z.unshift(Q[2])),z.length&&(s="/"+z.join(".")+s),this.hostname=K.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=fE.toASCII(this.hostname));var de=this.port?":"+this.port:"",Gt=this.hostname||"";this.host=Gt+de,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s));}if(!yE[c])for(w=0,C=tl.length;w<C;w++){var pe=tl[w];if(s.indexOf(pe)!==-1){var Cr=encodeURIComponent(pe);Cr===pe&&(Cr=escape(pe)),s=s.split(pe).join(Cr);}}var Br=s.indexOf("#");Br!==-1&&(this.hash=s.substr(Br),s=s.slice(0,Br));var Pr=s.indexOf("?");if(Pr!==-1?(this.search=s.substr(Pr),this.query=s.substr(Pr+1),e&&(this.query=Za.parse(this.query)),s=s.slice(0,Pr)):e&&(this.search="",this.query={}),s&&(this.pathname=s),si[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){de=this.pathname||"";var us=this.search||"";this.path=de+us;}return this.href=this.format(),this},Fe.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&pt.isObject(this.query)&&Object.keys(this.query).length&&(o=Za.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||si[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,function(a){return encodeURIComponent(a)}))+(s=s.replace("#","%23"))+i},Fe.prototype.resolve=function(t){return this.resolveObject(xi(t,!1,!0)).format()},Fe.prototype.resolveObject=function(t){if(pt.isString(t)){var e=new Fe;e.parse(t,!1,!0),t=e;}for(var r=new Fe,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o];}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];u!=="protocol"&&(r[u]=t[u]);}return si[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!si[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var d=c[h];r[d]=t[d];}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||Xa[t.protocol])r.pathname=t.pathname;else {for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),r.pathname=g.join("/");}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",w=r.search||"";r.path=y+w;}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var E=r.pathname&&r.pathname.charAt(0)==="/",S=t.host||t.pathname&&t.pathname.charAt(0)==="/",I=S||E||r.host&&t.pathname,C=I,R=r.pathname&&r.pathname.split("/")||[],U=(g=t.pathname&&t.pathname.split("/")||[],r.protocol&&!si[r.protocol]);if(U&&(r.hostname="",r.port=null,r.host&&(R[0]===""?R[0]=r.host:R.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),I=I&&(g[0]===""||R[0]==="")),S)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,R=g;else if(g.length)R||(R=[]),R.pop(),R=R.concat(g),r.search=t.search,r.query=t.query;else if(!pt.isNullOrUndefined(t.search))return U&&(r.hostname=r.host=R.shift(),(Q=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=Q.shift(),r.host=r.hostname=Q.shift())),r.search=t.search,r.query=t.query,pt.isNull(r.pathname)&&pt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!R.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var N=R.slice(-1)[0],W=(r.host||t.host||R.length>1)&&(N==="."||N==="..")||N==="",K=0,z=R.length;z>=0;z--)(N=R[z])==="."?R.splice(z,1):N===".."?(R.splice(z,1),K++):K&&(R.splice(z,1),K--);if(!I&&!C)for(;K--;K)R.unshift("..");!I||R[0]===""||R[0]&&R[0].charAt(0)==="/"||R.unshift(""),W&&R.join("/").substr(-1)!=="/"&&R.push("");var Q,de=R[0]===""||R[0]&&R[0].charAt(0)==="/";return U&&(r.hostname=r.host=de?"":R.length?R.shift():"",(Q=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=Q.shift(),r.host=r.hostname=Q.shift())),(I=I||r.host&&R.length)&&!de&&R.unshift(""),R.length?r.pathname=R.join("/"):(r.pathname=null,r.path=null),pt.isNull(r.pathname)&&pt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Fe.prototype.parseHost=function(){var t=this.host,e=hE.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t);};Z.Url;Z.format;Z.resolve;Z.resolveObject;el={},ug=!1;fg=bE(),wE=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Z.URL=typeof URL<"u"?URL:null;Z.pathToFileURL=kE;Z.fileURLToPath=BE;Z.Url;Z.format;Z.resolve;Z.resolveObject;Z.URL;_E=92,mE=47,vE=97,EE=122,rl=wE==="win32",SE=/\//g,AE=/%/g,IE=/\\/g,TE=/\n/g,RE=/\r/g,CE=/\t/g;xE=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Z.URL=typeof URL<"u"?URL:null;Z.pathToFileURL=hg;Z.fileURLToPath=cg;ME=Z.Url,LE=Z.format,UE=Z.resolve,NE=Z.resolveObject,qE=Z.parse,DE=Z.URL,jE=92,FE=47,WE=97,$E=122,il=xE==="win32",HE=/\//g,VE=/%/g,zE=/\\/g,KE=/\n/g,GE=/\r/g,QE=/\t/g;});var nl={};Qt(nl,{Server:()=>Me,Socket:()=>Me,Stream:()=>Me,_createServerHandle:()=>Me,_normalizeArgs:()=>Me,_setSimultaneousAccepts:()=>Me,connect:()=>Me,createConnection:()=>Me,createServer:()=>Me,default:()=>XE,isIP:()=>Me,isIPv4:()=>Me,isIPv6:()=>Me});function Me(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var XE,sl=we(()=>{v();m();_();XE={_createServerHandle:Me,_normalizeArgs:Me,_setSimultaneousAccepts:Me,connect:Me,createConnection:Me,createServer:Me,isIP:Me,isIPv4:Me,isIPv6:Me,Server:Me,Socket:Me,Stream:Me};});var ol=M(Mi=>{v();m();_();var gg=Mi&&Mi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mi,"__esModule",{value:!0});var ZE=gg((sl(),X(nl))),eS=gg(ot()),tS=(0, eS.default)("mqttjs:tcp"),rS=(t,e)=>{e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost";let{port:r}=e,i=e.hostname;return tS("port %d and host %s",r,i),ZE.default.createConnection(r,i)};Mi.default=rS;});var yg={};Qt(yg,{default:()=>iS});var iS,bg=we(()=>{v();m();_();iS={};});var ll=M(Li=>{v();m();_();var al=Li&&Li.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Li,"__esModule",{value:!0});var nS=al((bg(),X(yg))),sS=al((sl(),X(nl))),oS=al(ot()),aS=(0, oS.default)("mqttjs:tls"),lS=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",sS.default.isIP(e.host)===0&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,aS("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=nS.default.connect(e);r.on("secureConnect",()=>{e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",i);});function i(n){e.rejectUnauthorized&&t.emit("error",n),r.end();}return r.on("error",i),r};Li.default=lS;});var os=M(oi=>{v();m();_();Object.defineProperty(oi,"__esModule",{value:!0});oi.BufferedDuplex=oi.writev=void 0;var uS=Dt(),wg=(ye(),X(_e));function _g(t,e){let r=new Array(t.length);for(let i=0;i<t.length;i++)typeof t[i].chunk=="string"?r[i]=wg.Buffer.from(t[i].chunk,"utf8"):r[i]=t[i].chunk;this._write(wg.Buffer.concat(r),"binary",e);}oi.writev=_g;var ul=class extends uS.Duplex{constructor(e,r,i){super({objectMode:!0}),this.proxy=r,this.socket=i,this.writeQueue=[],e.objectMode||(this._writev=_g.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",n=>{this.push(n);});}_read(e){this.proxy.read(e);}_write(e,r,i){this.isSocketOpen?this.writeToProxy(e,r,i):this.writeQueue.push({chunk:e,encoding:r,cb:i});}_final(e){this.writeQueue=[],this.proxy.end(e);}_destroy(e,r){this.writeQueue=[],this.proxy.destroy(),r(e);}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue();}writeToProxy(e,r,i){this.proxy.write(e,r)===!1?this.proxy.once("drain",i):i();}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:r,cb:i}=this.writeQueue.shift();this.writeToProxy(e,r,i);}}};oi.BufferedDuplex=ul;});var hl=M(cl=>{v();m();_();Object.defineProperty(cl,"__esModule",{value:!0});var mg=(ye(),X(_e)),fS=Dt(),cS=os(),gt,fl,Le;function hS(){let t=new fS.Transform;return t._write=(e,r,i)=>{gt.send({data:e.buffer,success(){i();},fail(n){i(new Error(n));}});},t._flush=e=>{gt.close({success(){e();}});},t}function dS(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={});}function pS(t,e){let r=t.protocol==="wxs"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function gS(){gt.onOpen(()=>{Le.socketReady();}),gt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=mg.Buffer.from(e):e=mg.Buffer.from(e,"utf8"),fl.push(e);}),gt.onClose(()=>{Le.emit("close"),Le.end(),Le.destroy();}),gt.onError(t=>{let e=new Error(t.errMsg);Le.destroy(e);});}var yS=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";dS(e);let i=pS(e,t);gt=wx.connectSocket({url:i,protocols:[r]}),fl=hS(),Le=new cS.BufferedDuplex(e,fl,gt),Le._destroy=(o,s)=>{gt.close({success(){s&&s(o);}});};let n=Le.destroy;return Le.destroy=(o,s)=>(Le.destroy=n,setTimeout(()=>{gt.close({fail(){Le._destroy(o,s);}});},0),Le),gS(),Le};cl.default=yS;});var gl=M(pl=>{v();m();_();Object.defineProperty(pl,"__esModule",{value:!0});var dl=(ye(),X(_e)),bS=Dt(),wS=os(),kt,as,ai,vg=!1;function _S(){let t=new bS.Transform;return t._write=(e,r,i)=>{kt.sendSocketMessage({data:e.buffer,success(){i();},fail(){i(new Error);}});},t._flush=e=>{kt.closeSocket({success(){e();}});},t}function mS(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={});}function vS(t,e){let r=t.protocol==="alis"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function ES(){vg||(vg=!0,kt.onSocketOpen(()=>{ai.socketReady();}),kt.onSocketMessage(t=>{if(typeof t.data=="string"){let e=dl.Buffer.from(t.data,"base64");as.push(e);}else {let e=new FileReader;e.addEventListener("load",()=>{let r=e.result;r instanceof ArrayBuffer?r=dl.Buffer.from(r):r=dl.Buffer.from(r,"utf8"),as.push(r);}),e.readAsArrayBuffer(t.data);}}),kt.onSocketClose(()=>{ai.end(),ai.destroy();}),kt.onSocketError(t=>{ai.destroy(t);}));}var SS=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";mS(e);let i=vS(e,t);return kt=e.my,kt.connectSocket({url:i,protocols:r}),as=_S(),ai=new wS.BufferedDuplex(e,as,kt),ES(),ai};pl.default=SS;});var Sg=M((PD,Eg)=>{v();m();_();Eg.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};});var _l=M(Ui=>{v();m();_();var wl=Ui&&Ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ui,"__esModule",{value:!0});var yl=(ye(),X(_e)),Ag=wl(Sg()),AS=wl(ot()),IS=Dt(),Ig=wl(Pi()),bl=os(),Kt=(0, AS.default)("mqttjs:ws"),TS=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function Tg(t,e){let r=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function Rg(t){let e=t;return t.hostname||(e.hostname="localhost"),t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!Ig.default&&t.protocol==="wss"&&TS.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r]);}),e}function RS(t){let e=Rg(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=Number(r.port));}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function CS(t,e,r){Kt("createWebSocket"),Kt(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";Kt(`creating new Websocket for url: ${e} and protocol: ${i}`);let n;return r.createWebsocket?n=r.createWebsocket(e,[i],r):n=new Ag.default(e,[i],r.wsOptions),n}function BS(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=Tg(e,t),n;return e.createWebsocket?n=e.createWebsocket(i,[r],e):n=new WebSocket(i,[r]),n.binaryType="arraybuffer",n}var PS=(t,e)=>{Kt("streamBuilder");let r=Rg(e),i=Tg(r,t),n=CS(t,i,r),o=Ag.default.createWebSocketStream(n,r.wsOptions);return o.url=i,n.on("close",()=>{o.destroy();}),o},OS=(t,e)=>{Kt("browserStreamBuilder");let r,n=RS(e).browserBufferSize||1024*512,o=e.browserBufferTimeout||1e3,s=!e.objectMode,a=BS(t,e),u=h(e,E,S);e.objectMode||(u._writev=bl.writev.bind(u)),u.on("close",()=>{a.close();});let c=typeof a.addEventListener<"u";a.readyState===a.OPEN?(r=u,r.socket=a):(r=new bl.BufferedDuplex(e,u,a),c?a.addEventListener("open",d):a.onopen=d),c?(a.addEventListener("close",g),a.addEventListener("error",y),a.addEventListener("message",w)):(a.onclose=g,a.onerror=y,a.onmessage=w);function h(I,C,R){let U=new IS.Transform({objectMode:I.objectMode});return U._write=C,U._flush=R,U}function d(){Kt("WebSocket onOpen"),r instanceof bl.BufferedDuplex&&r.socketReady();}function g(I){Kt("WebSocket onClose",I),r.end(),r.destroy();}function y(I){Kt("WebSocket onError",I);let C=new Error("WebSocket error");C.event=I,r.destroy(C);}function w(I){let{data:C}=I;C instanceof ArrayBuffer?C=yl.Buffer.from(C):C=yl.Buffer.from(C,"utf8"),u.push(C);}function E(I,C,R){if(a.bufferedAmount>n){setTimeout(E,o,I,C,R);return}s&&typeof I=="string"&&(I=yl.Buffer.from(I,"utf8"));try{a.send(I);}catch(U){return R(U)}R();}function S(I){a.close(),I();}return r};Ui.default=Ig.default?OS:PS;});var Pg=M(Rr=>{v();m();_();var ls=Rr&&Rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.connectAsync=void 0;var kS=ls(ot()),xS=ls((pg(),X(dg))),MS=ls(ns()),LS=ls(Pi()),Cg=(0, kS.default)("mqttjs"),Re={};LS.default?(Re.wx=hl().default,Re.wxs=hl().default,Re.ali=gl().default,Re.alis=gl().default):(Re.mqtt=ol().default,Re.tcp=ol().default,Re.ssl=ll().default,Re.tls=Re.ssl,Re.mqtts=ll().default);Re.ws=_l().default;Re.wss=_l().default;function US(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth);}function Bg(t,e){if(Cg("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let n=xS.default.parse(t,!0);if(n.port!=null&&(n.port=Number(n.port)),e=Object.assign(Object.assign({},n),e),e.protocol===null)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"");}if(US(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${e.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!Re[e.protocol]){let n=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((o,s)=>n&&s%2===0?!1:typeof Re[o]=="function")[0];}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(n){return e.servers&&((!n._reconnectCount||n._reconnectCount===e.servers.length)&&(n._reconnectCount=0),e.host=e.servers[n._reconnectCount].host,e.port=e.servers[n._reconnectCount].port,e.protocol=e.servers[n._reconnectCount].protocol?e.servers[n._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,n._reconnectCount++),Cg("calling streambuilder for",e.protocol),Re[e.protocol](n,e)}let i=new MS.default(r,e);return i.on("error",()=>{}),i}function NS(t,e,r=!0){return new Promise((i,n)=>{let o=Bg(t,e),s={connect:u=>{a(),i(o);},end:()=>{a(),i(o);},error:u=>{a(),o.end(),n(u);}};r===!1&&(s.close=()=>{s.error(new Error("Couldn't connect to server"));});function a(){Object.keys(s).forEach(u=>{o.off(u,s[u]);});}Object.keys(s).forEach(u=>{o.on(u,s[u]);});})}Rr.connectAsync=NS;Rr.default=Bg;});var ml=M(G=>{v();m();_();var Og=G&&G.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),qS=G&&G.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),DS=G&&G.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Og(e,t,r);return qS(e,t),e},kg=G&&G.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Og(e,t,r);},Ni=G&&G.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(G,"__esModule",{value:!0});G.ReasonCodes=G.PingTimer=G.UniqueMessageIdProvider=G.DefaultMessageIdProvider=G.Store=G.MqttClient=G.connectAsync=G.connect=G.Client=void 0;var xg=Ni(ns());G.MqttClient=xg.default;var jS=Ni(Yo());G.DefaultMessageIdProvider=jS.default;var FS=Ni($p());G.UniqueMessageIdProvider=FS.default;var WS=Ni(Zo());G.Store=WS.default;var Mg=DS(Pg());G.connect=Mg.default;Object.defineProperty(G,"connectAsync",{enumerable:!0,get:function(){return Mg.connectAsync}});var $S=Ni(Da());G.PingTimer=$S.default;G.Client=xg.default;kg(ns(),G);kg(Jr(),G);var HS=Ai();Object.defineProperty(G,"ReasonCodes",{enumerable:!0,get:function(){return HS.ReasonCodes}});});var QS=M(We=>{v();m();_();var Lg=We&&We.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n);}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r];}),VS=We&&We.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),zS=We&&We.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Lg(e,t,r);return VS(e,t),e},KS=We&&We.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lg(e,t,r);};Object.defineProperty(We,"__esModule",{value:!0});var GS=zS(ml());We.default=GS;KS(ml(),We);});var mqtt = QS();
|
|
3
|
+
var as=Object.defineProperty;var Yb=Object.getOwnPropertyDescriptor;var Jb=Object.getOwnPropertyNames;var Xb=Object.prototype.hasOwnProperty;var ze=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kr=(t,e)=>{for(var r in e)as(t,r,{get:e[r],enumerable:!0});},Zb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jb(e))!Xb.call(t,i)&&i!==r&&as(t,i,{get:()=>e[i],enumerable:!(n=Yb(e,i))||n.enumerable});return t};var me=t=>Zb(as({},"__esModule",{value:!0}),t);var A=ze(()=>{});var M={};Kr(M,{_debugEnd:()=>Kc,_debugProcess:()=>zc,_events:()=>ff,_eventsCount:()=>hf,_exiting:()=>Pc,_fatalExceptions:()=>$c,_getActiveHandles:()=>Cc,_getActiveRequests:()=>kc,_kill:()=>Mc,_linkedBinding:()=>xc,_maxListeners:()=>cf,_preload_modules:()=>af,_rawDebug:()=>Ac,_startProfilerIdleNotifier:()=>Qc,_stopProfilerIdleNotifier:()=>Yc,_tickCallback:()=>Gc,abort:()=>ef,addListener:()=>df,allowedNodeEnvironmentFlags:()=>jc,arch:()=>cc,argv:()=>dc,argv0:()=>sf,assert:()=>Fc,binding:()=>wc,browser:()=>Ec,chdir:()=>vc,config:()=>Oc,cpuUsage:()=>Ri,cwd:()=>_c,debugPort:()=>of,default:()=>Sf,dlopen:()=>Rc,domain:()=>Tc,emit:()=>wf,emitWarning:()=>bc,env:()=>hc,execArgv:()=>pc,execPath:()=>nf,exit:()=>Uc,features:()=>Wc,hasUncaughtExceptionCaptureCallback:()=>Vc,hrtime:()=>Oi,kill:()=>Lc,listeners:()=>vf,memoryUsage:()=>qc,moduleLoadList:()=>Ic,nextTick:()=>ac,off:()=>yf,on:()=>Nt,once:()=>pf,openStdin:()=>Dc,pid:()=>tf,platform:()=>fc,ppid:()=>rf,prependListener:()=>mf,prependOnceListener:()=>_f,reallyExit:()=>Bc,release:()=>Sc,removeAllListeners:()=>bf,removeListener:()=>gf,resourceUsage:()=>Nc,setSourceMapsEnabled:()=>uf,setUncaughtExceptionCaptureCallback:()=>Hc,stderr:()=>Xc,stdin:()=>Zc,stdout:()=>Jc,title:()=>lc,umask:()=>mc,uptime:()=>lf,version:()=>yc,versions:()=>gc});function cs(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function ew(){!Qr||!wr||(Qr=!1,wr.length?Mt=wr.concat(Mt):Pi=-1,Mt.length&&sc());}function sc(){if(!Qr){var t=setTimeout(ew,0);Qr=!0;for(var e=Mt.length;e;){for(wr=Mt,Mt=[];++Pi<e;)wr&&wr[Pi].run();Pi=-1,e=Mt.length;}wr=null,Qr=!1,clearTimeout(t);}}function ac(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Mt.push(new uc(t,e)),Mt.length===1&&!Qr&&setTimeout(sc,0);}function uc(t,e){this.fun=t,this.array=e;}function Ue(){}function xc(t){cs("_linkedBinding");}function Rc(t){cs("dlopen");}function kc(){return []}function Cc(){return []}function Fc(t,e){if(!t)throw new Error(e||"assertion error")}function Vc(){return !1}function lf(){return Jt.now()/1e3}function Oi(t){var e=Math.floor((Date.now()-Jt.now())*.001),r=Jt.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=ls)),[n,i]}function Nt(){return Sf}function vf(t){return []}var Mt,Qr,wr,Pi,lc,cc,fc,hc,dc,pc,yc,gc,bc,wc,mc,_c,vc,Sc,Ec,Ac,Ic,Tc,Pc,Oc,Bc,Mc,Ri,Nc,qc,Lc,Uc,Dc,jc,Wc,$c,Hc,Gc,zc,Kc,Qc,Yc,Jc,Xc,Zc,ef,tf,rf,nf,of,sf,af,uf,Jt,us,ls,cf,ff,hf,df,pf,yf,gf,bf,wf,mf,_f,Sf,Ef=ze(()=>{A();x();I();Mt=[],Qr=!1,Pi=-1;uc.prototype.run=function(){this.fun.apply(null,this.array);};lc="browser",cc="x64",fc="browser",hc={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},dc=["/usr/bin/node"],pc=[],yc="v16.8.0",gc={},bc=function(t,e){console.warn((e?e+": ":"")+t);},wc=function(t){cs("binding");},mc=function(t){return 0},_c=function(){return "/"},vc=function(t){},Sc={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Ec=!0,Ac=Ue,Ic=[];Tc={},Pc=!1,Oc={};Bc=Ue,Mc=Ue,Ri=function(){return {}},Nc=Ri,qc=Ri,Lc=Ue,Uc=Ue,Dc=Ue,jc={};Wc={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},$c=Ue,Hc=Ue;Gc=Ue,zc=Ue,Kc=Ue,Qc=Ue,Yc=Ue,Jc=void 0,Xc=void 0,Zc=void 0,ef=Ue,tf=2,rf=1,nf="/bin/usr/node",of=9229,sf="node",af=[],uf=Ue,Jt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Jt.now===void 0&&(us=Date.now(),Jt.timing&&Jt.timing.navigationStart&&(us=Jt.timing.navigationStart),Jt.now=()=>Date.now()-us);ls=1e9;Oi.bigint=function(t){var e=Oi(t);return typeof BigInt>"u"?e[0]*ls+e[1]:BigInt(e[0]*ls)+BigInt(e[1])};cf=10,ff={},hf=0;df=Nt,pf=Nt,yf=Nt,gf=Nt,bf=Nt,wf=Ue,mf=Nt,_f=Nt;Sf={version:yc,versions:gc,arch:cc,platform:fc,browser:Ec,release:Sc,_rawDebug:Ac,moduleLoadList:Ic,binding:wc,_linkedBinding:xc,_events:ff,_eventsCount:hf,_maxListeners:cf,on:Nt,addListener:df,once:pf,off:yf,removeListener:gf,removeAllListeners:bf,emit:wf,prependListener:mf,prependOnceListener:_f,listeners:vf,domain:Tc,_exiting:Pc,config:Oc,dlopen:Rc,uptime:lf,_getActiveRequests:kc,_getActiveHandles:Cc,reallyExit:Bc,_kill:Mc,cpuUsage:Ri,resourceUsage:Nc,memoryUsage:qc,kill:Lc,exit:Uc,openStdin:Dc,allowedNodeEnvironmentFlags:jc,assert:Fc,features:Wc,_fatalExceptions:$c,setUncaughtExceptionCaptureCallback:Hc,hasUncaughtExceptionCaptureCallback:Vc,emitWarning:bc,nextTick:ac,_tickCallback:Gc,_debugProcess:zc,_debugEnd:Kc,_startProfilerIdleNotifier:Qc,_stopProfilerIdleNotifier:Yc,stdout:Jc,stdin:Zc,stderr:Xc,abort:ef,umask:mc,chdir:vc,cwd:_c,env:hc,title:lc,argv:dc,execArgv:pc,pid:tf,ppid:rf,execPath:nf,debugPort:of,hrtime:Oi,argv0:sf,_preload_modules:af,setSourceMapsEnabled:uf};});var I=ze(()=>{Ef();});function tw(){if(Af)return On;Af=!0,On.byteLength=a,On.toByteArray=f,On.fromByteArray=w;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(y){var P=y.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=y.indexOf("=");E===-1&&(E=P);var b=E===P?0:4-E%4;return [E,b]}function a(y){var P=o(y),E=P[0],b=P[1];return (E+b)*3/4-b}function c(y,P,E){return (P+E)*3/4-E}function f(y){var P,E=o(y),b=E[0],m=E[1],v=new r(c(y,b,m)),R=0,T=m>0?b-4:b,g;for(g=0;g<T;g+=4)P=e[y.charCodeAt(g)]<<18|e[y.charCodeAt(g+1)]<<12|e[y.charCodeAt(g+2)]<<6|e[y.charCodeAt(g+3)],v[R++]=P>>16&255,v[R++]=P>>8&255,v[R++]=P&255;return m===2&&(P=e[y.charCodeAt(g)]<<2|e[y.charCodeAt(g+1)]>>4,v[R++]=P&255),m===1&&(P=e[y.charCodeAt(g)]<<10|e[y.charCodeAt(g+1)]<<4|e[y.charCodeAt(g+2)]>>2,v[R++]=P>>8&255,v[R++]=P&255),v}function h(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function d(y,P,E){for(var b,m=[],v=P;v<E;v+=3)b=(y[v]<<16&16711680)+(y[v+1]<<8&65280)+(y[v+2]&255),m.push(h(b));return m.join("")}function w(y){for(var P,E=y.length,b=E%3,m=[],v=16383,R=0,T=E-b;R<T;R+=v)m.push(d(y,R,R+v>T?T:R+v));return b===1?(P=y[E-1],m.push(t[P>>2]+t[P<<4&63]+"==")):b===2&&(P=(y[E-2]<<8)+y[E-1],m.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),m.join("")}return On}function rw(){if(If)return ki;If=!0;return ki.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,f=c>>1,h=-7,d=r?i-1:0,w=r?-1:1,y=t[e+d];for(d+=w,s=y&(1<<-h)-1,y>>=-h,h+=a;h>0;s=s*256+t[e+d],d+=w,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+t[e+d],d+=w,h-=8);if(s===0)s=1-f;else {if(s===c)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f;}return (y?-1:1)*o*Math.pow(2,s-n)},ki.write=function(t,e,r,n,i,s){var o,a,c,f=s*8-i-1,h=(1<<f)-1,d=h>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,P=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=w/c:e+=w*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=h?(a=0,o=h):o+d>=1?(a=(e*c-1)*Math.pow(2,i),o=o+d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=a&255,y+=P,a/=256,i-=8);for(o=o<<i|a,f+=i;f>0;t[r+y]=o&255,y+=P,o/=256,f-=8);t[r+y-P]|=E*128;},ki}function Tf(){if(xf)return mr;xf=!0;let t=tw(),e=rw(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;mr.Buffer=o,mr.SlowBuffer=m,mr.INSPECT_MAX_BYTES=50;let n=2147483647;mr.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.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 i(){try{let p=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(p,u),p.foo()===42}catch{return !1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(p){if(p>n)throw new RangeError('The value "'+p+'" is invalid for option "size"');let u=new Uint8Array(p);return Object.setPrototypeOf(u,o.prototype),u}function o(p,u,l){if(typeof p=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(p)}return a(p,u,l)}o.poolSize=8192;function a(p,u,l){if(typeof p=="string")return d(p,u);if(ArrayBuffer.isView(p))return y(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(Ze(p,ArrayBuffer)||p&&Ze(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(p,SharedArrayBuffer)||p&&Ze(p.buffer,SharedArrayBuffer)))return P(p,u,l);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let S=p.valueOf&&p.valueOf();if(S!=null&&S!==p)return o.from(S,u,l);let C=E(p);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return o.from(p[Symbol.toPrimitive]("string"),u,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}o.from=function(p,u,l){return a(p,u,l)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function f(p,u,l){return c(p),p<=0?s(p):u!==void 0?typeof l=="string"?s(p).fill(u,l):s(p).fill(u):s(p)}o.alloc=function(p,u,l){return f(p,u,l)};function h(p){return c(p),s(p<0?0:b(p)|0)}o.allocUnsafe=function(p){return h(p)},o.allocUnsafeSlow=function(p){return h(p)};function d(p,u){if((typeof u!="string"||u==="")&&(u="utf8"),!o.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let l=v(p,u)|0,S=s(l),C=S.write(p,u);return C!==l&&(S=S.slice(0,C)),S}function w(p){let u=p.length<0?0:b(p.length)|0,l=s(u);for(let S=0;S<u;S+=1)l[S]=p[S]&255;return l}function y(p){if(Ze(p,Uint8Array)){let u=new Uint8Array(p);return P(u.buffer,u.byteOffset,u.byteLength)}return w(p)}function P(p,u,l){if(u<0||p.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<u+(l||0))throw new RangeError('"length" is outside of buffer bounds');let S;return u===void 0&&l===void 0?S=new Uint8Array(p):l===void 0?S=new Uint8Array(p,u):S=new Uint8Array(p,u,l),Object.setPrototypeOf(S,o.prototype),S}function E(p){if(o.isBuffer(p)){let u=b(p.length)|0,l=s(u);return l.length===0||p.copy(l,0,0,u),l}if(p.length!==void 0)return typeof p.length!="number"||Tn(p.length)?s(0):w(p);if(p.type==="Buffer"&&Array.isArray(p.data))return w(p.data)}function b(p){if(p>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return p|0}function m(p){return +p!=p&&(p=0),o.alloc(+p)}o.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==o.prototype},o.compare=function(u,l){if(Ze(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),Ze(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(u)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===l)return 0;let S=u.length,C=l.length;for(let N=0,F=Math.min(S,C);N<F;++N)if(u[N]!==l[N]){S=u[N],C=l[N];break}return S<C?-1:C<S?1:0},o.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}},o.concat=function(u,l){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return o.alloc(0);let S;if(l===void 0)for(l=0,S=0;S<u.length;++S)l+=u[S].length;let C=o.allocUnsafe(l),N=0;for(S=0;S<u.length;++S){let F=u[S];if(Ze(F,Uint8Array))N+F.length>C.length?(o.isBuffer(F)||(F=o.from(F)),F.copy(C,N)):Uint8Array.prototype.set.call(C,F,N);else if(o.isBuffer(F))F.copy(C,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=F.length;}return C};function v(p,u){if(o.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Ze(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let l=p.length,S=arguments.length>2&&arguments[2]===!0;if(!S&&l===0)return 0;let C=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return Ct(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return Ii(p).length;default:if(C)return S?-1:Ct(p).length;u=(""+u).toLowerCase(),C=!0;}}o.byteLength=v;function R(p,u,l){let S=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,u>>>=0,l<=u))return "";for(p||(p="utf8");;)switch(p){case"hex":return V(this,u,l);case"utf8":case"utf-8":return H(this,u,l);case"ascii":return X(this,u,l);case"latin1":case"binary":return Q(this,u,l);case"base64":return W(this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,u,l);default:if(S)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),S=!0;}}o.prototype._isBuffer=!0;function T(p,u,l){let S=p[u];p[u]=p[l],p[l]=S;}o.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 l=0;l<u;l+=2)T(this,l,l+1);return this},o.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 l=0;l<u;l+=4)T(this,l,l+3),T(this,l+1,l+2);return this},o.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 l=0;l<u;l+=8)T(this,l,l+7),T(this,l+1,l+6),T(this,l+2,l+5),T(this,l+3,l+4);return this},o.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?H(this,0,u):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(u){if(!o.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:o.compare(this,u)===0},o.prototype.inspect=function(){let u="",l=mr.INSPECT_MAX_BYTES;return u=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(u+=" ... "),"<Buffer "+u+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(u,l,S,C,N){if(Ze(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),!o.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(l===void 0&&(l=0),S===void 0&&(S=u?u.length:0),C===void 0&&(C=0),N===void 0&&(N=this.length),l<0||S>u.length||C<0||N>this.length)throw new RangeError("out of range index");if(C>=N&&l>=S)return 0;if(C>=N)return -1;if(l>=S)return 1;if(l>>>=0,S>>>=0,C>>>=0,N>>>=0,this===u)return 0;let F=N-C,k=S-l,B=Math.min(F,k),re=this.slice(C,N),ie=u.slice(l,S);for(let oe=0;oe<B;++oe)if(re[oe]!==ie[oe]){F=re[oe],k=ie[oe];break}return F<k?-1:k<F?1:0};function g(p,u,l,S,C){if(p.length===0)return -1;if(typeof l=="string"?(S=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,Tn(l)&&(l=C?0:p.length-1),l<0&&(l=p.length+l),l>=p.length){if(C)return -1;l=p.length-1;}else if(l<0)if(C)l=0;else return -1;if(typeof u=="string"&&(u=o.from(u,S)),o.isBuffer(u))return u.length===0?-1:O(p,u,l,S,C);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(p,u,l):Uint8Array.prototype.lastIndexOf.call(p,u,l):O(p,[u],l,S,C);throw new TypeError("val must be string, number or Buffer")}function O(p,u,l,S,C){let N=1,F=p.length,k=u.length;if(S!==void 0&&(S=String(S).toLowerCase(),S==="ucs2"||S==="ucs-2"||S==="utf16le"||S==="utf-16le")){if(p.length<2||u.length<2)return -1;N=2,F/=2,k/=2,l/=2;}function B(ie,oe){return N===1?ie[oe]:ie.readUInt16BE(oe*N)}let re;if(C){let ie=-1;for(re=l;re<F;re++)if(B(p,re)===B(u,ie===-1?0:re-ie)){if(ie===-1&&(ie=re),re-ie+1===k)return ie*N}else ie!==-1&&(re-=re-ie),ie=-1;}else for(l+k>F&&(l=F-k),re=l;re>=0;re--){let ie=!0;for(let oe=0;oe<k;oe++)if(B(p,re+oe)!==B(u,oe)){ie=!1;break}if(ie)return re}return -1}o.prototype.includes=function(u,l,S){return this.indexOf(u,l,S)!==-1},o.prototype.indexOf=function(u,l,S){return g(this,u,l,S,!0)},o.prototype.lastIndexOf=function(u,l,S){return g(this,u,l,S,!1)};function _(p,u,l,S){l=Number(l)||0;let C=p.length-l;S?(S=Number(S),S>C&&(S=C)):S=C;let N=u.length;S>N/2&&(S=N/2);let F;for(F=0;F<S;++F){let k=parseInt(u.substr(F*2,2),16);if(Tn(k))return F;p[l+F]=k;}return F}function q(p,u,l,S){return Vr(Ct(u,p.length-l),p,l,S)}function $(p,u,l,S){return Vr(Bt(u),p,l,S)}function j(p,u,l,S){return Vr(Ii(u),p,l,S)}function J(p,u,l,S){return Vr(xn(u,p.length-l),p,l,S)}o.prototype.write=function(u,l,S,C){if(l===void 0)C="utf8",S=this.length,l=0;else if(S===void 0&&typeof l=="string")C=l,S=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(S)?(S=S>>>0,C===void 0&&(C="utf8")):(C=S,S=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-l;if((S===void 0||S>N)&&(S=N),u.length>0&&(S<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let F=!1;for(;;)switch(C){case"hex":return _(this,u,l,S);case"utf8":case"utf-8":return q(this,u,l,S);case"ascii":case"latin1":case"binary":return $(this,u,l,S);case"base64":return j(this,u,l,S);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,u,l,S);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),F=!0;}},o.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(p,u,l){return u===0&&l===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(u,l))}function H(p,u,l){l=Math.min(p.length,l);let S=[],C=u;for(;C<l;){let N=p[C],F=null,k=N>239?4:N>223?3:N>191?2:1;if(C+k<=l){let B,re,ie,oe;switch(k){case 1:N<128&&(F=N);break;case 2:B=p[C+1],(B&192)===128&&(oe=(N&31)<<6|B&63,oe>127&&(F=oe));break;case 3:B=p[C+1],re=p[C+2],(B&192)===128&&(re&192)===128&&(oe=(N&15)<<12|(B&63)<<6|re&63,oe>2047&&(oe<55296||oe>57343)&&(F=oe));break;case 4:B=p[C+1],re=p[C+2],ie=p[C+3],(B&192)===128&&(re&192)===128&&(ie&192)===128&&(oe=(N&15)<<18|(B&63)<<12|(re&63)<<6|ie&63,oe>65535&&oe<1114112&&(F=oe));}}F===null?(F=65533,k=1):F>65535&&(F-=65536,S.push(F>>>10&1023|55296),F=56320|F&1023),S.push(F),C+=k;}return K(S)}let G=4096;function K(p){let u=p.length;if(u<=G)return String.fromCharCode.apply(String,p);let l="",S=0;for(;S<u;)l+=String.fromCharCode.apply(String,p.slice(S,S+=G));return l}function X(p,u,l){let S="";l=Math.min(p.length,l);for(let C=u;C<l;++C)S+=String.fromCharCode(p[C]&127);return S}function Q(p,u,l){let S="";l=Math.min(p.length,l);for(let C=u;C<l;++C)S+=String.fromCharCode(p[C]);return S}function V(p,u,l){let S=p.length;(!u||u<0)&&(u=0),(!l||l<0||l>S)&&(l=S);let C="";for(let N=u;N<l;++N)C+=Xo[p[N]];return C}function te(p,u,l){let S=p.slice(u,l),C="";for(let N=0;N<S.length-1;N+=2)C+=String.fromCharCode(S[N]+S[N+1]*256);return C}o.prototype.slice=function(u,l){let S=this.length;u=~~u,l=l===void 0?S:~~l,u<0?(u+=S,u<0&&(u=0)):u>S&&(u=S),l<0?(l+=S,l<0&&(l=0)):l>S&&(l=S),l<u&&(l=u);let C=this.subarray(u,l);return Object.setPrototypeOf(C,o.prototype),C};function Y(p,u,l){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+u>l)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(u,l,S){u=u>>>0,l=l>>>0,S||Y(u,l,this.length);let C=this[u],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[u+F]*N;return C},o.prototype.readUintBE=o.prototype.readUIntBE=function(u,l,S){u=u>>>0,l=l>>>0,S||Y(u,l,this.length);let C=this[u+--l],N=1;for(;l>0&&(N*=256);)C+=this[u+--l]*N;return C},o.prototype.readUint8=o.prototype.readUInt8=function(u,l){return u=u>>>0,l||Y(u,1,this.length),this[u]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(u,l){return u=u>>>0,l||Y(u,2,this.length),this[u]|this[u+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(u,l){return u=u>>>0,l||Y(u,2,this.length),this[u]<<8|this[u+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},o.prototype.readBigUInt64LE=at(function(u){u=u>>>0,xe(u,"offset");let l=this[u],S=this[u+7];(l===void 0||S===void 0)&&st(u,this.length-8);let C=l+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,N=this[++u]+this[++u]*2**8+this[++u]*2**16+S*2**24;return BigInt(C)+(BigInt(N)<<BigInt(32))}),o.prototype.readBigUInt64BE=at(function(u){u=u>>>0,xe(u,"offset");let l=this[u],S=this[u+7];(l===void 0||S===void 0)&&st(u,this.length-8);let C=l*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+S;return (BigInt(C)<<BigInt(32))+BigInt(N)}),o.prototype.readIntLE=function(u,l,S){u=u>>>0,l=l>>>0,S||Y(u,l,this.length);let C=this[u],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[u+F]*N;return N*=128,C>=N&&(C-=Math.pow(2,8*l)),C},o.prototype.readIntBE=function(u,l,S){u=u>>>0,l=l>>>0,S||Y(u,l,this.length);let C=l,N=1,F=this[u+--C];for(;C>0&&(N*=256);)F+=this[u+--C]*N;return N*=128,F>=N&&(F-=Math.pow(2,8*l)),F},o.prototype.readInt8=function(u,l){return u=u>>>0,l||Y(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},o.prototype.readInt16LE=function(u,l){u=u>>>0,l||Y(u,2,this.length);let S=this[u]|this[u+1]<<8;return S&32768?S|4294901760:S},o.prototype.readInt16BE=function(u,l){u=u>>>0,l||Y(u,2,this.length);let S=this[u+1]|this[u]<<8;return S&32768?S|4294901760:S},o.prototype.readInt32LE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},o.prototype.readInt32BE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},o.prototype.readBigInt64LE=at(function(u){u=u>>>0,xe(u,"offset");let l=this[u],S=this[u+7];(l===void 0||S===void 0)&&st(u,this.length-8);let C=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(S<<24);return (BigInt(C)<<BigInt(32))+BigInt(l+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),o.prototype.readBigInt64BE=at(function(u){u=u>>>0,xe(u,"offset");let l=this[u],S=this[u+7];(l===void 0||S===void 0)&&st(u,this.length-8);let C=(l<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return (BigInt(C)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+S)}),o.prototype.readFloatLE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),e.read(this,u,!0,23,4)},o.prototype.readFloatBE=function(u,l){return u=u>>>0,l||Y(u,4,this.length),e.read(this,u,!1,23,4)},o.prototype.readDoubleLE=function(u,l){return u=u>>>0,l||Y(u,8,this.length),e.read(this,u,!0,52,8)},o.prototype.readDoubleBE=function(u,l){return u=u>>>0,l||Y(u,8,this.length),e.read(this,u,!1,52,8)};function ee(p,u,l,S,C,N){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>C||u<N)throw new RangeError('"value" argument is out of bounds');if(l+S>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(u,l,S,C){if(u=+u,l=l>>>0,S=S>>>0,!C){let k=Math.pow(2,8*S)-1;ee(this,u,l,S,k,0);}let N=1,F=0;for(this[l]=u&255;++F<S&&(N*=256);)this[l+F]=u/N&255;return l+S},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(u,l,S,C){if(u=+u,l=l>>>0,S=S>>>0,!C){let k=Math.pow(2,8*S)-1;ee(this,u,l,S,k,0);}let N=S-1,F=1;for(this[l+N]=u&255;--N>=0&&(F*=256);)this[l+N]=u/F&255;return l+S},o.prototype.writeUint8=o.prototype.writeUInt8=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,1,255,0),this[l]=u&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,2,65535,0),this[l]=u&255,this[l+1]=u>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,2,65535,0),this[l]=u>>>8,this[l+1]=u&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,4,4294967295,0),this[l+3]=u>>>24,this[l+2]=u>>>16,this[l+1]=u>>>8,this[l]=u&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,4,4294967295,0),this[l]=u>>>24,this[l+1]=u>>>16,this[l+2]=u>>>8,this[l+3]=u&255,l+4};function pe(p,u,l,S,C){Oe(u,S,C,p,l,7);let N=Number(u&BigInt(4294967295));p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N;let F=Number(u>>BigInt(32)&BigInt(4294967295));return p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,l}function Z(p,u,l,S,C){Oe(u,S,C,p,l,7);let N=Number(u&BigInt(4294967295));p[l+7]=N,N=N>>8,p[l+6]=N,N=N>>8,p[l+5]=N,N=N>>8,p[l+4]=N;let F=Number(u>>BigInt(32)&BigInt(4294967295));return p[l+3]=F,F=F>>8,p[l+2]=F,F=F>>8,p[l+1]=F,F=F>>8,p[l]=F,l+8}o.prototype.writeBigUInt64LE=at(function(u,l=0){return pe(this,u,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=at(function(u,l=0){return Z(this,u,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(u,l,S,C){if(u=+u,l=l>>>0,!C){let B=Math.pow(2,8*S-1);ee(this,u,l,S,B-1,-B);}let N=0,F=1,k=0;for(this[l]=u&255;++N<S&&(F*=256);)u<0&&k===0&&this[l+N-1]!==0&&(k=1),this[l+N]=(u/F>>0)-k&255;return l+S},o.prototype.writeIntBE=function(u,l,S,C){if(u=+u,l=l>>>0,!C){let B=Math.pow(2,8*S-1);ee(this,u,l,S,B-1,-B);}let N=S-1,F=1,k=0;for(this[l+N]=u&255;--N>=0&&(F*=256);)u<0&&k===0&&this[l+N+1]!==0&&(k=1),this[l+N]=(u/F>>0)-k&255;return l+S},o.prototype.writeInt8=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,1,127,-128),u<0&&(u=255+u+1),this[l]=u&255,l+1},o.prototype.writeInt16LE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,2,32767,-32768),this[l]=u&255,this[l+1]=u>>>8,l+2},o.prototype.writeInt16BE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,2,32767,-32768),this[l]=u>>>8,this[l+1]=u&255,l+2},o.prototype.writeInt32LE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,4,2147483647,-2147483648),this[l]=u&255,this[l+1]=u>>>8,this[l+2]=u>>>16,this[l+3]=u>>>24,l+4},o.prototype.writeInt32BE=function(u,l,S){return u=+u,l=l>>>0,S||ee(this,u,l,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[l]=u>>>24,this[l+1]=u>>>16,this[l+2]=u>>>8,this[l+3]=u&255,l+4},o.prototype.writeBigInt64LE=at(function(u,l=0){return pe(this,u,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=at(function(u,l=0){return Z(this,u,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(p,u,l,S,C,N){if(l+S>p.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function fe(p,u,l,S,C){return u=+u,l=l>>>0,C||ne(p,u,l,4),e.write(p,u,l,S,23,4),l+4}o.prototype.writeFloatLE=function(u,l,S){return fe(this,u,l,!0,S)},o.prototype.writeFloatBE=function(u,l,S){return fe(this,u,l,!1,S)};function be(p,u,l,S,C){return u=+u,l=l>>>0,C||ne(p,u,l,8),e.write(p,u,l,S,52,8),l+8}o.prototype.writeDoubleLE=function(u,l,S){return be(this,u,l,!0,S)},o.prototype.writeDoubleBE=function(u,l,S){return be(this,u,l,!1,S)},o.prototype.copy=function(u,l,S,C){if(!o.isBuffer(u))throw new TypeError("argument should be a Buffer");if(S||(S=0),!C&&C!==0&&(C=this.length),l>=u.length&&(l=u.length),l||(l=0),C>0&&C<S&&(C=S),C===S||u.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(S<0||S>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),u.length-l<C-S&&(C=u.length-l+S);let N=C-S;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,S,C):Uint8Array.prototype.set.call(u,this.subarray(S,C),l),N},o.prototype.fill=function(u,l,S,C){if(typeof u=="string"){if(typeof l=="string"?(C=l,l=0,S=this.length):typeof S=="string"&&(C=S,S=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!o.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(u.length===1){let F=u.charCodeAt(0);(C==="utf8"&&F<128||C==="latin1")&&(u=F);}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(l<0||this.length<l||this.length<S)throw new RangeError("Out of range index");if(S<=l)return this;l=l>>>0,S=S===void 0?this.length:S>>>0,u||(u=0);let N;if(typeof u=="number")for(N=l;N<S;++N)this[N]=u;else {let F=o.isBuffer(u)?u:o.from(u,C),k=F.length;if(k===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(N=0;N<S-l;++N)this[N+l]=F[N%k];}return this};let ye={};function Ae(p,u,l){ye[p]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name;}get code(){return p}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0});}toString(){return `${this.name} [${p}]: ${this.message}`}};}Ae("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ae("ERR_INVALID_ARG_TYPE",function(p,u){return `The "${p}" argument must be of type number. Received type ${typeof u}`},TypeError),Ae("ERR_OUT_OF_RANGE",function(p,u,l){let S=`The value of "${p}" is out of range.`,C=l;return Number.isInteger(l)&&Math.abs(l)>2**32?C=_e(String(l)):typeof l=="bigint"&&(C=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(C=_e(C)),C+="n"),S+=` It must be ${u}. Received ${C}`,S},RangeError);function _e(p){let u="",l=p.length,S=p[0]==="-"?1:0;for(;l>=S+4;l-=3)u=`_${p.slice(l-3,l)}${u}`;return `${p.slice(0,l)}${u}`}function ve(p,u,l){xe(u,"offset"),(p[u]===void 0||p[u+l]===void 0)&&st(u,p.length-(l+1));}function Oe(p,u,l,S,C,N){if(p>l||p<u){let F=typeof u=="bigint"?"n":"",k;throw u===0||u===BigInt(0)?k=`>= 0${F} and < 2${F} ** ${(N+1)*8}${F}`:k=`>= -(2${F} ** ${(N+1)*8-1}${F}) and < 2 ** ${(N+1)*8-1}${F}`,new ye.ERR_OUT_OF_RANGE("value",k,p)}ve(S,C,N);}function xe(p,u){if(typeof p!="number")throw new ye.ERR_INVALID_ARG_TYPE(u,"number",p)}function st(p,u,l){throw Math.floor(p)!==p?(xe(p,l),new ye.ERR_OUT_OF_RANGE("offset","an integer",p)):u<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,p)}let Re=/[^+/0-9A-Za-z-_]/g;function Ne(p){if(p=p.split("=")[0],p=p.trim().replace(Re,""),p.length<2)return "";for(;p.length%4!==0;)p=p+"=";return p}function Ct(p,u){u=u||1/0;let l,S=p.length,C=null,N=[];for(let F=0;F<S;++F){if(l=p.charCodeAt(F),l>55295&&l<57344){if(!C){if(l>56319){(u-=3)>-1&&N.push(239,191,189);continue}else if(F+1===S){(u-=3)>-1&&N.push(239,191,189);continue}C=l;continue}if(l<56320){(u-=3)>-1&&N.push(239,191,189),C=l;continue}l=(C-55296<<10|l-56320)+65536;}else C&&(u-=3)>-1&&N.push(239,191,189);if(C=null,l<128){if((u-=1)<0)break;N.push(l);}else if(l<2048){if((u-=2)<0)break;N.push(l>>6|192,l&63|128);}else if(l<65536){if((u-=3)<0)break;N.push(l>>12|224,l>>6&63|128,l&63|128);}else if(l<1114112){if((u-=4)<0)break;N.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128);}else throw new Error("Invalid code point")}return N}function Bt(p){let u=[];for(let l=0;l<p.length;++l)u.push(p.charCodeAt(l)&255);return u}function xn(p,u){let l,S,C,N=[];for(let F=0;F<p.length&&!((u-=2)<0);++F)l=p.charCodeAt(F),S=l>>8,C=l%256,N.push(C),N.push(S);return N}function Ii(p){return t.toByteArray(Ne(p))}function Vr(p,u,l,S){let C;for(C=0;C<S&&!(C+l>=u.length||C>=p.length);++C)u[C+l]=p[C];return C}function Ze(p,u){return p instanceof u||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===u.name}function Tn(p){return p!==p}let Xo=function(){let p="0123456789abcdef",u=new Array(256);for(let l=0;l<16;++l){let S=l*16;for(let C=0;C<16;++C)u[S+C]=p[l]+p[C];}return u}();function at(p){return typeof BigInt>"u"?Zo:p}function Zo(){throw new Error("BigInt not supported")}return mr}var On,Af,ki,If,mr,xf,Pf=ze(()=>{A();x();I();On={},Af=!1;ki={},If=!1;mr={},xf=!1;});var qe={};Kr(qe,{Buffer:()=>U,INSPECT_MAX_BYTES:()=>nw,default:()=>Xt,kMaxLength:()=>iw});var Xt,U,nw,iw,ke=ze(()=>{A();x();I();Pf();Xt=Tf();Xt.Buffer;Xt.SlowBuffer;Xt.INSPECT_MAX_BYTES;Xt.kMaxLength;U=Xt.Buffer,nw=Xt.INSPECT_MAX_BYTES,iw=Xt.kMaxLength;});var x=ze(()=>{ke();});var Ee=D((MP,Of)=>{A();x();I();var fs=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
|
|
4
|
+
`;super(r),this.name="AggregateError",this.errors=e;}};Of.exports={AggregateError:fs,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array};});var hs=D((HP,Rf)=>{A();x();I();Rf.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return `\`${t}\``}else return `"${t}"`;return `'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return `${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return "{}"}}};});var De=D((eO,Bf)=>{A();x();I();var{format:ow,inspect:Ci}=hs(),{AggregateError:sw}=Ee(),aw=globalThis.AggregateError||sw,uw=Symbol("kIsNodeError"),lw=["string","function","number","object","Function","Object","boolean","bigint","symbol"],cw=/^([A-Z][a-z0-9]*)+$/,fw="__node_internal_",Bi={};function _r(t,e){if(!t)throw new Bi.ERR_INTERNAL_ASSERTION(e)}function kf(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function hw(t,e,r){if(typeof e=="function")return _r(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return _r(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:ow(e,...r)}function Le(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(hw(t,e,s));}toString(){return `${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return `${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[uw]=!0,Bi[t]=n;}function Cf(t){let e=fw+t.name;return Object.defineProperty(t,"name",{value:e}),t}function dw(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new aw([e,t],e.message);return r.code=e.code,r}return t||e}var ds=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Bi.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError";}};Le("ERR_ASSERTION","%s",Error);Le("ERR_INVALID_ARG_TYPE",(t,e,r)=>{_r(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let c of e)_r(typeof c=="string","All expected entries have to be of type string"),lw.includes(c)?i.push(c.toLowerCase()):cw.test(c)?s.push(c):(_r(c!=="object",'The value "object" should be written as "Object"'),o.push(c));if(s.length>0){let c=i.indexOf("object");c!==-1&&(i.splice(i,c,1),s.push("Object"));}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let c=i.pop();n+=`one of type ${i.join(", ")}, or ${c}`;}}(s.length>0||o.length>0)&&(n+=" or ");}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();n+=`an instance of ${s.join(", ")}, or ${c}`;}}o.length>0&&(n+=" or ");}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`one of ${o.join(", ")}, or ${c}`;}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else {let c=Ci(r,{depth:-1});n+=`. Received ${c}`;}}else {let c=Ci(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof r} (${c})`;}return n},TypeError);Le("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=Ci(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);Le("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return `Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);Le("ERR_MISSING_ARGS",(...t)=>{_r(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`;}break}return `${e} must be specified`},TypeError);Le("ERR_OUT_OF_RANGE",(t,e,r)=>{_r(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=kf(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=kf(n)),n+="n";}else n=Ci(r);return `The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Le("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Le("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Le("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Le("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Le("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Le("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Le("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Le("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Le("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Le("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Le("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Bf.exports={AbortError:ds,aggregateTwoErrors:Cf(dw),hideStackFrames:Cf,codes:Bi};});var Yr=D((cO,Mi)=>{A();x();I();var{AbortController:Mf,AbortSignal:pw}=typeof self<"u"?self:typeof window<"u"?window:void 0;Mi.exports=Mf;Mi.exports.AbortSignal=pw;Mi.exports.default=Mf;});var Zt={};Kr(Zt,{EventEmitter:()=>gw,default:()=>Rn,defaultMaxListeners:()=>bw,init:()=>ww,listenerCount:()=>mw,on:()=>_w,once:()=>vw});function yw(){if(Nf)return Ni;Nf=!0;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(g,O,_){return Function.prototype.apply.call(g,O,_)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:r=function(g){return Object.getOwnPropertyNames(g)};function n(T){console&&console.warn&&console.warn(T);}var i=Number.isNaN||function(g){return g!==g};function s(){s.init.call(this);}Ni=s,Ni.once=m,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(T){if(typeof T!="number"||T<0||i(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");o=T;}}),s.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;},s.prototype.setMaxListeners=function(g){if(typeof g!="number"||g<0||i(g))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+g+".");return this._maxListeners=g,this};function c(T){return T._maxListeners===void 0?s.defaultMaxListeners:T._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(g){for(var O=[],_=1;_<arguments.length;_++)O.push(arguments[_]);var q=g==="error",$=this._events;if($!==void 0)q=q&&$.error===void 0;else if(!q)return !1;if(q){var j;if(O.length>0&&(j=O[0]),j instanceof Error)throw j;var J=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw J.context=j,J}var W=$[g];if(W===void 0)return !1;if(typeof W=="function")e(W,this,O);else for(var H=W.length,G=P(W,H),_=0;_<H;++_)e(G[_],this,O);return !0};function f(T,g,O,_){var q,$,j;if(a(O),$=T._events,$===void 0?($=T._events=Object.create(null),T._eventsCount=0):($.newListener!==void 0&&(T.emit("newListener",g,O.listener?O.listener:O),$=T._events),j=$[g]),j===void 0)j=$[g]=O,++T._eventsCount;else if(typeof j=="function"?j=$[g]=_?[O,j]:[j,O]:_?j.unshift(O):j.push(O),q=c(T),q>0&&j.length>q&&!j.warned){j.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=T,J.type=g,J.count=j.length,n(J);}return T}s.prototype.addListener=function(g,O){return f(this,g,O,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(g,O){return f(this,g,O,!0)};function h(){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 d(T,g,O){var _={fired:!1,wrapFn:void 0,target:T,type:g,listener:O},q=h.bind(_);return q.listener=O,_.wrapFn=q,q}s.prototype.once=function(g,O){return a(O),this.on(g,d(this,g,O)),this},s.prototype.prependOnceListener=function(g,O){return a(O),this.prependListener(g,d(this,g,O)),this},s.prototype.removeListener=function(g,O){var _,q,$,j,J;if(a(O),q=this._events,q===void 0)return this;if(_=q[g],_===void 0)return this;if(_===O||_.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete q[g],q.removeListener&&this.emit("removeListener",g,_.listener||O));else if(typeof _!="function"){for($=-1,j=_.length-1;j>=0;j--)if(_[j]===O||_[j].listener===O){J=_[j].listener,$=j;break}if($<0)return this;$===0?_.shift():E(_,$),_.length===1&&(q[g]=_[0]),q.removeListener!==void 0&&this.emit("removeListener",g,J||O);}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(g){var O,_,q;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[g]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[g]),this;if(arguments.length===0){var $=Object.keys(_),j;for(q=0;q<$.length;++q)j=$[q],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=_[g],typeof O=="function")this.removeListener(g,O);else if(O!==void 0)for(q=O.length-1;q>=0;q--)this.removeListener(g,O[q]);return this};function w(T,g,O){var _=T._events;if(_===void 0)return [];var q=_[g];return q===void 0?[]:typeof q=="function"?O?[q.listener||q]:[q]:O?b(q):P(q,q.length)}s.prototype.listeners=function(g){return w(this,g,!0)},s.prototype.rawListeners=function(g){return w(this,g,!1)},s.listenerCount=function(T,g){return typeof T.listenerCount=="function"?T.listenerCount(g):y.call(T,g)},s.prototype.listenerCount=y;function y(T){var g=this._events;if(g!==void 0){var O=g[T];if(typeof O=="function")return 1;if(O!==void 0)return O.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function P(T,g){for(var O=new Array(g),_=0;_<g;++_)O[_]=T[_];return O}function E(T,g){for(;g+1<T.length;g++)T[g]=T[g+1];T.pop();}function b(T){for(var g=new Array(T.length),O=0;O<g.length;++O)g[O]=T[O].listener||T[O];return g}function m(T,g){return new Promise(function(O,_){function q(j){T.removeListener(g,$),_(j);}function $(){typeof T.removeListener=="function"&&T.removeListener("error",q),O([].slice.call(arguments));}R(T,g,$,{once:!0}),g!=="error"&&v(T,q,{once:!0});})}function v(T,g,O){typeof T.on=="function"&&R(T,"error",g,O);}function R(T,g,O,_){if(typeof T.on=="function")_.once?T.once(g,O):T.on(g,O);else if(typeof T.addEventListener=="function")T.addEventListener(g,function q($){_.once&&T.removeEventListener(g,q),O($);});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return Ni}var Ni,Nf,Rn,gw,bw,ww,mw,_w,vw,er=ze(()=>{A();x();I();Ni={},Nf=!1;Rn=yw();Rn.once;Rn.once=function(t,e){return new Promise((r,n)=>{function i(...o){s!==void 0&&t.removeListener("error",s),r(o);}let s;e!=="error"&&(s=o=>{t.removeListener(name,i),n(o);},t.once("error",s)),t.once(e,i);})};Rn.on=function(t,e){let r=[],n=[],i=null,s=!1,o={async next(){let f=r.shift();if(f)return createIterResult(f,!1);if(i){let h=Promise.reject(i);return i=null,h}return s?createIterResult(void 0,!0):new Promise((h,d)=>n.push({resolve:h,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",c),s=!0;for(let f of n)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){i=f,t.removeListener(e,a),t.removeListener("error",c);},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",c),o;function a(...f){let h=n.shift();h?h.resolve(createIterResult(f,!1)):r.push(f);}function c(f){s=!0;let h=n.shift();h?h.reject(f):i=f,o.return();}};({EventEmitter:gw,defaultMaxListeners:bw,init:ww,listenerCount:mw,on:_w,once:vw}=Rn);});var $e=D((OO,ys)=>{A();x();I();var Sw=(ke(),me(qe)),{format:Ew,inspect:Aw}=hs(),{codes:{ERR_INVALID_ARG_TYPE:ps}}=De(),{kResistStopPropagation:Iw,AggregateError:xw,SymbolDispose:Tw}=Ee(),Pw=globalThis.AbortSignal||Yr().AbortSignal,Ow=globalThis.AbortController||Yr().AbortController,Rw=Object.getPrototypeOf(async function(){}).constructor,qf=globalThis.Blob||Sw.Blob,kw=typeof qf<"u"?function(e){return e instanceof qf}:function(e){return !1},Lf=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ps(e,"AbortSignal",t)},Cw=(t,e)=>{if(typeof t!="function")throw new ps(e,"Function",t)};ys.exports={AggregateError:xw,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r));}},createDeferredPromise:function(){let t,e;return {promise:new Promise((n,i)=>{t=n,e=i;}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i));})},debuglog(){return function(){}},format:Ew,inspect:Aw,types:{isAsyncFunction(t){return t instanceof Rw},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:kw,deprecate(t,e){return t},addAbortListener:(er(),me(Zt)).addAbortListener||function(e,r){if(e===void 0)throw new ps("signal","AbortSignal",e);Lf(e,"signal"),Cw(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Iw]:!0}),n=()=>{e.removeEventListener("abort",r);}),{__proto__:null,[Tw](){var i;(i=n)===null||i===void 0||i();}}},AbortSignalAny:Pw.any||function(e){if(e.length===1)return e[0];let r=new Ow,n=()=>r.abort();return e.forEach(i=>{Lf(i,"signals"),i.addEventListener("abort",n,{once:!0});}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n));},{once:!0}),r.signal}};ys.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom");});var Xr=D((DO,zf)=>{A();x();I();var{ArrayIsArray:bs,ArrayPrototypeIncludes:Ff,ArrayPrototypeJoin:Wf,ArrayPrototypeMap:Bw,NumberIsInteger:ws,NumberIsNaN:Mw,NumberMAX_SAFE_INTEGER:Nw,NumberMIN_SAFE_INTEGER:qw,NumberParseInt:Lw,ObjectPrototypeHasOwnProperty:Uw,RegExpPrototypeExec:$f,String:Dw,StringPrototypeToUpperCase:jw,StringPrototypeTrim:Fw}=Ee(),{hideStackFrames:et,codes:{ERR_SOCKET_BAD_PORT:Ww,ERR_INVALID_ARG_TYPE:je,ERR_INVALID_ARG_VALUE:Jr,ERR_OUT_OF_RANGE:vr,ERR_UNKNOWN_SIGNAL:Uf}}=De(),{normalizeEncoding:$w}=$e(),{isAsyncFunction:Hw,isArrayBufferView:Vw}=$e().types,Df={};function Gw(t){return t===(t|0)}function zw(t){return t===t>>>0}var Kw=/^[0-7]+$/,Qw="must be a 32-bit unsigned integer or an octal string";function Yw(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if($f(Kw,t)===null)throw new Jr(e,t,Qw);t=Lw(t,8);}return Hf(t,e),t}var Jw=et((t,e,r=qw,n=Nw)=>{if(typeof t!="number")throw new je(e,"number",t);if(!ws(t))throw new vr(e,"an integer",t);if(t<r||t>n)throw new vr(e,`>= ${r} && <= ${n}`,t)}),Xw=et((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new je(e,"number",t);if(!ws(t))throw new vr(e,"an integer",t);if(t<r||t>n)throw new vr(e,`>= ${r} && <= ${n}`,t)}),Hf=et((t,e,r=!1)=>{if(typeof t!="number")throw new je(e,"number",t);if(!ws(t))throw new vr(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new vr(e,`>= ${n} && <= ${i}`,t)});function ms(t,e){if(typeof t!="string")throw new je(e,"string",t)}function Zw(t,e,r=void 0,n){if(typeof t!="number")throw new je(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Mw(t))throw new vr(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var em=et((t,e,r)=>{if(!Ff(r,t)){let i="must be one of: "+Wf(Bw(r,s=>typeof s=="string"?`'${s}'`:Dw(s)),", ");throw new Jr(e,t,i)}});function Vf(t,e){if(typeof t!="boolean")throw new je(e,"boolean",t)}function gs(t,e,r){return t==null||!Uw(t,e)?r:t[e]}var tm=et((t,e,r=null)=>{let n=gs(r,"allowArray",!1),i=gs(r,"allowFunction",!1);if(!gs(r,"nullable",!1)&&t===null||!n&&bs(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new je(e,"Object",t)}),rm=et((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new je(e,"a dictionary",t)}),qi=et((t,e,r=0)=>{if(!bs(t))throw new je(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Jr(e,t,n)}});function nm(t,e){qi(t,e);for(let r=0;r<t.length;r++)ms(t[r],`${e}[${r}]`);}function im(t,e){qi(t,e);for(let r=0;r<t.length;r++)Vf(t[r],`${e}[${r}]`);}function om(t,e){qi(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new je(i,"AbortSignal",n);Gf(n,i);}}function sm(t,e="signal"){if(ms(t,e),Df[t]===void 0)throw Df[jw(t)]!==void 0?new Uf(t+" (signals must use all capital letters)"):new Uf(t)}var am=et((t,e="buffer")=>{if(!Vw(t))throw new je(e,["Buffer","TypedArray","DataView"],t)});function um(t,e){let r=$w(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Jr("encoding",e,`is invalid for data of length ${n}`)}function lm(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Fw(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Ww(e,t,r);return t|0}var Gf=et((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new je(e,"AbortSignal",t)}),cm=et((t,e)=>{if(typeof t!="function")throw new je(e,"Function",t)}),fm=et((t,e)=>{if(typeof t!="function"||Hw(t))throw new je(e,"Function",t)}),hm=et((t,e)=>{if(t!==void 0)throw new je(e,"undefined",t)});function dm(t,e,r){if(!Ff(r,t))throw new je(e,`('${Wf(r,"|")}')`,t)}var pm=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function jf(t,e){if(typeof t>"u"||!$f(pm,t))throw new Jr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ym(t){if(typeof t=="string")return jf(t,"hints"),t;if(bs(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];jf(i,"hints"),r+=i,n!==e-1&&(r+=", ");}return r}throw new Jr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}zf.exports={isInt32:Gw,isUint32:zw,parseFileMode:Yw,validateArray:qi,validateStringArray:nm,validateBooleanArray:im,validateAbortSignalArray:om,validateBoolean:Vf,validateBuffer:am,validateDictionary:rm,validateEncoding:um,validateFunction:cm,validateInt32:Xw,validateInteger:Jw,validateNumber:Zw,validateObject:tm,validateOneOf:em,validatePlainFunction:fm,validatePort:lm,validateSignalName:sm,validateString:ms,validateUint32:Hf,validateUndefined:hm,validateUnion:dm,validateAbortSignal:Gf,validateLinkHeaderValue:ym};});var tr=D((QO,Jf)=>{A();x();I();var Te=Jf.exports={},gt,bt;function _s(){throw new Error("setTimeout has not been defined")}function vs(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?gt=setTimeout:gt=_s;}catch{gt=_s;}try{typeof clearTimeout=="function"?bt=clearTimeout:bt=vs;}catch{bt=vs;}})();function Kf(t){if(gt===setTimeout)return setTimeout(t,0);if((gt===_s||!gt)&&setTimeout)return gt=setTimeout,setTimeout(t,0);try{return gt(t,0)}catch{try{return gt.call(null,t,0)}catch{return gt.call(this,t,0)}}}function gm(t){if(bt===clearTimeout)return clearTimeout(t);if((bt===vs||!bt)&&clearTimeout)return bt=clearTimeout,clearTimeout(t);try{return bt(t)}catch{try{return bt.call(null,t)}catch{return bt.call(this,t)}}}var qt=[],Zr=!1,Sr,Li=-1;function bm(){!Zr||!Sr||(Zr=!1,Sr.length?qt=Sr.concat(qt):Li=-1,qt.length&&Qf());}function Qf(){if(!Zr){var t=Kf(bm);Zr=!0;for(var e=qt.length;e;){for(Sr=qt,qt=[];++Li<e;)Sr&&Sr[Li].run();Li=-1,e=qt.length;}Sr=null,Zr=!1,gm(t);}}Te.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];qt.push(new Yf(t,e)),qt.length===1&&!Zr&&Kf(Qf);};function Yf(t,e){this.fun=t,this.array=e;}Yf.prototype.run=function(){this.fun.apply(null,this.array);};Te.title="browser";Te.browser=!0;Te.env={};Te.argv=[];Te.version="";Te.versions={};function Lt(){}Te.on=Lt;Te.addListener=Lt;Te.once=Lt;Te.off=Lt;Te.removeListener=Lt;Te.removeAllListeners=Lt;Te.emit=Lt;Te.prependListener=Lt;Te.prependOnceListener=Lt;Te.listeners=function(t){return []};Te.binding=function(t){throw new Error("process.binding is not supported")};Te.cwd=function(){return "/"};Te.chdir=function(t){throw new Error("process.chdir is not supported")};Te.umask=function(){return 0};});var mt=D((oR,hh)=>{A();x();I();var{SymbolAsyncIterator:Xf,SymbolIterator:Zf,SymbolFor:Er}=Ee(),eh=Er("nodejs.stream.destroyed"),th=Er("nodejs.stream.errored"),Ss=Er("nodejs.stream.readable"),Es=Er("nodejs.stream.writable"),rh=Er("nodejs.stream.disturbed"),wm=Er("nodejs.webstream.isClosedPromise"),mm=Er("nodejs.webstream.controllerErrorFunction");function Ui(t,e=!1){var r;return !!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Di(t){var e;return !!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function _m(t){return !!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function wt(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function nh(t){return !!(t&&!wt(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function ih(t){return !!(t&&!wt(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function oh(t){return !!(t&&!wt(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function vm(t){return nh(t)||ih(t)||oh(t)}function Sm(t,e){return t==null?!1:e===!0?typeof t[Xf]=="function":e===!1?typeof t[Zf]=="function":typeof t[Xf]=="function"||typeof t[Zf]=="function"}function ji(t){if(!wt(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return !!(t.destroyed||t[eh]||n!=null&&n.destroyed)}function sh(t){if(!Di(t))return null;if(t.writableEnded===!0)return !0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Em(t,e){if(!Di(t))return null;if(t.writableFinished===!0)return !0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function Am(t){if(!Ui(t))return null;if(t.readableEnded===!0)return !0;let e=t._readableState;return !e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function ah(t,e){if(!Ui(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function uh(t){return t&&t[Ss]!=null?t[Ss]:typeof t?.readable!="boolean"?null:ji(t)?!1:Ui(t)&&t.readable&&!ah(t)}function lh(t){return t&&t[Es]!=null?t[Es]:typeof t?.writable!="boolean"?null:ji(t)?!1:Di(t)&&t.writable&&!sh(t)}function Im(t,e){return wt(t)?ji(t)?!0:!(e?.readable!==!1&&uh(t)||e?.writable!==!1&&lh(t)):null}function xm(t){var e,r;return wt(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Tm(t){var e,r;return wt(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Pm(t){if(!wt(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&ch(t)?t._closed:null}function ch(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function fh(t){return typeof t._sent100=="boolean"&&ch(t)}function Om(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Rm(t){if(!wt(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return !n&&fh(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function km(t){var e;return !!(t&&((e=t[rh])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function Cm(t){var e,r,n,i,s,o,a,c,f,h;return !!(t&&((e=(r=(n=(i=(s=(o=t[th])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}hh.exports={isDestroyed:ji,kIsDestroyed:eh,isDisturbed:km,kIsDisturbed:rh,isErrored:Cm,kIsErrored:th,isReadable:uh,kIsReadable:Ss,kIsClosedPromise:wm,kControllerErrorFunction:mm,kIsWritable:Es,isClosed:Pm,isDuplexNodeStream:_m,isFinished:Im,isIterable:Sm,isReadableNodeStream:Ui,isReadableStream:nh,isReadableEnded:Am,isReadableFinished:ah,isReadableErrored:Tm,isNodeStream:wt,isWebStream:vm,isWritable:lh,isWritableNodeStream:Di,isWritableStream:ih,isWritableEnded:sh,isWritableFinished:Em,isWritableErrored:xm,isServerRequest:Om,isServerResponse:fh,willEmitClose:Rm,isTransformStream:oh};});var Ut=D((yR,Ps)=>{A();x();I();var rr=tr(),{AbortError:vh,codes:Bm}=De(),{ERR_INVALID_ARG_TYPE:Mm,ERR_STREAM_PREMATURE_CLOSE:dh}=Bm,{kEmptyObject:Is,once:xs}=$e(),{validateAbortSignal:Nm,validateFunction:qm,validateObject:Lm,validateBoolean:Um}=Xr(),{Promise:Dm,PromisePrototypeThen:jm,SymbolDispose:Sh}=Ee(),{isClosed:Fm,isReadable:ph,isReadableNodeStream:As,isReadableStream:Wm,isReadableFinished:yh,isReadableErrored:gh,isWritable:bh,isWritableNodeStream:wh,isWritableStream:$m,isWritableFinished:mh,isWritableErrored:_h,isNodeStream:Hm,willEmitClose:Vm,kIsClosedPromise:Gm}=mt(),en;function zm(t){return t.setHeader&&typeof t.abort=="function"}var Ts=()=>{};function Eh(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Is):e==null?e=Is:Lm(e,"options"),qm(r,"callback"),Nm(e.signal,"options.signal"),r=xs(r),Wm(t)||$m(t))return Km(t,e,r);if(!Hm(t))throw new Mm("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:As(t),o=(i=e.writable)!==null&&i!==void 0?i:wh(t),a=t._writableState,c=t._readableState,f=()=>{t.writable||w();},h=Vm(t)&&As(t)===s&&wh(t)===o,d=mh(t,!1),w=()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||s))&&(!s||y)&&r.call(t);},y=yh(t,!1),P=()=>{y=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||o))&&(!o||d)&&r.call(t);},E=g=>{r.call(t,g);},b=Fm(t),m=()=>{b=!0;let g=_h(t)||gh(t);if(g&&typeof g!="boolean")return r.call(t,g);if(s&&!y&&As(t,!0)&&!yh(t,!1))return r.call(t,new dh);if(o&&!d&&!mh(t,!1))return r.call(t,new dh);r.call(t);},v=()=>{b=!0;let g=_h(t)||gh(t);if(g&&typeof g!="boolean")return r.call(t,g);r.call(t);},R=()=>{t.req.on("finish",w);};zm(t)?(t.on("complete",w),h||t.on("abort",m),t.req?R():t.on("request",R)):o&&!a&&(t.on("end",f),t.on("close",f)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",m),t.on("end",P),t.on("finish",w),e.error!==!1&&t.on("error",E),t.on("close",m),b?rr.nextTick(m):a!=null&&a.errorEmitted||c!=null&&c.errorEmitted?h||rr.nextTick(v):(!s&&(!h||ph(t))&&(d||bh(t)===!1)||!o&&(!h||bh(t))&&(y||ph(t)===!1)||c&&t.req&&t.aborted)&&rr.nextTick(v);let T=()=>{r=Ts,t.removeListener("aborted",m),t.removeListener("complete",w),t.removeListener("abort",m),t.removeListener("request",R),t.req&&t.req.removeListener("finish",w),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",w),t.removeListener("end",P),t.removeListener("error",E),t.removeListener("close",m);};if(e.signal&&!b){let g=()=>{let O=r;T(),O.call(t,new vh(void 0,{cause:e.signal.reason}));};if(e.signal.aborted)rr.nextTick(g);else {en=en||$e().addAbortListener;let O=en(e.signal,g),_=r;r=xs((...q)=>{O[Sh](),_.apply(t,q);});}}return T}function Km(t,e,r){let n=!1,i=Ts;if(e.signal)if(i=()=>{n=!0,r.call(t,new vh(void 0,{cause:e.signal.reason}));},e.signal.aborted)rr.nextTick(i);else {en=en||$e().addAbortListener;let o=en(e.signal,i),a=r;r=xs((...c)=>{o[Sh](),a.apply(t,c);});}let s=(...o)=>{n||rr.nextTick(()=>r.apply(t,o));};return jm(t[Gm].promise,s,s),Ts}function Qm(t,e){var r;let n=!1;return e===null&&(e=Is),(r=e)!==null&&r!==void 0&&r.cleanup&&(Um(e.cleanup,"cleanup"),n=e.cleanup),new Dm((i,s)=>{let o=Eh(t,e,a=>{n&&o(),a?s(a):i();});})}Ps.exports=Eh;Ps.exports.finished=Qm;});var Ar=D((IR,kh)=>{A();x();I();var _t=tr(),{aggregateTwoErrors:Ym,codes:{ERR_MULTIPLE_CALLBACK:Jm},AbortError:Xm}=De(),{Symbol:xh}=Ee(),{kIsDestroyed:Zm,isDestroyed:e_,isFinished:t_,isServerRequest:r_}=mt(),Th=xh("kDestroy"),Os=xh("kConstruct");function Ph(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t));}function n_(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Ph(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?Ah(this,t,e):this.once(Th,function(s){Ah(this,Ym(s,t),e);}),this)}function Ah(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;Ph(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?_t.nextTick(i_,t,s):_t.nextTick(Oh,t);}try{t._destroy(e||null,i);}catch(s){i(s);}}function i_(t,e){Rs(t,e),Oh(t);}function Oh(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close");}function Rs(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e));}function o_(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1);}function ks(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?_t.nextTick(Rs,t,e):Rs(t,e));}function s_(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Os,e),!(t.listenerCount(Os)>1)&&_t.nextTick(a_,t);}function a_(t){let e=!1;function r(n){if(e){ks(t,n??new Jm);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Th,n):n?ks(t,n,!0):_t.nextTick(u_,t);}try{t._construct(n=>{_t.nextTick(r,n);});}catch(n){_t.nextTick(r,n);}}function u_(t){t.emit(Os);}function Ih(t){return t?.setHeader&&typeof t.abort=="function"}function Rh(t){t.emit("close");}function l_(t,e){t.emit("error",e),_t.nextTick(Rh,t);}function c_(t,e){!t||e_(t)||(!e&&!t_(t)&&(e=new Xm),r_(t)?(t.socket=null,t.destroy(e)):Ih(t)?t.abort():Ih(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?_t.nextTick(l_,t,e):_t.nextTick(Rh,t),t.destroyed||(t[Zm]=!0));}kh.exports={construct:s_,destroyer:c_,destroy:n_,undestroy:o_,errorOrDestroy:ks};});var $i=D((NR,Bh)=>{A();x();I();var{ArrayIsArray:f_,ObjectSetPrototypeOf:Ch}=Ee(),{EventEmitter:Fi}=(er(),me(Zt));function Wi(t){Fi.call(this,t);}Ch(Wi.prototype,Fi.prototype);Ch(Wi,Fi);Wi.prototype.pipe=function(t,e){let r=this;function n(h){t.writable&&t.write(h)===!1&&r.pause&&r.pause();}r.on("data",n);function i(){r.readable&&r.resume&&r.resume();}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end());}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy());}function c(h){f(),Fi.listenerCount(this,"error")===0&&this.emit("error",h);}Cs(r,"error",c),Cs(t,"error",c);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f);}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function Cs(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):f_(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]];}Bh.exports={Stream:Wi,prependListener:Cs};});var kn=D((VR,Hi)=>{A();x();I();var{SymbolDispose:h_}=Ee(),{AbortError:Mh,codes:d_}=De(),{isNodeStream:Nh,isWebStream:p_,kControllerErrorFunction:y_}=mt(),g_=Ut(),{ERR_INVALID_ARG_TYPE:qh}=d_,Bs,b_=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new qh(e,"AbortSignal",t)};Hi.exports.addAbortSignal=function(e,r){if(b_(e,"signal"),!Nh(r)&&!p_(r))throw new qh("stream",["ReadableStream","WritableStream","Stream"],r);return Hi.exports.addAbortSignalNoValidate(e,r)};Hi.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Nh(e)?()=>{e.destroy(new Mh(void 0,{cause:t.reason}));}:()=>{e[y_](new Mh(void 0,{cause:t.reason}));};if(t.aborted)r();else {Bs=Bs||$e().addAbortListener;let n=Bs(t,r);g_(e,n[h_]);}return e};});var Dh=D((rk,Uh)=>{A();x();I();var{StringPrototypeSlice:Lh,SymbolIterator:w_,TypedArrayPrototypeSet:Vi,Uint8Array:m_}=Ee(),{Buffer:Ms}=(ke(),me(qe)),{inspect:__}=$e();Uh.exports=class{constructor(){this.head=null,this.tail=null,this.length=0;}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length;}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length;}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0;}join(e){if(this.length===0)return "";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Ms.alloc(0);let r=Ms.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Vi(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[w_](){for(let e=this.head;e;e=e.next)yield e.data;}_getString(e){let r="",n=this.head,i=0;do{let s=n.data;if(e>s.length)r+=s,e-=s.length;else {e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Lh(s,0,e),this.head=n,n.data=Lh(s,e));break}++i;}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Ms.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Vi(r,o,n-e),e-=o.length;else {e===o.length?(Vi(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Vi(r,new m_(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s;}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return __(this,{...r,depth:0,customInspect:!1})}};});var Cn=D((hk,$h)=>{A();x();I();var{MathFloor:v_,NumberIsInteger:S_}=Ee(),{validateInteger:E_}=Xr(),{ERR_INVALID_ARG_VALUE:A_}=De().codes,jh=16*1024,Fh=16;function I_(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Wh(t){return t?Fh:jh}function x_(t,e){E_(e,"value",0),t?Fh=e:jh=e;}function T_(t,e,r,n){let i=I_(e,n,r);if(i!=null){if(!S_(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new A_(s,i)}return v_(i)}return Wh(t.objectMode)}$h.exports={getHighWaterMark:T_,getDefaultHighWaterMark:Wh,setDefaultHighWaterMark:x_};});var Gh=D((Ns,Vh)=>{A();x();I();var Gi=(ke(),me(qe)),vt=Gi.Buffer;function Hh(t,e){for(var r in t)e[r]=t[r];}vt.from&&vt.alloc&&vt.allocUnsafe&&vt.allocUnsafeSlow?Vh.exports=Gi:(Hh(Gi,Ns),Ns.Buffer=Ir);function Ir(t,e,r){return vt(t,e,r)}Ir.prototype=Object.create(vt.prototype);Hh(vt,Ir);Ir.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return vt(t,e,r)};Ir.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=vt(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Ir.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return vt(t)};Ir.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Gi.SlowBuffer(t)};});var Qh=D(Kh=>{A();x();I();var Ls=Gh().Buffer,zh=Ls.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return !0;default:return !1}};function P_(t){if(!t)return "utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return "utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return "utf16le";case"latin1":case"binary":return "latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0;}}function O_(t){var e=P_(t);if(typeof e!="string"&&(Ls.isEncoding===zh||!zh(t)))throw new Error("Unknown encoding: "+t);return e||t}Kh.StringDecoder=Bn;function Bn(t){this.encoding=O_(t);var e;switch(this.encoding){case"utf16le":this.text=N_,this.end=q_,e=4;break;case"utf8":this.fillLast=C_,e=4;break;case"base64":this.text=L_,this.end=U_,e=3;break;default:this.write=D_,this.end=j_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ls.allocUnsafe(e);}Bn.prototype.write=function(t){if(t.length===0)return "";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return "";r=this.lastNeed,this.lastNeed=0;}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Bn.prototype.end=M_;Bn.prototype.text=B_;Bn.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length;};function qs(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function R_(t,e,r){var n=e.length-1;if(n<r)return 0;var i=qs(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=qs(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=qs(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function k_(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function C_(t){var e=this.lastTotal-this.lastNeed,r=k_(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length;}function B_(t,e){var r=R_(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function M_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function N_(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function q_(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function L_(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function U_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function D_(t){return t.toString(this.encoding)}function j_(t){return t&&t.length?this.write(t):""}});var Us=D((Fk,Zh)=>{A();x();I();var Yh=tr(),{PromisePrototypeThen:F_,SymbolAsyncIterator:Jh,SymbolIterator:Xh}=Ee(),{Buffer:W_}=(ke(),me(qe)),{ERR_INVALID_ARG_TYPE:$_,ERR_STREAM_NULL_VALUES:H_}=De().codes;function V_(t,e,r){let n;if(typeof e=="string"||e instanceof W_)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null);}});let i;if(e&&e[Jh])i=!0,n=e[Jh]();else if(e&&e[Xh])i=!1,n=e[Xh]();else throw new $_("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,c());},s._destroy=function(f,h){F_(a(f),()=>Yh.nextTick(h,f),d=>Yh.nextTick(h,d||f));};async function a(f){let h=f!=null,d=typeof n.throw=="function";if(h&&d){let{value:w,done:y}=await n.throw(f);if(await w,y)return}if(typeof n.return=="function"){let{value:w}=await n.return();await w;}}async function c(){for(;;){try{let{value:f,done:h}=i?await n.next():n.next();if(h)s.push(null);else {let d=f&&typeof f.then=="function"?await f:f;if(d===null)throw o=!1,new H_;if(s.push(d))continue;o=!1;}}catch(f){s.destroy(f);}break}}return s}Zh.exports=V_;});var Nn=D((Jk,bd)=>{A();x();I();var lt=tr(),{ArrayPrototypeIndexOf:G_,NumberIsInteger:z_,NumberIsNaN:K_,NumberParseInt:Q_,ObjectDefineProperties:Gs,ObjectKeys:Y_,ObjectSetPrototypeOf:rd,Promise:nd,SafeSet:J_,SymbolAsyncDispose:X_,SymbolAsyncIterator:Z_,Symbol:ev}=Ee();bd.exports=le;le.ReadableState=Yi;var{EventEmitter:tv}=(er(),me(Zt)),{Stream:nr,prependListener:rv}=$i(),{Buffer:Ds}=(ke(),me(qe)),{addAbortSignal:nv}=kn(),id=Ut(),he=$e().debuglog("stream",t=>{he=t;}),iv=Dh(),nn=Ar(),{getHighWaterMark:ov,getDefaultHighWaterMark:sv}=Cn(),{aggregateTwoErrors:ed,codes:{ERR_INVALID_ARG_TYPE:av,ERR_METHOD_NOT_IMPLEMENTED:uv,ERR_OUT_OF_RANGE:lv,ERR_STREAM_PUSH_AFTER_EOF:cv,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:fv},AbortError:hv}=De(),{validateObject:dv}=Xr(),xr=ev("kPaused"),{StringDecoder:od}=Qh(),pv=Us();rd(le.prototype,nr.prototype);rd(le,nr);var js=()=>{},{errorOrDestroy:tn}=nn,rn=1,yv=2,sd=4,Mn=8,ad=16,zi=32,Ki=64,ud=128,gv=256,bv=512,wv=1024,Hs=2048,Vs=4096,mv=8192,_v=16384,vv=32768,ld=65536,Sv=1<<17,Ev=1<<18;function Ce(t){return {enumerable:!1,get(){return (this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t;}}}Gs(Yi.prototype,{objectMode:Ce(rn),ended:Ce(yv),endEmitted:Ce(sd),reading:Ce(Mn),constructed:Ce(ad),sync:Ce(zi),needReadable:Ce(Ki),emittedReadable:Ce(ud),readableListening:Ce(gv),resumeScheduled:Ce(bv),errorEmitted:Ce(wv),emitClose:Ce(Hs),autoDestroy:Ce(Vs),destroyed:Ce(mv),closed:Ce(_v),closeEmitted:Ce(vv),multiAwaitDrain:Ce(ld),readingMore:Ce(Sv),dataEmitted:Ce(Ev)});function Yi(t,e,r){typeof r!="boolean"&&(r=e instanceof St()),this.state=Hs|Vs|ad|zi,t&&t.objectMode&&(this.state|=rn),r&&t&&t.readableObjectMode&&(this.state|=rn),this.highWaterMark=t?ov(this,t,"readableHighWaterMark",r):sv(!1),this.buffer=new iv,this.length=0,this.pipes=[],this.flowing=null,this[xr]=null,t&&t.emitClose===!1&&(this.state&=~Hs),t&&t.autoDestroy===!1&&(this.state&=~Vs),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new od(t.encoding),this.encoding=t.encoding);}function le(t){if(!(this instanceof le))return new le(t);let e=this instanceof St();this._readableState=new Yi(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&nv(t.signal,this)),nr.call(this,t),nn.construct(this,()=>{this._readableState.needReadable&&Qi(this,this._readableState);});}le.prototype.destroy=nn.destroy;le.prototype._undestroy=nn.undestroy;le.prototype._destroy=function(t,e){e(t);};le.prototype[tv.captureRejectionSymbol]=function(t){this.destroy(t);};le.prototype[X_]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new hv,this.destroy(t)),new nd((e,r)=>id(this,n=>n&&n!==t?r(n):e(null)))};le.prototype.push=function(t,e){return cd(this,t,e,!1)};le.prototype.unshift=function(t,e){return cd(this,t,e,!0)};function cd(t,e,r,n){he("readableAddChunk",e);let i=t._readableState,s;if((i.state&rn)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=Ds.from(e,r).toString(i.encoding):(e=Ds.from(e,r),r=""))):e instanceof Ds?r="":nr._isUint8Array(e)?(e=nr._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new av("chunk",["string","Buffer","Uint8Array"],e))),s)tn(t,s);else if(e===null)i.state&=~Mn,xv(t,i);else if((i.state&rn)!==0||e&&e.length>0)if(n)if((i.state&sd)!==0)tn(t,new fv);else {if(i.destroyed||i.errored)return !1;Fs(t,i,e,!0);}else if(i.ended)tn(t,new cv);else {if(i.destroyed||i.errored)return !1;i.state&=~Mn,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Fs(t,i,e,!1):Qi(t,i)):Fs(t,i,e,!1);}else n||(i.state&=~Mn,Qi(t,i));return !i.ended&&(i.length<i.highWaterMark||i.length===0)}function Fs(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&ld)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&Ki)!==0&&Ji(t)),Qi(t,e);}le.prototype.isPaused=function(){let t=this._readableState;return t[xr]===!0||t.flowing===!1};le.prototype.setEncoding=function(t){let e=new od(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Av=1073741824;function Iv(t){if(t>Av)throw new lv("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function td(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&rn)!==0?1:K_(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}le.prototype.read=function(t){he("read",t),t===void 0?t=NaN:z_(t)||(t=Q_(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Iv(t)),t!==0&&(e.state&=~ud),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return he("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Ws(this):Ji(this),null;if(t=td(t,e),t===0&&e.ended)return e.length===0&&Ws(this),null;let n=(e.state&Ki)!==0;if(he("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,he("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,he("reading, ended or constructing",n);else if(n){he("do read"),e.state|=Mn|zi,e.length===0&&(e.state|=Ki);try{this._read(e.highWaterMark);}catch(s){tn(this,s);}e.state&=~zi,e.reading||(t=td(r,e));}let i;return t>0?i=yd(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Ws(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function xv(t,e){if(he("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length);}e.ended=!0,e.sync?Ji(t):(e.needReadable=!1,e.emittedReadable=!0,fd(t));}}function Ji(t){let e=t._readableState;he("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(he("emitReadable",e.flowing),e.emittedReadable=!0,lt.nextTick(fd,t));}function fd(t){let e=t._readableState;he("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,dd(t);}function Qi(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,lt.nextTick(Tv,t,e));}function Tv(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(he("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1;}le.prototype._read=function(t){throw new uv("_read()")};le.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new J_(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),he("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==lt.stdout&&t!==lt.stderr?a:b;n.endEmitted?lt.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(m,v){he("onunpipe"),m===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,h());}function a(){he("onend"),t.end();}let c,f=!1;function h(){he("cleanup"),t.removeListener("close",P),t.removeListener("finish",E),c&&t.removeListener("drain",c),t.removeListener("error",y),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",w),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c();}function d(){f||(n.pipes.length===1&&n.pipes[0]===t?(he("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(he("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),c||(c=Pv(r,t),t.on("drain",c));}r.on("data",w);function w(m){he("ondata");let v=t.write(m);he("dest.write",v),v===!1&&d();}function y(m){if(he("onerror",m),b(),t.removeListener("error",y),t.listenerCount("error")===0){let v=t._writableState||t._readableState;v&&!v.errorEmitted?tn(t,m):t.emit("error",m);}}rv(t,"error",y);function P(){t.removeListener("finish",E),b();}t.once("close",P);function E(){he("onfinish"),t.removeListener("close",P),b();}t.once("finish",E);function b(){he("unpipe"),r.unpipe(t);}return t.emit("pipe",r),t.writableNeedDrain===!0?d():n.flowing||(he("pipe resume"),r.resume()),t};function Pv(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(he("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(he("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume();}}le.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s<i.length;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=G_(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};le.prototype.on=function(t,e){let r=nr.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,he("on readable",n.length,n.reading),n.length?Ji(this):n.reading||lt.nextTick(Ov,this)),r};le.prototype.addListener=le.prototype.on;le.prototype.removeListener=function(t,e){let r=nr.prototype.removeListener.call(this,t,e);return t==="readable"&<.nextTick(hd,this),r};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(t){let e=nr.prototype.removeAllListeners.apply(this,arguments);return (t==="readable"||t===void 0)&<.nextTick(hd,this),e};function hd(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[xr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null);}function Ov(t){he("readable nexttick read 0"),t.read(0);}le.prototype.resume=function(){let t=this._readableState;return t.flowing||(he("resume"),t.flowing=!t.readableListening,Rv(this,t)),t[xr]=!1,this};function Rv(t,e){e.resumeScheduled||(e.resumeScheduled=!0,lt.nextTick(kv,t,e));}function kv(t,e){he("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),dd(t),e.flowing&&!e.reading&&t.read(0);}le.prototype.pause=function(){return he("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(he("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[xr]=!0,this};function dd(t){let e=t._readableState;for(he("flow",e.flowing);e.flowing&&t.read()!==null;);}le.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause());}),t.on("end",()=>{this.push(null);}),t.on("error",n=>{tn(this,n);}),t.on("close",()=>{this.destroy();}),t.on("destroy",()=>{this.destroy();}),this._read=()=>{e&&t.resume&&(e=!1,t.resume());};let r=Y_(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t));}return this};le.prototype[Z_]=function(){return pd(this)};le.prototype.iterator=function(t){return t!==void 0&&dv(t,"options"),pd(this,t)};function pd(t,e){typeof t.read!="function"&&(t=le.wrap(t,{objectMode:!0}));let r=Cv(t,e);return r.stream=t,r}async function*Cv(t,e){let r=js;function n(o){this===t?(r(),r=js):r=o;}t.on("readable",n);let i,s=id(t,{writable:!1},o=>{i=o?ed(i,o):null,r(),r=js;});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else {if(i)throw i;if(i===null)return;await new nd(n);}}}catch(o){throw i=ed(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?nn.destroyer(t,null):(t.off("readable",n),s());}}Gs(le.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return !!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t);}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return !!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t);}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t);}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Gs(Yi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[xr]!==!1},set(t){this[xr]=!!t;}}});le._fromList=yd;function yd(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Ws(t){let e=t._readableState;he("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,lt.nextTick(Bv,e,t));}function Bv(t,e){if(he("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)lt.nextTick(Mv,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy();}}}function Mv(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end();}le.from=function(t,e){return pv(le,t,e)};var $s;function gd(){return $s===void 0&&($s={}),$s}le.fromWeb=function(t,e){return gd().newStreamReadableFromReadableStream(t,e)};le.toWeb=function(t,e){return gd().newReadableStreamFromStreamReadable(t,e)};le.wrap=function(t,e){var r,n;return new le({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){nn.destroyer(t,i),s(i);}}).wrap(t)};});var ro=D((aC,Od)=>{A();x();I();var Tr=tr(),{ArrayPrototypeSlice:_d,Error:Nv,FunctionPrototypeSymbolHasInstance:vd,ObjectDefineProperty:Sd,ObjectDefineProperties:qv,ObjectSetPrototypeOf:Ed,StringPrototypeToLowerCase:Lv,Symbol:Uv,SymbolHasInstance:Dv}=Ee();Od.exports=Ie;Ie.WritableState=Un;var{EventEmitter:jv}=(er(),me(Zt)),qn=$i().Stream,{Buffer:Xi}=(ke(),me(qe)),to=Ar(),{addAbortSignal:Fv}=kn(),{getHighWaterMark:Wv,getDefaultHighWaterMark:$v}=Cn(),{ERR_INVALID_ARG_TYPE:Hv,ERR_METHOD_NOT_IMPLEMENTED:Vv,ERR_MULTIPLE_CALLBACK:Ad,ERR_STREAM_CANNOT_PIPE:Gv,ERR_STREAM_DESTROYED:Ln,ERR_STREAM_ALREADY_FINISHED:zv,ERR_STREAM_NULL_VALUES:Kv,ERR_STREAM_WRITE_AFTER_END:Qv,ERR_UNKNOWN_ENCODING:Id}=De().codes,{errorOrDestroy:on}=to;Ed(Ie.prototype,qn.prototype);Ed(Ie,qn);function Qs(){}var sn=Uv("kOnFinished");function Un(t,e,r){typeof r!="boolean"&&(r=e instanceof St()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Wv(this,t,"writableHighWaterMark",r):$v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Jv.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,eo(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[sn]=[];}function eo(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0;}Un.prototype.getBuffer=function(){return _d(this.buffered,this.bufferedIndex)};Sd(Un.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ie(t){let e=this instanceof St();if(!e&&!vd(Ie,this))return new Ie(t);this._writableState=new Un(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Fv(t.signal,this)),qn.call(this,t),to.construct(this,()=>{let r=this._writableState;r.writing||Js(this,r),Xs(this,r);});}Sd(Ie,Dv,{__proto__:null,value:function(t){return vd(this,t)?!0:this!==Ie?!1:t&&t._writableState instanceof Un}});Ie.prototype.pipe=function(){on(this,new Gv);};function xd(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else {if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Xi.isEncoding(r))throw new Id(r);typeof n!="function"&&(n=Qs);}if(e===null)throw new Kv;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Xi.from(e,r),r="buffer");else if(e instanceof Xi)r="buffer";else if(qn._isUint8Array(e))e=qn._uint8ArrayToBuffer(e),r="buffer";else throw new Hv("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new Qv:i.destroyed&&(s=new Ln("write")),s?(Tr.nextTick(n,s),on(t,s,!0),s):(i.pendingcb++,Yv(t,i,e,r,n))}Ie.prototype.write=function(t,e,r){return xd(this,t,e,r)===!0};Ie.prototype.cork=function(){this._writableState.corked++;};Ie.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Js(this,t));};Ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=Lv(e)),!Xi.isEncoding(e))throw new Id(e);return this._writableState.defaultEncoding=e,this};function Yv(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==Qs&&(e.allNoop=!1)):(e.writelen=s,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function wd(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ln("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1;}function md(t,e,r,n){--e.pendingcb,n(r),Ys(e),on(t,r);}function Jv(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){on(t,new Ad);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?Tr.nextTick(md,t,r,e,i):md(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&Js(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},Tr.nextTick(Xv,r.afterWriteTickInfo)):Td(t,r,1,i));}function Xv({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Td(t,e,r,n)}function Td(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&Ys(e),Xs(t,e);}function Ys(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:s,callback:o}=t.buffered[i],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new Ln("write"));}let r=t[sn].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new Ln("end"));}eo(t);}function Js(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,s=r.length-n;if(!s)return;let o=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?Qs:f=>{for(let h=o;h<r.length;++h)r[h].callback(f);},c=e.allNoop&&o===0?r:_d(r,o);c.allBuffers=e.allBuffers,wd(t,e,!0,e.length,c,"",a),eo(e);}else {do{let{chunk:a,encoding:c,callback:f}=r[o];r[o++]=null;let h=i?1:a.length;wd(t,e,!1,h,a,c,f);}while(o<r.length&&!e.writing);o===r.length?eo(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o;}e.bufferProcessing=!1;}Ie.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Vv("_write()")};Ie.prototype._writev=null;Ie.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=xd(this,t,e);s instanceof Nv&&(i=s);}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,Xs(this,n,!0),n.ended=!0):n.finished?i=new zv("end"):n.destroyed&&(i=new Ln("end"))),typeof r=="function"&&(i||n.finished?Tr.nextTick(r,i):n[sn].push(r)),this};function Zi(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Zv(t,e){let r=!1;function n(i){if(r){on(t,i??Ad());return}if(r=!0,e.pendingcb--,i){let s=e[sn].splice(0);for(let o=0;o<s.length;o++)s[o](i);on(t,i,e.sync);}else Zi(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Tr.nextTick(Ks,t,e));}e.sync=!0,e.pendingcb++;try{t._final(n);}catch(i){n(i);}e.sync=!1;}function e0(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Zv(t,e)):(e.prefinished=!0,t.emit("prefinish")));}function Xs(t,e,r){Zi(e)&&(e0(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Tr.nextTick((n,i)=>{Zi(i)?Ks(n,i):i.pendingcb--;},t,e)):Zi(e)&&(e.pendingcb++,Ks(t,e))));}function Ks(t,e){e.pendingcb--,e.finished=!0;let r=e[sn].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy();}}qv(Ie.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t);}},writable:{__proto__:null,get(){let t=this._writableState;return !!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t);}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return !!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var t0=to.destroy;Ie.prototype.destroy=function(t,e){let r=this._writableState;return !r.destroyed&&(r.bufferedIndex<r.buffered.length||r[sn].length)&&Tr.nextTick(Ys,r),t0.call(this,t,e),this};Ie.prototype._undestroy=to.undestroy;Ie.prototype._destroy=function(t,e){e(t);};Ie.prototype[jv.captureRejectionSymbol]=function(t){this.destroy(t);};var zs;function Pd(){return zs===void 0&&(zs={}),zs}Ie.fromWeb=function(t,e){return Pd().newStreamWritableFromWritableStream(t,e)};Ie.toWeb=function(t){return Pd().newWritableStreamFromStreamWritable(t)};});var Hd=D((bC,$d)=>{A();x();I();var Zs=tr(),r0=(ke(),me(qe)),{isReadable:n0,isWritable:i0,isIterable:Rd,isNodeStream:o0,isReadableNodeStream:kd,isWritableNodeStream:Cd,isDuplexNodeStream:s0,isReadableStream:Bd,isWritableStream:Md}=mt(),Nd=Ut(),{AbortError:Fd,codes:{ERR_INVALID_ARG_TYPE:a0,ERR_INVALID_RETURN_VALUE:qd}}=De(),{destroyer:un}=Ar(),u0=St(),Wd=Nn(),l0=ro(),{createDeferredPromise:Ld}=$e(),Ud=Us(),Dd=globalThis.Blob||r0.Blob,c0=typeof Dd<"u"?function(e){return e instanceof Dd}:function(e){return !1},f0=globalThis.AbortController||Yr().AbortController,{FunctionPrototypeCall:jd}=Ee(),ir=class extends u0{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0);}};$d.exports=function t(e,r){if(s0(e))return e;if(kd(e))return an({readable:e});if(Cd(e))return an({writable:e});if(o0(e))return an({writable:!1,readable:!1});if(Bd(e))return an({readable:Wd.fromWeb(e)});if(Md(e))return an({writable:l0.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=h0(e);if(Rd(i))return Ud(ir,i,{objectMode:!0,write:s,final:o,destroy:a});let c=i?.then;if(typeof c=="function"){let f,h=jd(c,i,d=>{if(d!=null)throw new qd("nully","body",d)},d=>{un(f,d);});return f=new ir({objectMode:!0,readable:!1,write:s,final(d){o(async()=>{try{await h,Zs.nextTick(d,null);}catch(w){Zs.nextTick(d,w);}});},destroy:a})}throw new qd("Iterable, AsyncIterable or AsyncFunction",r,i)}if(c0(e))return t(e.arrayBuffer());if(Rd(e))return Ud(ir,e,{objectMode:!0,writable:!1});if(Bd(e?.readable)&&Md(e?.writable))return ir.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?kd(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?Cd(e?.writable)?e?.writable:t(e.writable):void 0;return an({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return jd(n,e,s=>{s!=null&&i.push(s),i.push(null);},s=>{un(i,s);}),i=new ir({objectMode:!0,writable:!1,read(){}})}throw new a0(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function h0(t){let{promise:e,resolve:r}=Ld(),n=new f0,i=n.signal;return {value:t(async function*(){for(;;){let o=e;e=null;let{chunk:a,done:c,cb:f}=await o;if(Zs.nextTick(f),c)return;if(i.aborted)throw new Fd(void 0,{cause:i.reason});(({promise:e,resolve:r}=Ld())),yield a;}}(),{signal:i}),write(o,a,c){let f=r;r=null,f({chunk:o,done:!1,cb:c});},final(o){let a=r;r=null,a({done:!0,cb:o});},destroy(o,a){n.abort(),a(o);}}}function an(t){let e=t.readable&&typeof t.readable.read!="function"?Wd.wrap(t.readable):t.readable,r=t.writable,n=!!n0(e),i=!!i0(r),s,o,a,c,f;function h(d){let w=c;c=null,w?w(d):d&&f.destroy(d);}return f=new ir({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Nd(r,d=>{i=!1,d&&un(e,d),h(d);}),f._write=function(d,w,y){r.write(d,w)?y():s=y;},f._final=function(d){r.end(),o=d;},r.on("drain",function(){if(s){let d=s;s=null,d();}}),r.on("finish",function(){if(o){let d=o;o=null,d();}})),n&&(Nd(e,d=>{n=!1,d&&un(e,d),h(d);}),e.on("readable",function(){if(a){let d=a;a=null,d();}}),e.on("end",function(){f.push(null);}),f._read=function(){for(;;){let d=e.read();if(d===null){a=f._read;return}if(!f.push(d))return}}),f._destroy=function(d,w){!d&&c!==null&&(d=new Fd),a=null,s=null,o=null,c===null?w(d):(c=w,un(r,d),un(e,d));},f}});var St=D((TC,zd)=>{A();x();I();var{ObjectDefineProperties:d0,ObjectGetOwnPropertyDescriptor:Dt,ObjectKeys:p0,ObjectSetPrototypeOf:Vd}=Ee();zd.exports=ct;var ra=Nn(),tt=ro();Vd(ct.prototype,ra.prototype);Vd(ct,ra);{let t=p0(tt.prototype);for(let e=0;e<t.length;e++){let r=t[e];ct.prototype[r]||(ct.prototype[r]=tt.prototype[r]);}}function ct(t){if(!(this instanceof ct))return new ct(t);ra.call(this,t),tt.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0;}d0(ct.prototype,{writable:{__proto__:null,...Dt(tt.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Dt(tt.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Dt(tt.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Dt(tt.prototype,"writableBuffer")},writableLength:{__proto__:null,...Dt(tt.prototype,"writableLength")},writableFinished:{__proto__:null,...Dt(tt.prototype,"writableFinished")},writableCorked:{__proto__:null,...Dt(tt.prototype,"writableCorked")},writableEnded:{__proto__:null,...Dt(tt.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Dt(tt.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t);}}});var ea;function Gd(){return ea===void 0&&(ea={}),ea}ct.fromWeb=function(t,e){return Gd().newStreamDuplexFromReadableWritablePair(t,e)};ct.toWeb=function(t){return Gd().newReadableWritablePairFromDuplex(t)};var ta;ct.from=function(t){return ta||(ta=Hd()),ta(t,"body")};});var oa=D((LC,Qd)=>{A();x();I();var{ObjectSetPrototypeOf:Kd,Symbol:y0}=Ee();Qd.exports=jt;var{ERR_METHOD_NOT_IMPLEMENTED:g0}=De().codes,ia=St(),{getHighWaterMark:b0}=Cn();Kd(jt.prototype,ia.prototype);Kd(jt,ia);var Dn=y0("kCallback");function jt(t){if(!(this instanceof jt))return new jt(t);let e=t?b0(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ia.call(this,t),this._readableState.sync=!1,this[Dn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",w0);}function na(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t();}):(this.push(null),t&&t());}function w0(){this._final!==na&&na.call(this);}jt.prototype._final=na;jt.prototype._transform=function(t,e,r){throw new g0("_transform()")};jt.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),i.ended||s===n.length||n.length<n.highWaterMark?r():this[Dn]=r;});};jt.prototype._read=function(){if(this[Dn]){let t=this[Dn];this[Dn]=null,t();}};});var aa=D((zC,Jd)=>{A();x();I();var{ObjectSetPrototypeOf:Yd}=Ee();Jd.exports=ln;var sa=oa();Yd(ln.prototype,sa.prototype);Yd(ln,sa);function ln(t){if(!(this instanceof ln))return new ln(t);sa.call(this,t);}ln.prototype._transform=function(t,e,r){r(null,t);};});var so=D((nB,rp)=>{A();x();I();var jn=tr(),{ArrayIsArray:m0,Promise:_0,SymbolAsyncIterator:v0,SymbolDispose:S0}=Ee(),oo=Ut(),{once:E0}=$e(),A0=Ar(),Xd=St(),{aggregateTwoErrors:I0,codes:{ERR_INVALID_ARG_TYPE:ga,ERR_INVALID_RETURN_VALUE:ua,ERR_MISSING_ARGS:x0,ERR_STREAM_DESTROYED:T0,ERR_STREAM_PREMATURE_CLOSE:P0},AbortError:O0}=De(),{validateFunction:R0,validateAbortSignal:k0}=Xr(),{isIterable:Pr,isReadable:la,isReadableNodeStream:io,isNodeStream:Zd,isTransformStream:cn,isWebStream:C0,isReadableStream:ca,isReadableFinished:B0}=mt(),M0=globalThis.AbortController||Yr().AbortController,fa,ha,da;function ep(t,e,r){let n=!1;t.on("close",()=>{n=!0;});let i=oo(t,{readable:e,writable:r},s=>{n=!s;});return {destroy:s=>{n||(n=!0,A0.destroyer(t,s||new T0("pipe")));},cleanup:i}}function N0(t){return R0(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function pa(t){if(Pr(t))return t;if(io(t))return q0(t);throw new ga("val",["Readable","Iterable","AsyncIterable"],t)}async function*q0(t){ha||(ha=Nn()),yield*ha.prototype[v0].call(t);}async function no(t,e,r,{end:n}){let i,s=null,o=f=>{if(f&&(i=f),s){let h=s;s=null,h();}},a=()=>new _0((f,h)=>{i?h(i):s=()=>{i?h(i):f();};});e.on("drain",o);let c=oo(e,{readable:!1},o);try{e.writableNeedDrain&&await a();for await(let f of t)e.write(f)||await a();n&&(e.end(),await a()),r();}catch(f){r(i!==f?I0(i,f):f);}finally{c(),e.off("drain",o);}}async function ya(t,e,r,{end:n}){cn(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r();}catch(s){try{await i.abort(s),r(s);}catch(o){r(o);}}}function L0(...t){return tp(t,E0(N0(t)))}function tp(t,e,r){if(t.length===1&&m0(t[0])&&(t=t[0]),t.length<2)throw new x0("streams");let n=new M0,i=n.signal,s=r?.signal,o=[];k0(s,"options.signal");function a(){P(new O0);}da=da||$e().addAbortListener;let c;s&&(c=da(s,a));let f,h,d=[],w=0;function y(R){P(R,--w===0);}function P(R,T){var g;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!T)){for(;d.length;)d.shift()(f);(g=c)===null||g===void 0||g[S0](),n.abort(),T&&(f||o.forEach(O=>O()),jn.nextTick(e,f,h));}}let E;for(let R=0;R<t.length;R++){let T=t[R],g=R<t.length-1,O=R>0,_=g||r?.end!==!1,q=R===t.length-1;if(Zd(T)){let $=function(j){j&&j.name!=="AbortError"&&j.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y(j);};if(_){let{destroy:j,cleanup:J}=ep(T,g,O);d.push(j),la(T)&&q&&o.push(J);}T.on("error",$),la(T)&&q&&o.push(()=>{T.removeListener("error",$);});}if(R===0)if(typeof T=="function"){if(E=T({signal:i}),!Pr(E))throw new ua("Iterable, AsyncIterable or Stream","source",E)}else Pr(T)||io(T)||cn(T)?E=T:E=Xd.from(T);else if(typeof T=="function"){if(cn(E)){var b;E=pa((b=E)===null||b===void 0?void 0:b.readable);}else E=pa(E);if(E=T(E,{signal:i}),g){if(!Pr(E,!0))throw new ua("AsyncIterable",`transform[${R-1}]`,E)}else {var m;fa||(fa=aa());let $=new fa({objectMode:!0}),j=(m=E)===null||m===void 0?void 0:m.then;if(typeof j=="function")w++,j.call(E,H=>{h=H,H!=null&&$.write(H),_&&$.end(),jn.nextTick(y);},H=>{$.destroy(H),jn.nextTick(y,H);});else if(Pr(E,!0))w++,no(E,$,y,{end:_});else if(ca(E)||cn(E)){let H=E.readable||E;w++,no(H,$,y,{end:_});}else throw new ua("AsyncIterable or Promise","destination",E);E=$;let{destroy:J,cleanup:W}=ep(E,!1,!0);d.push(J),q&&o.push(W);}}else if(Zd(T)){if(io(E)){w+=2;let $=U0(E,T,y,{end:_});la(T)&&q&&o.push($);}else if(cn(E)||ca(E)){let $=E.readable||E;w++,no($,T,y,{end:_});}else if(Pr(E))w++,no(E,T,y,{end:_});else throw new ga("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],E);E=T;}else if(C0(T)){if(io(E))w++,ya(pa(E),T,y,{end:_});else if(ca(E)||Pr(E))w++,ya(E,T,y,{end:_});else if(cn(E))w++,ya(E.readable,T,y,{end:_});else throw new ga("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],E);E=T;}else E=Xd.from(T);}return (i!=null&&i.aborted||s!=null&&s.aborted)&&jn.nextTick(a),E}function U0(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new P0);}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end();};B0(t)?jn.nextTick(o):t.once("end",o);}else r();return oo(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o);}),oo(e,{readable:!1,writable:!0},r)}rp.exports={pipelineImpl:tp,pipeline:L0};});var wa=D((dB,up)=>{A();x();I();var{pipeline:D0}=so(),ao=St(),{destroyer:j0}=Ar(),{isNodeStream:uo,isReadable:np,isWritable:ip,isWebStream:ba,isTransformStream:Or,isWritableStream:op,isReadableStream:sp}=mt(),{AbortError:F0,codes:{ERR_INVALID_ARG_VALUE:ap,ERR_MISSING_ARGS:W0}}=De(),$0=Ut();up.exports=function(...e){if(e.length===0)throw new W0("streams");if(e.length===1)return ao.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=ao.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=ao.from(e[y]);}for(let y=0;y<e.length;++y)if(!(!uo(e[y])&&!ba(e[y]))){if(y<e.length-1&&!(np(e[y])||sp(e[y])||Or(e[y])))throw new ap(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(ip(e[y])||op(e[y])||Or(e[y])))throw new ap(`streams[${y}]`,r[y],"must be writable")}let n,i,s,o,a;function c(y){let P=o;o=null,P?P(y):y?a.destroy(y):!w&&!d&&a.destroy();}let f=e[0],h=D0(e,c),d=!!(ip(f)||op(f)||Or(f)),w=!!(np(h)||sp(h)||Or(h));if(a=new ao({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:w}),d){if(uo(f))a._write=function(P,E,b){f.write(P,E)?b():n=b;},a._final=function(P){f.end(),i=P;},f.on("drain",function(){if(n){let P=n;n=null,P();}});else if(ba(f)){let E=(Or(f)?f.writable:f).getWriter();a._write=async function(b,m,v){try{await E.ready,E.write(b).catch(()=>{}),v();}catch(R){v(R);}},a._final=async function(b){try{await E.ready,E.close().catch(()=>{}),i=b;}catch(m){b(m);}};}let y=Or(h)?h.readable:h;$0(y,()=>{if(i){let P=i;i=null,P();}});}if(w){if(uo(h))h.on("readable",function(){if(s){let y=s;s=null,y();}}),h.on("end",function(){a.push(null);}),a._read=function(){for(;;){let y=h.read();if(y===null){s=a._read;return}if(!a.push(y))return}};else if(ba(h)){let P=(Or(h)?h.readable:h).getReader();a._read=async function(){for(;;)try{let{value:E,done:b}=await P.read();if(!a.push(E))return;if(b){a.push(null);return}}catch{return}};}}return a._destroy=function(y,P){!y&&o!==null&&(y=new F0),s=null,n=null,i=null,o===null?P(y):(o=P,uo(h)&&j0(h,y));},a};});var wp=D((EB,va)=>{A();x();I();var H0=globalThis.AbortController||Yr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:V0,ERR_INVALID_ARG_TYPE:Fn,ERR_MISSING_ARGS:G0,ERR_OUT_OF_RANGE:z0},AbortError:Et}=De(),{validateAbortSignal:Rr,validateInteger:lp,validateObject:kr}=Xr(),K0=Ee().Symbol("kWeak"),Q0=Ee().Symbol("kResistStopPropagation"),{finished:Y0}=Ut(),J0=wa(),{addAbortSignalNoValidate:X0}=kn(),{isWritable:Z0,isNodeStream:eS}=mt(),{deprecate:tS}=$e(),{ArrayPrototypePush:rS,Boolean:nS,MathFloor:cp,Number:iS,NumberIsNaN:oS,Promise:fp,PromiseReject:hp,PromiseResolve:sS,PromisePrototypeThen:dp,Symbol:yp}=Ee(),lo=yp("kEmpty"),pp=yp("kEof");function aS(t,e){if(e!=null&&kr(e,"options"),e?.signal!=null&&Rr(e.signal,"options.signal"),eS(t)&&!Z0(t))throw new V0("stream",t,"must be writable");let r=J0(this,t);return e!=null&&e.signal&&X0(e.signal,r),r}function co(t,e){if(typeof t!="function")throw new Fn("fn",["Function","AsyncFunction"],t);e!=null&&kr(e,"options"),e?.signal!=null&&Rr(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=cp(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=cp(e.highWaterMark)),lp(r,"options.concurrency",1),lp(n,"options.highWaterMark",0),n+=r,async function*(){let s=$e().AbortSignalAny([e?.signal].filter(nS)),o=this,a=[],c={signal:s},f,h,d=!1,w=0;function y(){d=!0,P();}function P(){w-=1,E();}function E(){h&&!d&&w<r&&a.length<n&&(h(),h=null);}async function b(){try{for await(let m of o){if(d)return;if(s.aborted)throw new Et;try{if(m=t(m,c),m===lo)continue;m=sS(m);}catch(v){m=hp(v);}w+=1,dp(m,P,y),a.push(m),f&&(f(),f=null),!d&&(a.length>=n||w>=r)&&await new fp(v=>{h=v;});}a.push(pp);}catch(m){let v=hp(m);dp(v,P,y),a.push(v);}finally{d=!0,f&&(f(),f=null);}}b();try{for(;;){for(;a.length>0;){let m=await a[0];if(m===pp)return;if(s.aborted)throw new Et;m!==lo&&(yield m),a.shift(),E();}await new fp(m=>{f=m;});}}finally{d=!0,h&&(h(),h=null);}}.call(this)}function uS(t=void 0){return t!=null&&kr(t,"options"),t?.signal!=null&&Rr(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Et({cause:t.signal.reason});yield [r++,i];}}.call(this)}async function gp(t,e=void 0){for await(let r of _a.call(this,t,e))return !0;return !1}async function lS(t,e=void 0){if(typeof t!="function")throw new Fn("fn",["Function","AsyncFunction"],t);return !await gp.call(this,async(...r)=>!await t(...r),e)}async function cS(t,e){for await(let r of _a.call(this,t,e))return r}async function fS(t,e){if(typeof t!="function")throw new Fn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),lo}for await(let n of co.call(this,r,e));}function _a(t,e){if(typeof t!="function")throw new Fn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:lo}return co.call(this,r,e)}var ma=class extends G0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value";}};async function hS(t,e,r){var n;if(typeof t!="function")throw new Fn("reducer",["Function","AsyncFunction"],t);r!=null&&kr(r,"options"),r?.signal!=null&&Rr(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new Et(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Y0(this.destroy(f)),f}let s=new H0,o=s.signal;if(r!=null&&r.signal){let f={once:!0,[K0]:this,[Q0]:!0};r.signal.addEventListener("abort",()=>s.abort(),f);}let a=!1;try{for await(let f of this){var c;if(a=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new Et;i?e=await t(e,f,{signal:o}):(e=f,i=!0);}if(!a&&!i)throw new ma}finally{s.abort();}return e}async function dS(t){t!=null&&kr(t,"options"),t?.signal!=null&&Rr(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Et(void 0,{cause:t.signal.reason});rS(e,n);}return e}function pS(t,e){let r=co.call(this,t,e);return async function*(){for await(let i of r)yield*i;}.call(this)}function bp(t){if(t=iS(t),oS(t))return 0;if(t<0)throw new z0("number",">= 0",t);return t}function yS(t,e=void 0){return e!=null&&kr(e,"options"),e?.signal!=null&&Rr(e.signal,"options.signal"),t=bp(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Et;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Et;t--<=0&&(yield s);}}.call(this)}function gS(t,e=void 0){return e!=null&&kr(e,"options"),e?.signal!=null&&Rr(e.signal,"options.signal"),t=bp(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Et;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Et;if(t-- >0&&(yield s),t<=0)return}}.call(this)}va.exports.streamReturningOperators={asIndexedPairs:tS(uS,"readable.asIndexedPairs will be removed in a future version."),drop:yS,filter:_a,flatMap:pS,map:co,take:gS,compose:aS};va.exports.promiseReturningOperators={every:lS,forEach:fS,reduce:hS,toArray:dS,some:gp,find:cS};});var Sa=D((BB,mp)=>{A();x();I();var{ArrayPrototypePop:bS,Promise:wS}=Ee(),{isIterable:mS,isNodeStream:_S,isWebStream:vS}=mt(),{pipelineImpl:SS}=so(),{finished:ES}=Ut();Ea();function AS(...t){return new wS((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!_S(s)&&!mS(s)&&!vS(s)){let o=bS(t);n=o.signal,i=o.end;}SS(t,(o,a)=>{o?r(o):e(a);},{signal:n,end:i});})}mp.exports={finished:ES,pipeline:AS};});var Ea=D(($B,Pp)=>{A();x();I();var{Buffer:IS}=(ke(),me(qe)),{ObjectDefineProperty:Ft,ObjectKeys:Sp,ReflectApply:Ep}=Ee(),{promisify:{custom:Ap}}=$e(),{streamReturningOperators:_p,promiseReturningOperators:vp}=wp(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Ip}}=De(),xS=wa(),{setDefaultHighWaterMark:TS,getDefaultHighWaterMark:PS}=Cn(),{pipeline:xp}=so(),{destroyer:OS}=Ar(),Tp=Ut(),Aa=Sa(),Wn=mt(),Se=Pp.exports=$i().Stream;Se.isDestroyed=Wn.isDestroyed;Se.isDisturbed=Wn.isDisturbed;Se.isErrored=Wn.isErrored;Se.isReadable=Wn.isReadable;Se.isWritable=Wn.isWritable;Se.Readable=Nn();for(let t of Sp(_p)){let r=function(...n){if(new.target)throw Ip();return Se.Readable.from(Ep(e,this,n))},e=_p[t];Ft(r,"name",{__proto__:null,value:e.name}),Ft(r,"length",{__proto__:null,value:e.length}),Ft(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0});}for(let t of Sp(vp)){let r=function(...n){if(new.target)throw Ip();return Ep(e,this,n)},e=vp[t];Ft(r,"name",{__proto__:null,value:e.name}),Ft(r,"length",{__proto__:null,value:e.length}),Ft(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0});}Se.Writable=ro();Se.Duplex=St();Se.Transform=oa();Se.PassThrough=aa();Se.pipeline=xp;var{addAbortSignal:RS}=kn();Se.addAbortSignal=RS;Se.finished=Tp;Se.destroy=OS;Se.compose=xS;Se.setDefaultHighWaterMark=TS;Se.getDefaultHighWaterMark=PS;Ft(Se,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Aa}});Ft(xp,Ap,{__proto__:null,enumerable:!0,get(){return Aa.pipeline}});Ft(Tp,Ap,{__proto__:null,enumerable:!0,get(){return Aa.finished}});Se.Stream=Se;Se._isUint8Array=function(e){return e instanceof Uint8Array};Se._uint8ArrayToBuffer=function(e){return IS.from(e.buffer,e.byteOffset,e.byteLength)};});var or=D((ZB,Pe)=>{A();x();I();var Be=Ea(),kS=Sa(),CS=Be.Readable.destroy;Pe.exports=Be.Readable;Pe.exports._uint8ArrayToBuffer=Be._uint8ArrayToBuffer;Pe.exports._isUint8Array=Be._isUint8Array;Pe.exports.isDisturbed=Be.isDisturbed;Pe.exports.isErrored=Be.isErrored;Pe.exports.isReadable=Be.isReadable;Pe.exports.Readable=Be.Readable;Pe.exports.Writable=Be.Writable;Pe.exports.Duplex=Be.Duplex;Pe.exports.Transform=Be.Transform;Pe.exports.PassThrough=Be.PassThrough;Pe.exports.addAbortSignal=Be.addAbortSignal;Pe.exports.finished=Be.finished;Pe.exports.destroy=Be.destroy;Pe.exports.destroy=CS;Pe.exports.pipeline=Be.pipeline;Pe.exports.compose=Be.compose;Object.defineProperty(Be,"promises",{configurable:!0,enumerable:!0,get(){return kS}});Pe.exports.Stream=Be.Stream;Pe.exports.default=Pe.exports;});var Op=D((lM,Ia)=>{A();x();I();typeof Object.create=="function"?Ia.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}:Ia.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e;}};});var Cp=D((mM,kp)=>{A();x();I();var{Buffer:ft}=(ke(),me(qe)),Rp=Symbol.for("BufferList");function we(t){if(!(this instanceof we))return new we(t);we._init.call(this,t);}we._init=function(e){Object.defineProperty(this,Rp,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e);};we.prototype._new=function(e){return new we(e)};we.prototype._offset=function(e){if(e===0)return [0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let i=r+this._bufs[n].length;if(e<i||n===this._bufs.length-1)return [n,e-r];r=i;}};we.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r};we.prototype.getBuffers=function(){return this._bufs};we.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};we.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};we.prototype.copy=function(e,r,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||ft.alloc(0);let s=!!e,o=this._offset(n),a=i-n,c=a,f=s&&r||0,h=o[1];if(n===0&&i===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:ft.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(e,f),f+=this._bufs[d].length;return e}if(c<=this._bufs[o[0]].length-h)return s?this._bufs[o[0]].copy(e,r,h,h+c):this._bufs[o[0]].slice(h,h+c);s||(e=ft.allocUnsafe(a));for(let d=o[0];d<this._bufs.length;d++){let w=this._bufs[d].length-h;if(c>w)this._bufs[d].copy(e,f,h),f+=w;else {this._bufs[d].copy(e,f,h,h+c),f+=w;break}c-=w,h&&(h=0);}return e.length>f?e.slice(0,f):e};we.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let n=this._offset(e),i=this._offset(r),s=this._bufs.slice(n[0],i[0]+1);return i[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,i[1]),n[1]!==0&&(s[0]=s[0].slice(n[1])),this._new(s)};we.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};we.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else {this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};we.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};we.prototype.append=function(e){return this._attach(e,we.prototype._appendBuffer)};we.prototype.prepend=function(e){return this._attach(e,we.prototype._prependBuffer,!0)};we.prototype._attach=function(e,r,n){if(e==null)return this;if(e.buffer)r.call(this,ft.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[i,s]=n?[e.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e.length;o+=s)this._attach(e[o],r,n);}else if(this._isBufferList(e)){let[i,s]=n?[e._bufs.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e._bufs.length;o+=s)this._attach(e._bufs[o],r,n);}else typeof e=="number"&&(e=e.toString()),r.call(this,ft.from(e));return this};we.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length;};we.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length;};we.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=ft.from([t]):typeof t=="string"?t=ft.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=ft.from(t.buffer,t.byteOffset,t.byteLength):ft.isBuffer(t)||(t=ft.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let n=this._offset(e),i=n[0],s=n[1];for(;i<this._bufs.length;i++){let o=this._bufs[i];for(;s<o.length;)if(o.length-s>=t.length){let c=o.indexOf(t,s);if(c!==-1)return this._reverseOffset([i,c]);s=o.length-t.length+1;}else {let c=this._reverseOffset([i,s]);if(this._match(c,t))return c;s++;}s=0;}return -1};we.prototype._match=function(t,e){if(this.length-t<e.length)return !1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return !1;return !0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?we.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:we.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)};})(e);})();we.prototype._isBufferList=function(e){return e instanceof we||we.isBufferList(e)};we.isBufferList=function(e){return e!=null&&e[Rp]};kp.exports=we;});var Bp=D((OM,fo)=>{A();x();I();var xa=or().Duplex,BS=Op(),$n=Cp();function Fe(t){if(!(this instanceof Fe))return new Fe(t);if(typeof t=="function"){this._callback=t;let e=function(n){this._callback&&(this._callback(n),this._callback=null);}.bind(this);this.on("pipe",function(n){n.on("error",e);}),this.on("unpipe",function(n){n.removeListener("error",e);}),t=null;}$n._init.call(this,t),xa.call(this);}BS(Fe,xa);Object.assign(Fe.prototype,$n.prototype);Fe.prototype._new=function(e){return new Fe(e)};Fe.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n();};Fe.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e);};Fe.prototype.end=function(e){xa.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null);};Fe.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e);};Fe.prototype._isBufferList=function(e){return e instanceof Fe||e instanceof $n||Fe.isBufferList(e)};Fe.isBufferList=$n.isBufferList;fo.exports=Fe;fo.exports.BufferListStream=Fe;fo.exports.BufferList=$n;});var Np=D((DM,Mp)=>{A();x();I();var Ta=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null;}};Mp.exports=Ta;});var Pa=D((QM,qp)=>{A();x();I();var z=qp.exports,{Buffer:Ke}=(ke(),me(qe));z.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"};z.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0};z.requiredHeaderFlagsErrors={};for(let t in z.requiredHeaderFlags){let e=z.requiredHeaderFlags[t];z.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+z.types[t]+" packet";}z.codes={};for(let t in z.types){let e=z.types[t];z.codes[e]=t;}z.CMD_SHIFT=4;z.CMD_MASK=240;z.DUP_MASK=8;z.QOS_MASK=3;z.QOS_SHIFT=1;z.RETAIN_MASK=1;z.VARBYTEINT_MASK=127;z.VARBYTEINT_FIN_MASK=128;z.VARBYTEINT_MAX=268435455;z.SESSIONPRESENT_MASK=1;z.SESSIONPRESENT_HEADER=Ke.from([z.SESSIONPRESENT_MASK]);z.CONNACK_HEADER=Ke.from([z.codes.connack<<z.CMD_SHIFT]);z.USERNAME_MASK=128;z.PASSWORD_MASK=64;z.WILL_RETAIN_MASK=32;z.WILL_QOS_MASK=24;z.WILL_QOS_SHIFT=3;z.WILL_FLAG_MASK=4;z.CLEAN_SESSION_MASK=2;z.CONNECT_HEADER=Ke.from([z.codes.connect<<z.CMD_SHIFT]);z.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11};z.propertiesCodes={};for(let t in z.properties){let e=z.properties[t];z.propertiesCodes[e]=t;}z.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function sr(t){return [0,1,2].map(e=>[0,1].map(r=>[0,1].map(n=>{let i=Ke.alloc(1);return i.writeUInt8(z.codes[t]<<z.CMD_SHIFT|(r?z.DUP_MASK:0)|e<<z.QOS_SHIFT|n,0,!0),i})))}z.PUBLISH_HEADER=sr("publish");z.SUBSCRIBE_HEADER=sr("subscribe");z.SUBSCRIBE_OPTIONS_QOS_MASK=3;z.SUBSCRIBE_OPTIONS_NL_MASK=1;z.SUBSCRIBE_OPTIONS_NL_SHIFT=2;z.SUBSCRIBE_OPTIONS_RAP_MASK=1;z.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;z.SUBSCRIBE_OPTIONS_RH_MASK=3;z.SUBSCRIBE_OPTIONS_RH_SHIFT=4;z.SUBSCRIBE_OPTIONS_RH=[0,16,32];z.SUBSCRIBE_OPTIONS_NL=4;z.SUBSCRIBE_OPTIONS_RAP=8;z.SUBSCRIBE_OPTIONS_QOS=[0,1,2];z.UNSUBSCRIBE_HEADER=sr("unsubscribe");z.ACKS={unsuback:sr("unsuback"),puback:sr("puback"),pubcomp:sr("pubcomp"),pubrel:sr("pubrel"),pubrec:sr("pubrec")};z.SUBACK_HEADER=Ke.from([z.codes.suback<<z.CMD_SHIFT]);z.VERSION3=Ke.from([3]);z.VERSION4=Ke.from([4]);z.VERSION5=Ke.from([5]);z.VERSION131=Ke.from([131]);z.VERSION132=Ke.from([132]);z.QOS=[0,1,2].map(t=>Ke.from([t]));z.EMPTY={pingreq:Ke.from([z.codes.pingreq<<4,0]),pingresp:Ke.from([z.codes.pingresp<<4,0]),disconnect:Ke.from([z.codes.disconnect<<4,0])};z.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"};z.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};z.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};z.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"};z.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};z.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"};});var Up=D((o2,Lp)=>{A();x();I();var fn=1e3,hn=fn*60,dn=hn*60,Cr=dn*24,MS=Cr*7,NS=Cr*365.25;Lp.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return qS(t);if(r==="number"&&isFinite(t))return e.long?US(t):LS(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function qS(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*NS;case"weeks":case"week":case"w":return r*MS;case"days":case"day":case"d":return r*Cr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*dn;case"minutes":case"minute":case"mins":case"min":case"m":return r*hn;case"seconds":case"second":case"secs":case"sec":case"s":return r*fn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function LS(t){var e=Math.abs(t);return e>=Cr?Math.round(t/Cr)+"d":e>=dn?Math.round(t/dn)+"h":e>=hn?Math.round(t/hn)+"m":e>=fn?Math.round(t/fn)+"s":t+"ms"}function US(t){var e=Math.abs(t);return e>=Cr?ho(t,e,Cr,"day"):e>=dn?ho(t,e,dn,"hour"):e>=hn?ho(t,e,hn,"minute"):e>=fn?ho(t,e,fn,"second"):t+" ms"}function ho(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var jp=D((y2,Dp)=>{A();x();I();function DS(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=Up(),r.destroy=f,Object.keys(t).forEach(h=>{r[h]=t[h];}),r.names=[],r.skips=[],r.formatters={};function e(h){let d=0;for(let w=0;w<h.length;w++)d=(d<<5)-d+h.charCodeAt(w),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(h){let d,w=null,y,P;function E(...b){if(!E.enabled)return;let m=E,v=Number(new Date),R=v-(d||v);m.diff=R,m.prev=d,m.curr=v,d=v,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,_)=>{if(O==="%%")return "%";T++;let q=r.formatters[_];if(typeof q=="function"){let $=b[T];O=q.call(m,$),b.splice(T,1),T--;}return O}),r.formatArgs.call(m,b),(m.log||r.log).apply(m,b);}return E.namespace=h,E.useColors=r.useColors(),E.color=r.selectColor(h),E.extend=n,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(y!==r.namespaces&&(y=r.namespaces,P=r.enabled(h)),P),set:b=>{w=b;}}),typeof r.init=="function"&&r.init(E),E}function n(h,d){let w=r(this.namespace+(typeof d>"u"?":":d)+h);return w.log=this.log,w}function i(h){r.save(h),r.namespaces=h,r.names=[],r.skips=[];let d=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let w of d)w[0]==="-"?r.skips.push(w.slice(1)):r.names.push(w);}function s(h,d){let w=0,y=0,P=-1,E=0;for(;w<h.length;)if(y<d.length&&(d[y]===h[w]||d[y]==="*"))d[y]==="*"?(P=y,E=w,y++):(w++,y++);else if(P!==-1)y=P+1,E++,w=E;else return !1;for(;y<d.length&&d[y]==="*";)y++;return y===d.length}function o(){let h=[...r.names,...r.skips.map(d=>"-"+d)].join(",");return r.enable(""),h}function a(h){for(let d of r.skips)if(s(h,d))return !1;for(let d of r.names)if(s(h,d))return !0;return !1}function c(h){return h instanceof Error?h.stack||h.message:h}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return r.enable(r.load()),r}Dp.exports=DS;});var At=D((Qe,po)=>{A();x();I();Qe.formatArgs=FS;Qe.save=WS;Qe.load=$S;Qe.useColors=jS;Qe.storage=HS();Qe.destroy=(()=>{let t=!1;return ()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();Qe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function jS(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return !0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return !1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function FS(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+po.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r));}),t.splice(n,0,e);}Qe.log=console.debug||console.log||(()=>{});function WS(t){try{t?Qe.storage.setItem("debug",t):Qe.storage.removeItem("debug");}catch{}}function $S(){let t;try{t=Qe.storage.getItem("debug")||Qe.storage.getItem("DEBUG");}catch{}return !t&&typeof M<"u"&&"env"in M&&(t=M.env.DEBUG),t}function HS(){try{return localStorage}catch{}}po.exports=jp()(Qe);var{formatters:VS}=po.exports;VS.j=function(t){try{return JSON.stringify(t)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});var $p=D((M2,Wp)=>{A();x();I();var GS=Bp(),{EventEmitter:zS}=(er(),me(Zt)),Fp=Np(),de=Pa(),ae=At()("mqtt-packet:parser"),Oa=class t extends zS{constructor(){super(),this.parser=this.constructor.parser;}static parser(e){return this instanceof t?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new t().parser(e)}_resetState(){ae("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new Fp,this.error=null,this._list=GS(),this._stateCounter=0;}parse(e){for(this.error&&this._resetState(),this._list.append(e),ae("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,ae("parse: state complete. _stateCounter is now: %d",this._stateCounter),ae("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return ae("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),r=e>>de.CMD_SHIFT;this.packet.cmd=de.types[r];let n=e&15,i=de.requiredHeaderFlags[r];return i!=null&&n!==i?this._emitError(new Error(de.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&de.RETAIN_MASK)!==0,this.packet.qos=e>>de.QOS_SHIFT&de.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&de.DUP_MASK)!==0,ae("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),ae("_parseLength %d",e.value),!!e}_parsePayload(){ae("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"));}e=!0;}return ae("_parsePayload complete result: %s",e),e}_parseConnect(){ae("_parseConnect");let e,r,n,i,s={},o=this.packet,a=this._parseString();if(a===null)return this._emitError(new Error("Cannot parse protocolId"));if(a!=="MQTT"&&a!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=a,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),o.protocolVersion!==3&&o.protocolVersion!==4&&o.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));s.username=this._list.readUInt8(this._pos)&de.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&de.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&de.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&de.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&de.WILL_QOS_MASK)>>de.WILL_QOS_SHIFT;if(s.will)o.will={},o.will.retain=c,o.will.qos=f;else {if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(f)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(o.clean=(this._list.readUInt8(this._pos)&de.CLEAN_SESSION_MASK)!==0,this._pos++,o.keepalive=this._parseNum(),o.keepalive===-1)return this._emitError(new Error("Packet too short"));if(o.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(o.properties=d);}let h=this._parseString();if(h===null)return this._emitError(new Error("Packet too short"));if(o.clientId=h,ae("_parseConnect: packet.clientId: %s",o.clientId),s.will){if(o.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(o.will.properties=d);}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,ae("_parseConnect: packet.will.topic: %s",o.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=r,ae("_parseConnect: packet.will.paylaod: %s",o.will.payload);}if(s.username){if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse username"));o.username=i,ae("_parseConnect: packet.username: %s",o.username);}if(s.password){if(n=this._parseBuffer(),n===null)return this._emitError(new Error("Cannot parse password"));o.password=n;}return this.settings=o,ae("_parseConnect: complete"),o}_parseConnack(){ae("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let r=this._list.readUInt8(this._pos++);if(r>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(r&de.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else {if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++);}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let n=this._parseProperties();Object.getOwnPropertyNames(n).length&&(e.properties=n);}ae("_parseConnack: complete");}_parsePublish(){ae("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}e.payload=this._list.slice(this._pos,e.length),ae("_parsePublish: payload from buffer list: %o",e.payload);}}_parseSubscribe(){ae("_parseSubscribe");let e=this.packet,r,n,i,s,o,a,c;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(e.properties=f);}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(r=this._parseString(),r===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(n=this._parseByte(),this.settings.protocolVersion===5){if(n&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(n&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(i=n&de.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(n>>de.SUBSCRIBE_OPTIONS_NL_SHIFT&de.SUBSCRIBE_OPTIONS_NL_MASK)!==0,o=(n>>de.SUBSCRIBE_OPTIONS_RAP_SHIFT&de.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,s=n>>de.SUBSCRIBE_OPTIONS_RH_SHIFT&de.SUBSCRIBE_OPTIONS_RH_MASK,s>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:r,qos:i},this.settings.protocolVersion===5?(c.nl=a,c.rap=o,c.rh=s):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),ae("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c);}}}_parseSuback(){ae("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let r=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!de.MQTT5_SUBACK_CODES[r])return this._emitError(new Error("Invalid suback code"))}else if(r>2&&r!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(r);}}}_parseUnsubscribe(){ae("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let r=this._parseString();if(r===null)return this._emitError(new Error("Cannot parse topic"));ae("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r);}}}_parseUnsuback(){ae("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&e.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let r=this._parseProperties();for(Object.getOwnPropertyNames(r).length&&(e.properties=r),e.granted=[];this._pos<this.packet.length;){let n=this._list.readUInt8(this._pos++);if(!de.MQTT5_UNSUBACK_CODES[n])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(n);}}}_parseConfirmation(){ae("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!de.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!de.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}ae("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode);}else e.reasonCode=0;if(e.length>3){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}}return !0}_parseDisconnect(){let e=this.packet;if(ae("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),de.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r);}return ae("_parseDisconnect result: true"),!0}_parseAuth(){ae("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!de.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let r=this._parseProperties();return Object.getOwnPropertyNames(r).length&&(e.properties=r),ae("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(ae("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),n=r+this._pos;if(r===-1||n>this._list.length||n>this.packet.length)return null;let i=this._list.toString("utf8",this._pos,n);return this._pos+=r,ae("_parseString: result: %s",i),i}_parseStringPair(){return ae("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),r=e+this._pos;if(e===-1||r>this._list.length||r>this.packet.length)return null;let n=this._list.slice(this._pos,r);return this._pos+=e,ae("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return -1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,ae("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return -1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,ae("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){ae("_parseVarByteNum");let r=4,n=0,i=1,s=0,o=!1,a,c=this._pos?this._pos:0;for(;n<r&&c+n<this._list.length;){if(a=this._list.readUInt8(c+n++),s+=i*(a&de.VARBYTEINT_MASK),i*=128,(a&de.VARBYTEINT_FIN_MASK)===0){o=!0;break}if(this._list.length<=n)break}return !o&&n===r&&this._list.length>=n&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=n),o?e?o={bytes:n,value:s}:o=s:o=!1,ae("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),ae("_parseByte: result: %o",e),e}_parseByType(e){switch(ae("_parseByType: type: %s",e),e){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){ae("_parseProperties");let e=this._parseVarByteNum(),n=this._pos+e,i={};for(;this._pos<n;){let s=this._parseByte();if(!s)return this._emitError(new Error("Cannot parse property code type")),!1;let o=de.propertiesCodes[s];if(!o)return this._emitError(new Error("Unknown property")),!1;if(o==="userProperties"){i[o]||(i[o]=Object.create(null));let a=this._parseByType(de.propertiesTypes[o]);if(i[o][a.name])if(Array.isArray(i[o][a.name]))i[o][a.name].push(a.value);else {let c=i[o][a.name];i[o][a.name]=[c],i[o][a.name].push(a.value);}else i[o][a.name]=a.value;continue}i[o]?Array.isArray(i[o])?i[o].push(this._parseByType(de.propertiesTypes[o])):(i[o]=[i[o]],i[o].push(this._parseByType(de.propertiesTypes[o]))):i[o]=this._parseByType(de.propertiesTypes[o]);}return i}_newPacket(){return ae("_newPacket"),this.packet&&(this._list.consume(this.packet.length),ae("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),ae("_newPacket: new packet"),this.packet=new Fp,this._pos=0,!0}_emitError(e){ae("_emitError",e),this.error=e,this.emit("error",e);}};Wp.exports=Oa;});var zp=D((H2,Gp)=>{A();x();I();var{Buffer:Hn}=(ke(),me(qe)),KS=65536,Hp={},QS=Hn.isBuffer(Hn.from([1,2]).subarray(0,1));function Vp(t){let e=Hn.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,1),e}function YS(){for(let t=0;t<KS;t++)Hp[t]=Vp(t);}function JS(t){let r=0,n=0,i=Hn.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),i.writeUInt8(r,n++);while(t>0&&n<4);return t>0&&(n=0),QS?i.subarray(0,n):i.slice(0,n)}function XS(t){let e=Hn.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Gp.exports={cache:Hp,generateCache:YS,generateNumber:Vp,genBufVariableByteInt:JS,generate4ByteBuffer:XS};});var Kp=D((eN,Ra)=>{A();x();I();typeof M>"u"||!M.version||M.version.indexOf("v0.")===0||M.version.indexOf("v1.")===0&&M.version.indexOf("v1.8.")!==0?Ra.exports={nextTick:ZS}:Ra.exports=M;function ZS(t,e,r,n){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,s,o;switch(i){case 0:case 1:return M.nextTick(t);case 2:return M.nextTick(function(){t.call(null,e);});case 3:return M.nextTick(function(){t.call(null,e,r);});case 4:return M.nextTick(function(){t.call(null,e,r,n);});default:for(s=new Array(i-1),o=0;o<s.length;)s[o++]=arguments[o];return M.nextTick(function(){t.apply(null,s);})}}});var Ba=D((cN,ry)=>{A();x();I();var ue=Pa(),{Buffer:se}=(ke(),me(qe)),eE=se.allocUnsafe(0),tE=se.from([0]),Vn=zp(),rE=Kp().nextTick,rt=At()("mqtt-packet:writeToStream"),yo=Vn.cache,nE=Vn.generateNumber,iE=Vn.generateCache,ka=Vn.genBufVariableByteInt,oE=Vn.generate4ByteBuffer,He=Ca,go=!0;function ey(t,e,r){switch(rt("generate called"),e.cork&&(e.cork(),rE(sE,e)),go&&(go=!1,iE()),rt("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return aE(t,e);case"connack":return uE(t,e,r);case"publish":return lE(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return cE(t,e,r);case"subscribe":return fE(t,e,r);case"suback":return hE(t,e,r);case"unsubscribe":return dE(t,e,r);case"unsuback":return pE(t,e,r);case"pingreq":case"pingresp":return yE(t,e);case"disconnect":return gE(t,e,r);case"auth":return bE(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(ey,"cacheNumbers",{get(){return He===Ca},set(t){t?((!yo||Object.keys(yo).length===0)&&(go=!0),He=Ca):(go=!1,He=wE);}});function sE(t){t.uncork();}function aE(t,e,r){let n=t||{},i=n.protocolId||"MQTT",s=n.protocolVersion||4,o=n.will,a=n.clean,c=n.keepalive||0,f=n.clientId||"",h=n.username,d=n.password,w=n.properties;a===void 0&&(a=!0);let y=0;if(!i||typeof i!="string"&&!se.isBuffer(i))return e.destroy(new Error("Invalid protocolId")),!1;if(y+=i.length+2,s!==3&&s!==4&&s!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(y+=1,(typeof f=="string"||se.isBuffer(f))&&(f||s>=4)&&(f||a))y+=se.byteLength(f)+2;else {if(s<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(a*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof c!="number"||c<0||c>65535||c%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;y+=2,y+=1;let P,E;if(s===5){if(P=ar(e,w),!P)return !1;y+=P.length;}if(o){if(typeof o!="object")return e.destroy(new Error("Invalid will")),!1;if(!o.topic||typeof o.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(y+=se.byteLength(o.topic)+2,y+=2,o.payload)if(o.payload.length>=0)typeof o.payload=="string"?y+=se.byteLength(o.payload):y+=o.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(E={},s===5){if(E=ar(e,o.properties),!E)return !1;y+=E.length;}}let b=!1;if(h!=null)if(Zp(h))b=!0,y+=se.byteLength(h)+2;else return e.destroy(new Error("Invalid username")),!1;if(d!=null){if(!b)return e.destroy(new Error("Username is required to use password")),!1;if(Zp(d))y+=ty(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(ue.CONNECT_HEADER),nt(e,y),pn(e,i),n.bridgeMode&&(s+=128),e.write(s===131?ue.VERSION131:s===132?ue.VERSION132:s===4?ue.VERSION4:s===5?ue.VERSION5:ue.VERSION3);let m=0;return m|=h!=null?ue.USERNAME_MASK:0,m|=d!=null?ue.PASSWORD_MASK:0,m|=o&&o.retain?ue.WILL_RETAIN_MASK:0,m|=o&&o.qos?o.qos<<ue.WILL_QOS_SHIFT:0,m|=o?ue.WILL_FLAG_MASK:0,m|=a?ue.CLEAN_SESSION_MASK:0,e.write(se.from([m])),He(e,c),s===5&&P.write(),pn(e,f),o&&(s===5&&E.write(),Br(e,o.topic),pn(e,o.payload)),h!=null&&pn(e,h),d!=null&&pn(e,d),!0}function uE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=n===5?i.reasonCode:i.returnCode,o=i.properties,a=2;if(typeof s!="number")return e.destroy(new Error("Invalid return code")),!1;let c=null;if(n===5){if(c=ar(e,o),!c)return !1;a+=c.length;}return e.write(ue.CONNACK_HEADER),nt(e,a),e.write(i.sessionPresent?ue.SESSIONPRESENT_HEADER:tE),e.write(se.from([s])),c?.write(),!0}function lE(t,e,r){rt("publish: packet: %o",t);let n=r?r.protocolVersion:4,i=t||{},s=i.qos||0,o=i.retain?ue.RETAIN_MASK:0,a=i.topic,c=i.payload||eE,f=i.messageId,h=i.properties,d=0;if(typeof a=="string")d+=se.byteLength(a)+2;else if(se.isBuffer(a))d+=a.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(se.isBuffer(c)?d+=c.length:d+=se.byteLength(c),s&&typeof f!="number")return e.destroy(new Error("Invalid messageId")),!1;s&&(d+=2);let w=null;if(n===5){if(w=ar(e,h),!w)return !1;d+=w.length;}return e.write(ue.PUBLISH_HEADER[s][i.dup?1:0][o?1:0]),nt(e,d),He(e,ty(a)),e.write(a),s>0&&He(e,f),w?.write(),rt("publish: payload: %o",c),e.write(c)}function cE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.cmd||"puback",o=i.messageId,a=i.dup&&s==="pubrel"?ue.DUP_MASK:0,c=0,f=i.reasonCode,h=i.properties,d=n===5?3:2;if(s==="pubrel"&&(c=1),typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;let w=null;if(n===5&&typeof h=="object"){if(w=Gn(e,h,r,d),!w)return !1;d+=w.length;}return e.write(ue.ACKS[s][c][a][0]),d===3&&(d+=f!==0?1:-1),nt(e,d),He(e,o),n===5&&d!==2&&e.write(se.from([f])),w!==null?w.write():d===4&&e.write(se.from([0])),!0}function fE(t,e,r){rt("subscribe: packet: ");let n=r?r.protocolVersion:4,i=t||{},s=i.dup?ue.DUP_MASK:0,o=i.messageId,a=i.subscriptions,c=i.properties,f=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;f+=2;let h=null;if(n===5){if(h=ar(e,c),!h)return !1;f+=h.length;}if(typeof a=="object"&&a.length)for(let w=0;w<a.length;w+=1){let y=a[w].topic,P=a[w].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof P!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(n===5){if(typeof(a[w].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(a[w].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let m=a[w].rh||0;if(typeof m!="number"||m>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=se.byteLength(y)+2+1;}else return e.destroy(new Error("Invalid subscriptions")),!1;rt("subscribe: writing to stream: %o",ue.SUBSCRIBE_HEADER),e.write(ue.SUBSCRIBE_HEADER[1][s?1:0][0]),nt(e,f),He(e,o),h!==null&&h.write();let d=!0;for(let w of a){let y=w.topic,P=w.qos,E=+w.nl,b=+w.rap,m=w.rh,v;Br(e,y),v=ue.SUBSCRIBE_OPTIONS_QOS[P],n===5&&(v|=E?ue.SUBSCRIBE_OPTIONS_NL:0,v|=b?ue.SUBSCRIBE_OPTIONS_RAP:0,v|=m?ue.SUBSCRIBE_OPTIONS_RH[m]:0),d=e.write(se.from([v]));}return d}function hE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.granted,a=i.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof o=="object"&&o.length)for(let h=0;h<o.length;h+=1){if(typeof o[h]!="number")return e.destroy(new Error("Invalid qos vector")),!1;c+=1;}else return e.destroy(new Error("Invalid qos vector")),!1;let f=null;if(n===5){if(f=Gn(e,a,r,c),!f)return !1;c+=f.length;}return e.write(ue.SUBACK_HEADER),nt(e,c),He(e,s),f!==null&&f.write(),e.write(se.from(o))}function dE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,a=i.unsubscriptions,c=i.properties,f=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(f+=2,typeof a=="object"&&a.length)for(let w=0;w<a.length;w+=1){if(typeof a[w]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;f+=se.byteLength(a[w])+2;}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let h=null;if(n===5){if(h=ar(e,c),!h)return !1;f+=h.length;}e.write(ue.UNSUBSCRIBE_HEADER[1][o?1:0][0]),nt(e,f),He(e,s),h!==null&&h.write();let d=!0;for(let w=0;w<a.length;w++)d=Br(e,a[w]);return d}function pE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,a=i.granted,c=i.properties,f=i.cmd,h=0,d=2;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(n===5)if(typeof a=="object"&&a.length)for(let y=0;y<a.length;y+=1){if(typeof a[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1;}else return e.destroy(new Error("Invalid qos vector")),!1;let w=null;if(n===5){if(w=Gn(e,c,r,d),!w)return !1;d+=w.length;}return e.write(ue.ACKS[f][h][o][0]),nt(e,d),He(e,s),w!==null&&w.write(),n===5&&e.write(se.from(a)),!0}function yE(t,e,r){return e.write(ue.EMPTY[t.cmd])}function gE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,a=n===5?1:0,c=null;if(n===5){if(c=Gn(e,o,r,a),!c)return !1;a+=c.length;}return e.write(se.from([ue.codes.disconnect<<4])),nt(e,a),n===5&&e.write(se.from([s])),c!==null&&c.write(),!0}function bE(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,a=n===5?1:0;n!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let c=Gn(e,o,r,a);return c?(a+=c.length,e.write(se.from([ue.codes.auth<<4])),nt(e,a),e.write(se.from([s])),c!==null&&c.write(),!0):!1}var Qp={};function nt(t,e){if(e>ue.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Qp[e];return r||(r=ka(e),e<16384&&(Qp[e]=r)),rt("writeVarByteInt: writing to stream: %o",r),t.write(r)}function Br(t,e){let r=se.byteLength(e);return He(t,r),rt("writeString: %s",e),t.write(e,"utf8")}function Yp(t,e,r){Br(t,e),Br(t,r);}function Ca(t,e){return rt("writeNumberCached: number: %d",e),rt("writeNumberCached: %o",yo[e]),t.write(yo[e])}function wE(t,e){let r=nE(e);return rt("writeNumberGenerated: %o",r),t.write(r)}function mE(t,e){let r=oE(e);return rt("write4ByteNumber: %o",r),t.write(r)}function pn(t,e){typeof e=="string"?Br(t,e):e?(He(t,e.length),t.write(e)):He(t,0);}function ar(t,e){if(typeof e!="object"||e.length!=null)return {length:1,write(){Xp(t,{},0);}};let r=0;function n(s,o){let a=ue.propertiesTypes[s],c=0;switch(a){case"byte":{if(typeof o!="boolean")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"int8":{if(typeof o!="number"||o<0||o>255)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"binary":{if(o&&o===null)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(o)+2;break}case"int16":{if(typeof o!="number"||o<0||o>65535)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3;break}case"int32":{if(typeof o!="number"||o<0||o>4294967295)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=5;break}case"var":{if(typeof o!="number"||o<0||o>268435455)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(ka(o));break}case"string":{if(typeof o!="string")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3+se.byteLength(o.toString());break}case"pair":{if(typeof o!="object")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=Object.getOwnPropertyNames(o).reduce((f,h)=>{let d=o[h];return Array.isArray(d)?f+=d.reduce((w,y)=>(w+=3+se.byteLength(h.toString())+2+se.byteLength(y.toString()),w),0):f+=3+se.byteLength(h.toString())+2+se.byteLength(o[h].toString()),f},0);break}default:return t.destroy(new Error(`Invalid property ${s}: ${o}`)),!1}return c}if(e)for(let s in e){let o=0,a=0,c=e[s];if(c!==void 0){if(Array.isArray(c))for(let f=0;f<c.length;f++){if(a=n(s,c[f]),!a)return !1;o+=a;}else {if(a=n(s,c),!a)return !1;o=a;}if(!o)return !1;r+=o;}}return {length:se.byteLength(ka(r))+r,write(){Xp(t,e,r);}}}function Gn(t,e,r,n){let i=["reasonString","userProperties"],s=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,o=ar(t,e);if(s)for(;n+o.length>s;){let a=i.shift();if(a&&e[a])delete e[a],o=ar(t,e);else return !1}return o}function Jp(t,e,r){switch(ue.propertiesTypes[e]){case"byte":{t.write(se.from([ue.properties[e]])),t.write(se.from([+r]));break}case"int8":{t.write(se.from([ue.properties[e]])),t.write(se.from([r]));break}case"binary":{t.write(se.from([ue.properties[e]])),pn(t,r);break}case"int16":{t.write(se.from([ue.properties[e]])),He(t,r);break}case"int32":{t.write(se.from([ue.properties[e]])),mE(t,r);break}case"var":{t.write(se.from([ue.properties[e]])),nt(t,r);break}case"string":{t.write(se.from([ue.properties[e]])),Br(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(i=>{let s=r[i];Array.isArray(s)?s.forEach(o=>{t.write(se.from([ue.properties[e]])),Yp(t,i.toString(),o.toString());}):(t.write(se.from([ue.properties[e]])),Yp(t,i.toString(),s.toString()));});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Xp(t,e,r){nt(t,r);for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!=null){let i=e[n];if(Array.isArray(i))for(let s=0;s<i.length;s++)Jp(t,n,i[s]);else Jp(t,n,i);}}function ty(t){return t?t instanceof se?t.length:se.byteLength(t):0}function Zp(t){return typeof t=="string"||t instanceof se}ry.exports=ey;});var oy=D((_N,iy)=>{A();x();I();var _E=Ba(),{EventEmitter:vE}=(er(),me(Zt)),{Buffer:ny}=(ke(),me(qe));function SE(t,e){let r=new Ma;return _E(t,r,e),r.concat()}var Ma=class extends vE{constructor(){super(),this._array=new Array(20),this._i=0;}write(e){return this._array[this._i++]=e,!0}concat(){let e=0,r=new Array(this._array.length),n=this._array,i=0,s;for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?r[s]=n[s].length:r[s]=ny.byteLength(n[s]),e+=r[s];let o=ny.allocUnsafe(e);for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?(n[s].copy(o,i),i+=r[s]):(o.write(n[s],i),i+=r[s]);return o}destroy(e){e&&this.emit("error",e);}};iy.exports=SE;});var sy=D(bo=>{A();x();I();bo.parser=$p().parser;bo.generate=oy();bo.writeToStream=Ba();});var uy=D((jN,ay)=>{A();x();I();ay.exports=EE;function yn(t){return t instanceof U?U.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function EE(t){if(t=t||{},t.circles)return AE(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,a)=>new Map(n(Array.from(o),a))),e.set(Set,(o,a)=>new Set(n(Array.from(o),a))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?s:i;function n(o,a){let c=Object.keys(o),f=new Array(c.length);for(let h=0;h<c.length;h++){let d=c[h],w=o[d];typeof w!="object"||w===null?f[d]=w:w.constructor!==Object&&(r=e.get(w.constructor))?f[d]=r(w,a):ArrayBuffer.isView(w)?f[d]=yn(w):f[d]=a(w);}return f}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let a={};for(let c in o){if(Object.hasOwnProperty.call(o,c)===!1)continue;let f=o[c];typeof f!="object"||f===null?a[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?a[c]=r(f,i):ArrayBuffer.isView(f)?a[c]=yn(f):a[c]=i(f);}return a}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let a={};for(let c in o){let f=o[c];typeof f!="object"||f===null?a[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?a[c]=r(f,s):ArrayBuffer.isView(f)?a[c]=yn(f):a[c]=s(f);}return a}}function AE(t){let e=[],r=[],n=new Map;if(n.set(Date,c=>new Date(c)),n.set(Map,(c,f)=>new Map(s(Array.from(c),f))),n.set(Set,(c,f)=>new Set(s(Array.from(c),f))),t.constructorHandlers)for(let c of t.constructorHandlers)n.set(c[0],c[1]);let i=null;return t.proto?a:o;function s(c,f){let h=Object.keys(c),d=new Array(h.length);for(let w=0;w<h.length;w++){let y=h[w],P=c[y];if(typeof P!="object"||P===null)d[y]=P;else if(P.constructor!==Object&&(i=n.get(P.constructor)))d[y]=i(P,f);else if(ArrayBuffer.isView(P))d[y]=yn(P);else {let E=e.indexOf(P);E!==-1?d[y]=r[E]:d[y]=f(P);}}return d}function o(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,o);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,o);let f={};e.push(c),r.push(f);for(let h in c){if(Object.hasOwnProperty.call(c,h)===!1)continue;let d=c[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(i=n.get(d.constructor)))f[h]=i(d,o);else if(ArrayBuffer.isView(d))f[h]=yn(d);else {let w=e.indexOf(d);w!==-1?f[h]=r[w]:f[h]=o(d);}}return e.pop(),r.pop(),f}function a(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,a);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,a);let f={};e.push(c),r.push(f);for(let h in c){let d=c[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(i=n.get(d.constructor)))f[h]=i(d,a);else if(ArrayBuffer.isView(d))f[h]=yn(d);else {let w=e.indexOf(d);w!==-1?f[h]=r[w]:f[h]=a(d);}}return e.pop(),r.pop(),f}}});var cy=D((YN,ly)=>{A();x();I();ly.exports=uy()();});var Na=D(wo=>{A();x();I();Object.defineProperty(wo,"__esModule",{value:!0});wo.validateTopic=fy;wo.validateTopics=IE;function fy(t){let e=t.split("/");for(let r=0;r<e.length;r++)if(e[r]!=="+"){if(e[r]==="#")return r===e.length-1;if(e[r].indexOf("+")!==-1||e[r].indexOf("#")!==-1)return !1}return !0}function IE(t){if(t.length===0)return "empty_topic_list";for(let e=0;e<t.length;e++)if(!fy(t[e]))return t[e];return null}});var Ua=D(La=>{A();x();I();Object.defineProperty(La,"__esModule",{value:!0});var xE=or(),TE={objectMode:!0},PE={clean:!0},qa=class{options;_inflights;constructor(e){this.options=e||{},this.options={...PE,...e},this._inflights=new Map;}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new xE.Readable(TE),r=[],n=!1,i=0;return this._inflights.forEach((s,o)=>{r.push(s);}),e._read=()=>{!n&&i<r.length?e.push(r[i++]):e.push(null);},e.destroy=s=>{if(!n)return n=!0,setTimeout(()=>{e.emit("close");},0),e},e}del(e,r){let n=this._inflights.get(e.messageId);return n?(this._inflights.delete(e.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(e,r){let n=this._inflights.get(e.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e();}};La.default=qa;});var dy=D(Da=>{A();x();I();Object.defineProperty(Da,"__esModule",{value:!0});var hy=[0,16,128,131,135,144,145,151,153],OE=(t,e,r)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let n=e.topic.toString(),i=e.payload,{qos:s}=e,{messageId:o}=e,{options:a}=t;if(t.options.protocolVersion===5){let c;if(e.properties&&(c=e.properties.topicAlias),typeof c<"u")if(n.length===0)if(c>0&&c<=65535){let f=t.topicAliasRecv.getTopicByAlias(c);if(f)n=f,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",n,c);else {t.log("handlePublish :: unregistered topic alias. alias: %d",c),t.emit("error",new Error("Received unregistered Topic Alias"));return}}else {t.log("handlePublish :: topic alias out of range. alias: %d",c),t.emit("error",new Error("Received Topic Alias is out of range"));return}else if(t.topicAliasRecv.put(n,c))t.log("handlePublish :: registered topic: %s - alias: %d",n,c);else {t.log("handlePublish :: topic alias out of range. alias: %d",c),t.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(t.log("handlePublish: qos %d",s),s){case 2:{a.customHandleAcks(n,i,e,(c,f)=>{if(typeof c=="number"&&(f=c,c=null),c)return t.emit("error",c);if(hy.indexOf(f)===-1)return t.emit("error",new Error("Wrong reason code for pubrec"));f?t._sendPacket({cmd:"pubrec",messageId:o,reasonCode:f},r):t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:o},r);});});break}case 1:{a.customHandleAcks(n,i,e,(c,f)=>{if(typeof c=="number"&&(f=c,c=null),c)return t.emit("error",c);if(hy.indexOf(f)===-1)return t.emit("error",new Error("Wrong reason code for puback"));f||t.emit("message",n,i,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:o,reasonCode:f},r);});});break}case 0:t.emit("message",n,i,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};Da.default=OE;});var py=D((qq,RE)=>{RE.exports={version:"5.15.0"};});var Mr=D(ht=>{A();x();I();Object.defineProperty(ht,"__esModule",{value:!0});ht.MQTTJS_VERSION=ht.nextTick=ht.ErrorWithSubackPacket=ht.ErrorWithReasonCode=void 0;ht.applyMixin=kE;var ja=class t extends Error{code;constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode";}};ht.ErrorWithReasonCode=ja;var Fa=class t extends Error{packet;constructor(e,r){super(e),this.packet=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket";}};ht.ErrorWithSubackPacket=Fa;function kE(t,e,r=!1){let n=[e];for(;;){let i=n[0],s=Object.getPrototypeOf(i);if(s?.prototype)n.unshift(s);else break}for(let i of n)for(let s of Object.getOwnPropertyNames(i.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,Object.getOwnPropertyDescriptor(i.prototype,s)??Object.create(null));}ht.nextTick=typeof M?.nextTick=="function"?M.nextTick:t=>{setTimeout(t,0);};ht.MQTTJS_VERSION=py().version;});var zn=D(ur=>{A();x();I();Object.defineProperty(ur,"__esModule",{value:!0});ur.ReasonCodes=void 0;var yy=Mr();ur.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var CE=(t,e)=>{let{messageId:r}=e,n=e.cmd,i=null,s=t.outgoing[r]?t.outgoing[r].cb:null,o=null;if(!s){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(t.log("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{let a=e.reasonCode;a&&a>0&&a!==16?(o=new yy.ErrorWithReasonCode(`Publish error: ${ur.ReasonCodes[a]}`,a),t._removeOutgoingAndStoreMessage(r,()=>{s(o,e);})):t._removeOutgoingAndStoreMessage(r,s);break}case"pubrec":{i={cmd:"pubrel",qos:2,messageId:r};let a=e.reasonCode;a&&a>0&&a!==16?(o=new yy.ErrorWithReasonCode(`Publish error: ${ur.ReasonCodes[a]}`,a),t._removeOutgoingAndStoreMessage(r,()=>{s(o,e);})):t._sendPacket(i);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let a=e.granted;for(let c=0;c<a.length;c++){let f=a[c];if((f&128)!==0){o=new Error(`Subscribe error: ${ur.ReasonCodes[f]}`),o.code=f;let h=t.messageIdToTopic[r];h&&h.forEach(d=>{delete t._resubscribeTopics[d];});}}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),s(o,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),s(null,e);break}default:t.emit("error",new Error("unrecognized packet type"));}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty");};ur.default=CE;});var by=D(Wa=>{A();x();I();Object.defineProperty(Wa,"__esModule",{value:!0});var gy=Mr(),BE=zn(),ME=(t,e)=>{let{options:r}=t,n=r.protocolVersion,i=n===5?e.reasonCode:e.returnCode;if(n!==5){let s=new gy.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,i);t.emit("error",s);return}t.handleAuth(e,(s,o)=>{if(s){t.emit("error",s);return}if(i===24)t.reconnecting=!1,t._sendPacket(o);else {let a=new gy.ErrorWithReasonCode(`Connection refused: ${BE.ReasonCodes[i]}`,i);t.emit("error",a);}});};Wa.default=ME;});var Sy=D(_o=>{A();x();I();Object.defineProperty(_o,"__esModule",{value:!0});_o.LRUCache=void 0;var gn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,my=new Set,$a=typeof M=="object"&&M?M:{},_y=(t,e,r,n)=>{typeof $a.emitWarning=="function"?$a.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},mo=globalThis.AbortController,wy=globalThis.AbortSignal;if(typeof mo>"u"){wy=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i);}},mo=class{constructor(){e();}signal=new wy;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n);}}};let t=$a.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,_y("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var NE=t=>!my.has(t),lr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),vy=t=>lr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?bn:null:null,bn=class extends Array{constructor(e){super(e),this.fill(0);}},Ha=class t{heap;length;static#u=!1;static create(e){let r=vy(e);if(!r)return [];t.#u=!0;let n=new t(e,r);return t.#u=!1,n}constructor(e,r){if(!t.#u)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Va=class t{#u;#f;#y;#g;#R;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#b;#n;#r;#e;#l;#h;#a;#o;#w;#s;#m;#_;#d;#v;#x;#c;static unsafeExposeInternals(e){return {starts:e.#_,ttls:e.#d,sizes:e.#m,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#h,get head(){return e.#a},get tail(){return e.#o},free:e.#w,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,i,s)=>e.#M(r,n,i,s),moveToTail:r=>e.#O(r),indexes:r=>e.#S(r),rindexes:r=>e.#E(r),isStale:r=>e.#p(r)}}get max(){return this.#u}get maxSize(){return this.#f}get calculatedSize(){return this.#b}get size(){return this.#i}get fetchMethod(){return this.#R}get memoMethod(){return this.#k}get dispose(){return this.#y}get disposeAfter(){return this.#g}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:f,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:w,maxSize:y=0,maxEntrySize:P=0,sizeCalculation:E,fetchMethod:b,memoMethod:m,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:g,ignoreFetchAbort:O}=e;if(r!==0&&!lr(r))throw new TypeError("max option must be a nonnegative integer");let _=r?vy(r):Array;if(!_)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=y,this.maxEntrySize=P||this.#f,this.sizeCalculation=E,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#k=m,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=b,this.#x=!!b,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#l=new _(r),this.#h=new _(r),this.#a=0,this.#o=0,this.#w=Ha.create(r),this.#i=0,this.#b=0,typeof f=="function"&&(this.#y=f),typeof h=="function"?(this.#g=h,this.#s=[]):(this.#g=void 0,this.#s=void 0),this.#v=!!this.#y,this.#c=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#f!==0&&!lr(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!lr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#F();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=lr(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!lr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N();}if(this.#u===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#f){let q="LRU_CACHE_UNBOUNDED";NE(q)&&(my.add(q),_y("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,t));}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new bn(this.#u),r=new bn(this.#u);this.#d=e,this.#_=r,this.#q=(s,o,a=gn.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#p(s)&&this.#A(this.#r[s],"expire");},o+1);c.unref&&c.unref();}},this.#T=s=>{r[s]=e[s]!==0?gn.now():0;},this.#I=(s,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let f=s.now-c;s.remainingTTL=a-f;}};let n=0,i=()=>{let s=gn.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return s};this.getRemainingTTL=s=>{let o=this.#n.get(s);if(o===void 0)return 0;let a=e[o],c=r[o];if(!a||!c)return 1/0;let f=(n||i())-c;return a-f},this.#p=s=>{let o=r[s],a=e[s];return !!a&&!!o&&(n||i())-o>a};}#T=()=>{};#I=()=>{};#q=()=>{};#p=()=>!1;#F(){let e=new bn(this.#u);this.#b=0,this.#m=e,this.#P=r=>{this.#b-=e[r],e[r]=0;},this.#L=(r,n,i,s)=>{if(this.#t(n))return 0;if(!lr(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!lr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#C=(r,n,i)=>{if(e[r]=n,this.#f){let s=this.#f-e[r];for(;this.#b>s;)this.#B(!0);}this.#b+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#b);};}#P=e=>{};#C=(e,r,n)=>{};#L=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#o;!(!this.#U(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#h[r];}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#U(r)||((e||!this.#p(r))&&(yield r),r===this.#o));)r=this.#l[r];}#U(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#S())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#E())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#S()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#E()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this);}}rforEach(e,r=this){for(let n of this.#E()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this);}}purgeStale(){let e=!1;for(let r of this.#E({allowStale:!0}))this.#p(r)&&(this.#A(this.#r[r],"expire"),e=!0);return e}info(e){let r=this.#n.get(e);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#d&&this.#_){let o=this.#d[r],a=this.#_[r];if(o&&a){let c=o-(gn.now()-a);s.ttl=c,s.start=Date.now();}}return this.#m&&(s.size=this.#m[r]),s}dump(){let e=[];for(let r of this.#S({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#d&&this.#_){o.ttl=this.#d[r];let a=gn.now()-this.#_[r];o.start=Math.floor(Date.now()-a);}this.#m&&(o.size=this.#m[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=gn.now()-i;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:f=this.noUpdateTTL}=n,h=this.#L(e,r,n.size||0,a);if(this.maxEntrySize&&h>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#i===0?void 0:this.#n.get(e);if(d===void 0)d=this.#i===0?this.#o:this.#w.length!==0?this.#w.pop():this.#i===this.#u?this.#B(!1):this.#i,this.#r[d]=e,this.#e[d]=r,this.#n.set(e,d),this.#l[this.#o]=d,this.#h[d]=this.#o,this.#o=d,this.#i++,this.#C(d,h,c),c&&(c.set="add"),f=!1;else {this.#O(d);let w=this.#e[d];if(r!==w){if(this.#x&&this.#t(w)){w.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=w;y!==void 0&&!o&&(this.#v&&this.#y?.(y,e,"set"),this.#c&&this.#s?.push([y,e,"set"]));}else o||(this.#v&&this.#y?.(w,e,"set"),this.#c&&this.#s?.push([w,e,"set"]));if(this.#P(d),this.#C(d,h,c),this.#e[d]=r,c){c.set="replace";let y=w&&this.#t(w)?w.__staleWhileFetching:w;y!==void 0&&(c.oldValue=y);}}else c&&(c.set="update");}if(i!==0&&!this.#d&&this.#N(),this.#d&&(f||this.#q(d,i,s),c&&this.#I(c,d)),!o&&this.#c&&this.#s){let w=this.#s,y;for(;y=w?.shift();)this.#g?.(...y);}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#B(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#s){let e=this.#s,r;for(;r=e?.shift();)this.#g?.(...r);}}}#B(e){let r=this.#a,n=this.#r[r],i=this.#e[r];return this.#x&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#y?.(i,n,"evict"),this.#c&&this.#s?.push([i,n,"evict"])),this.#P(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#w.push(r)),this.#i===1?(this.#a=this.#o=0,this.#w.length=0):this.#a=this.#l[r],this.#n.delete(n),this.#i--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return !1;if(this.#p(s))i&&(i.has="stale",this.#I(i,s));else return n&&this.#T(s),i&&(i.has="hit",this.#I(i,s)),!0}else i&&(i.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#n.get(e);if(i===void 0||!n&&this.#p(i))return;let s=this.#e[i];return this.#t(s)?s.__staleWhileFetching:s}#M(e,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new mo,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},f=(E,b=!1)=>{let{aborted:m}=o.signal,v=n.ignoreFetchAbort&&E!==void 0;if(n.status&&(m&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),m&&!v&&!b)return d(o.signal.reason);let R=y;return this.#e[r]===y&&(E===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,E,c.options))),E},h=E=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=E),d(E)),d=E=>{let{aborted:b}=o.signal,m=b&&n.allowStaleOnFetchAbort,v=m||n.allowStaleOnFetchRejection,R=v||n.noDeleteOnFetchRejection,T=y;if(this.#e[r]===y&&(!R||T.__staleWhileFetching===void 0?this.#A(e,"fetch"):m||(this.#e[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw E},w=(E,b)=>{let m=this.#R?.(e,s,c);m&&m instanceof Promise&&m.then(v=>E(v===void 0?void 0:v),b),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(E(void 0),n.allowStaleOnFetchAbort&&(E=v=>f(v,!0)));});};n.status&&(n.status.fetchDispatched=!0);let y=new Promise(w).then(f,h),P=Object.assign(y,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,P,{...c.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=P,P}#t(e){if(!this.#x)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof mo}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:E,forceRefresh:b=!1,status:m,signal:v}=r;if(!this.#x)return m&&(m.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:m});let R={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:f,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:P,ignoreFetchAbort:y,status:m,signal:v},T=this.#n.get(e);if(T===void 0){m&&(m.fetch="miss");let g=this.#M(e,T,R,E);return g.__returned=g}else {let g=this.#e[T];if(this.#t(g)){let j=n&&g.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",j&&(m.returnedStale=!0)),j?g.__staleWhileFetching:g.__returned=g}let O=this.#p(T);if(!b&&!O)return m&&(m.fetch="hit"),this.#O(T),i&&this.#T(T),m&&this.#I(m,T),g;let _=this.#M(e,T,R,E),$=_.__staleWhileFetching!==void 0&&n;return m&&(m.fetch=O?"stale":"refresh",$&&O&&(m.returnedStale=!0)),$?_.__staleWhileFetching:_.__returned=_}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#k;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#n.get(e);if(a!==void 0){let c=this.#e[a],f=this.#t(c);return o&&this.#I(o,a),this.#p(a)?(o&&(o.get="stale"),f?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),f?c.__staleWhileFetching:(this.#O(a),i&&this.#T(a),c))}else o&&(o.get="miss");}#D(e,r){this.#h[r]=e,this.#l[e]=r;}#O(e){e!==this.#o&&(e===this.#a?this.#a=this.#l[e]:this.#D(this.#h[e],this.#l[e]),this.#D(this.#o,e),this.#o=e);}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(n=!0,this.#i===1)this.#j(r);else {this.#P(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#y?.(s,e,r),this.#c&&this.#s?.push([s,e,r])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#o)this.#o=this.#h[i];else if(i===this.#a)this.#a=this.#l[i];else {let o=this.#h[i];this.#l[o]=this.#l[i];let a=this.#l[i];this.#h[a]=this.#h[i];}this.#i--,this.#w.push(i);}}if(this.#c&&this.#s?.length){let i=this.#s,s;for(;s=i?.shift();)this.#g?.(...s);}return n}clear(){return this.#j("delete")}#j(e){for(let r of this.#E({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(new Error("deleted"));else {let i=this.#r[r];this.#v&&this.#y?.(n,i,e),this.#c&&this.#s?.push([n,i,e]);}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#_&&(this.#d.fill(0),this.#_.fill(0)),this.#m&&this.#m.fill(0),this.#a=0,this.#o=0,this.#w.length=0,this.#b=0,this.#i=0,this.#c&&this.#s){let r=this.#s,n;for(;n=r?.shift();)this.#g?.(...n);}}};_o.LRUCache=Va;});var It=D(cr=>{A();x();I();Object.defineProperty(cr,"t",{value:!0});cr.ContainerIterator=cr.Container=cr.Base=void 0;var Ga=class{constructor(e=0){this.iteratorType=e;}equals(e){return this.o===e.o}};cr.ContainerIterator=Ga;var vo=class{constructor(){this.i=0;}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};cr.Base=vo;var za=class extends vo{};cr.Container=za;});var Ey=D(So=>{A();x();I();Object.defineProperty(So,"t",{value:!0});So.default=void 0;var qE=It(),Ka=class extends qE.Base{constructor(e=[]){super(),this.S=[];let r=this;e.forEach(function(n){r.push(n);});}clear(){this.i=0,this.S=[];}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},LE=Ka;So.default=LE;});var Ay=D(Eo=>{A();x();I();Object.defineProperty(Eo,"t",{value:!0});Eo.default=void 0;var UE=It(),Qa=class extends UE.Base{constructor(e=[]){super(),this.j=0,this.q=[];let r=this;e.forEach(function(n){r.push(n);});}clear(){this.q=[],this.i=this.j=0;}push(e){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let n=this.i;for(let i=0;i<n;++i)this.q[i]=this.q[this.j+i];this.j=0,this.q[this.i]=e;}else this.q[this.j+this.i]=e;return ++this.i}pop(){if(this.i===0)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(this.i!==0)return this.q[this.j]}},DE=Qa;Eo.default=DE;});var Iy=D(Ao=>{A();x();I();Object.defineProperty(Ao,"t",{value:!0});Ao.default=void 0;var jE=It(),Ya=class extends jE.Base{constructor(e=[],r=function(i,s){return i>s?-1:i<s?1:0},n=!0){if(super(),this.v=r,Array.isArray(e))this.C=n?[...e]:e;else {this.C=[];let s=this;e.forEach(function(o){s.C.push(o);});}this.i=this.C.length;let i=this.i>>1;for(let s=this.i-1>>1;s>=0;--s)this.k(s,i);}m(e){let r=this.C[e];for(;e>0;){let n=e-1>>1,i=this.C[n];if(this.v(i,r)<=0)break;this.C[e]=i,e=n;}this.C[e]=r;}k(e,r){let n=this.C[e];for(;e<r;){let i=e<<1|1,s=i+1,o=this.C[i];if(s<this.i&&this.v(o,this.C[s])>0&&(i=s,o=this.C[s]),this.v(o,n)>=0)break;this.C[e]=o,e=i;}this.C[e]=n;}clear(){this.i=0,this.C.length=0;}push(e){this.C.push(e),this.m(this.i),this.i+=1;}pop(){if(this.i===0)return;let e=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let r=this.C.indexOf(e);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(e){let r=this.C.indexOf(e);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return [...this.C]}},FE=Ya;Ao.default=FE;});var xo=D(Io=>{A();x();I();Object.defineProperty(Io,"t",{value:!0});Io.default=void 0;var WE=It(),Ja=class extends WE.Container{},$E=Ja;Io.default=$E;});var xt=D(Xa=>{A();x();I();Object.defineProperty(Xa,"t",{value:!0});Xa.throwIteratorAccessError=HE;function HE(){throw new RangeError("Iterator access denied!")}});var eu=D(Po=>{A();x();I();Object.defineProperty(Po,"t",{value:!0});Po.RandomIterator=void 0;var VE=It(),To=xt(),Za=class extends VE.ContainerIterator{constructor(e,r){super(r),this.o=e,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0, To.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0, To.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0, To.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0, To.throwIteratorAccessError)(),this.o-=1,this});}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e);}};Po.RandomIterator=Za;});var xy=D(Oo=>{A();x();I();Object.defineProperty(Oo,"t",{value:!0});Oo.default=void 0;var GE=KE(xo()),zE=eu();function KE(t){return t&&t.t?t:{default:t}}var Nr=class t extends zE.RandomIterator{constructor(e,r,n){super(e,n),this.container=r;}copy(){return new t(this.o,this.container,this.iteratorType)}},tu=class extends GE.default{constructor(e=[],r=!0){if(super(),Array.isArray(e))this.J=r?[...e]:e,this.i=e.length;else {this.J=[];let n=this;e.forEach(function(i){n.pushBack(i);});}}clear(){this.i=0,this.J.length=0;}begin(){return new Nr(0,this)}end(){return new Nr(this.i,this)}rBegin(){return new Nr(this.i-1,this,1)}rEnd(){return new Nr(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let r=0;for(let n=0;n<this.i;++n)this.J[n]!==e&&(this.J[r++]=this.J[n]);return this.i=this.J.length=r,this.i}eraseElementByIterator(e){let r=e.o;return e=e.next(),this.eraseElementByPos(r),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=r;}insert(e,r,n=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(n).fill(r)),this.i+=n,this.i}find(e){for(let r=0;r<this.i;++r)if(this.J[r]===e)return new Nr(r,this);return this.end()}reverse(){this.J.reverse();}unique(){let e=1;for(let r=1;r<this.i;++r)this.J[r]!==this.J[r-1]&&(this.J[e++]=this.J[r]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e);}forEach(e){for(let r=0;r<this.i;++r)e(this.J[r],r,this);}[Symbol.iterator](){return function*(){yield*this.J;}.bind(this)()}},QE=tu;Oo.default=QE;});var Ty=D(Ro=>{A();x();I();Object.defineProperty(Ro,"t",{value:!0});Ro.default=void 0;var YE=XE(xo()),JE=It(),qr=xt();function XE(t){return t&&t.t?t:{default:t}}var Lr=class t extends JE.ContainerIterator{constructor(e,r,n,i){super(i),this.o=e,this.h=r,this.container=n,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0, qr.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0, qr.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0, qr.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0, qr.throwIteratorAccessError)(),this.o=this.o.L,this});}get pointer(){return this.o===this.h&&(0, qr.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0, qr.throwIteratorAccessError)(),this.o.l=e;}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},ru=class extends YE.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let r=this;e.forEach(function(n){r.pushBack(n);});}V(e){let{L:r,B:n}=e;r.B=n,n.L=r,e===this.p&&(this.p=n),e===this._&&(this._=r),this.i-=1;}G(e,r){let n=r.B,i={l:e,L:r,B:n};r.B=i,n.L=i,r===this.h&&(this.p=i),n===this.h&&(this._=i),this.i+=1;}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h;}begin(){return new Lr(this.p,this.h,this)}end(){return new Lr(this.h,this.h,this)}rBegin(){return new Lr(this._,this.h,this,1)}rEnd(){return new Lr(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}eraseElementByValue(e){let r=this.p;for(;r!==this.h;)r.l===e&&this.V(r),r=r.B;return this.i}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0, qr.throwIteratorAccessError)(),e=e.next(),this.V(r),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let n=this.p;for(;e--;)n=n.B;n.l=r;}insert(e,r,n=1){if(e<0||e>this.i)throw new RangeError;if(n<=0)return this.i;if(e===0)for(;n--;)this.pushFront(r);else if(e===this.i)for(;n--;)this.pushBack(r);else {let i=this.p;for(let o=1;o<e;++o)i=i.B;let s=i.B;for(this.i+=n;n--;)i.B={l:r,L:i},i.B.L=i,i=i.B;i.B=s,s.L=i;}return this.i}find(e){let r=this.p;for(;r!==this.h;){if(r.l===e)return new Lr(r,this.h,this);r=r.B;}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,r=this._,n=0;for(;n<<1<this.i;){let i=e.l;e.l=r.l,r.l=i,e=e.B,r=r.L,n+=1;}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let r=e;for(;r.B!==this.h&&r.l===r.B.l;)r=r.B,this.i-=1;e.B=r.B,e.B.L=e,e=e.B;}return this.i}sort(e){if(this.i<=1)return;let r=[];this.forEach(function(i){r.push(i);}),r.sort(e);let n=this.p;r.forEach(function(i){n.l=i,n=n.B;});}merge(e){let r=this;if(this.i===0)e.forEach(function(n){r.pushBack(n);});else {let n=this.p;e.forEach(function(i){for(;n!==r.h&&n.l<=i;)n=n.B;r.G(i,n.L);});}return this.i}forEach(e){let r=this.p,n=0;for(;r!==this.h;)e(r.l,n++,this),r=r.B;}[Symbol.iterator](){return function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B;}.bind(this)()}},ZE=ru;Ro.default=ZE;});var Py=D(ko=>{A();x();I();Object.defineProperty(ko,"t",{value:!0});ko.default=void 0;var e1=r1(xo()),t1=eu();function r1(t){return t&&t.t?t:{default:t}}var Ur=class t extends t1.RandomIterator{constructor(e,r,n){super(e,n),this.container=r;}copy(){return new t(this.o,this.container,this.iteratorType)}},nu=class extends e1.default{constructor(e=[],r=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let n=(()=>{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=r,this.P=Math.max(Math.ceil(n/this.F),1);for(let o=0;o<this.P;++o)this.A.push(new Array(this.F));let i=Math.ceil(n/this.F);this.j=this.R=(this.P>>1)-(i>>1),this.D=this.N=this.F-n%this.F>>1;let s=this;e.forEach(function(o){s.pushBack(o);});}T(){let e=[],r=Math.max(this.P>>1,1);for(let n=0;n<r;++n)e[n]=new Array(this.F);for(let n=this.j;n<this.P;++n)e[e.length]=this.A[n];for(let n=0;n<this.R;++n)e[e.length]=this.A[n];e[e.length]=[...this.A[this.R]],this.j=r,this.R=e.length-1;for(let n=0;n<r;++n)e[e.length]=new Array(this.F);this.A=e,this.P=e.length;}O(e){let r=this.D+e+1,n=r%this.F,i=n-1,s=this.j+(r-n)/this.F;return n===0&&(s-=1),s%=this.P,i<0&&(i+=this.F),{curNodeBucketIndex:s,curNodePointerIndex:i}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1;}begin(){return new Ur(0,this)}end(){return new Ur(this.i,this)}rBegin(){return new Ur(this.i-1,this,1)}rEnd(){return new Ur(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(this.i===0)return;let e=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);return this.A[r][n]}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:n,curNodePointerIndex:i}=this.O(e);this.A[n][i]=r;}insert(e,r,n=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;n--;)this.pushFront(r);else if(e===this.i)for(;n--;)this.pushBack(r);else {let i=[];for(let s=e;s<this.i;++s)i.push(this.getElementByPos(s));this.cut(e-1);for(let s=0;s<n;++s)this.pushBack(r);for(let s=0;s<i.length;++s)this.pushBack(i[s]);}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);return this.R=r,this.N=n,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else {let r=[];for(let i=e+1;i<this.i;++i)r.push(this.getElementByPos(i));this.cut(e),this.popBack();let n=this;r.forEach(function(i){n.pushBack(i);});}return this.i}eraseElementByValue(e){if(this.i===0)return 0;let r=[];for(let i=0;i<this.i;++i){let s=this.getElementByPos(i);s!==e&&r.push(s);}let n=r.length;for(let i=0;i<n;++i)this.setElementByPos(i,r[i]);return this.cut(n-1)}eraseElementByIterator(e){let r=e.o;return this.eraseElementByPos(r),e=e.next(),e}find(e){for(let r=0;r<this.i;++r)if(this.getElementByPos(r)===e)return new Ur(r,this);return this.end()}reverse(){let e=0,r=this.i-1;for(;e<r;){let n=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(r)),this.setElementByPos(r,n),e+=1,r-=1;}}unique(){if(this.i<=1)return this.i;let e=1,r=this.getElementByPos(0);for(let n=1;n<this.i;++n){let i=this.getElementByPos(n);i!==r&&(r=i,this.setElementByPos(e++,i));}for(;this.i>e;)this.popBack();return this.i}sort(e){let r=[];for(let n=0;n<this.i;++n)r.push(this.getElementByPos(n));r.sort(e);for(let n=0;n<this.i;++n)this.setElementByPos(n,r[n]);}shrinkToFit(){if(this.i===0)return;let e=[];this.forEach(function(r){e.push(r);}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let r=0;r<this.P;++r)this.A.push(new Array(this.F));for(let r=0;r<e.length;++r)this.pushBack(e[r]);}forEach(e){for(let r=0;r<this.i;++r)e(this.getElementByPos(r),r,this);}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e);}.bind(this)()}},n1=nu;ko.default=n1;});var Oy=D(wn=>{A();x();I();Object.defineProperty(wn,"t",{value:!0});wn.TreeNodeEnableIndex=wn.TreeNode=void 0;var Co=class{constructor(e,r){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=r;}L(){let e=this;if(e.ee===1&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else {let r=e.tt;for(;r.U===e;)e=r,r=e.tt;e=r;}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}else {let r=e.tt;for(;r.W===e;)e=r,r=e.tt;return e.W!==r?r:e}}te(){let e=this.tt,r=this.W,n=r.U;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.U=this,this.tt=r,this.W=n,n&&(n.tt=this),r}se(){let e=this.tt,r=this.U,n=r.W;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.W=this,this.tt=r,this.U=n,n&&(n.tt=this),r}};wn.TreeNode=Co;var iu=class extends Co{constructor(){super(...arguments),this.rt=1;}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt);}};wn.TreeNodeEnableIndex=iu;});var su=D(Bo=>{A();x();I();Object.defineProperty(Bo,"t",{value:!0});Bo.default=void 0;var Ry=Oy(),i1=It(),ky=xt(),ou=class extends i1.Container{constructor(e=function(n,i){return n<i?-1:n>i?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=Ry.TreeNodeEnableIndex,this.M=function(n,i,s){let o=this.ne(n,i,s);if(o){let a=o.tt;for(;a!==this.h;)a.rt+=1,a=a.tt;let c=this.he(o);if(c){let{parentNode:f,grandParent:h,curNode:d}=c;f.ie(),h.ie(),d.ie();}}return this.i},this.V=function(n){let i=this.fe(n);for(;i!==this.h;)i.rt-=1,i=i.tt;}):(this.re=Ry.TreeNode,this.M=function(n,i,s){let o=this.ne(n,i,s);return o&&this.he(o),this.i},this.V=this.fe),this.h=new this.re;}X(e,r){let n=this.h;for(;e;){let i=this.v(e.u,r);if(i<0)e=e.W;else if(i>0)n=e,e=e.U;else return e}return n}Z(e,r){let n=this.h;for(;e;)this.v(e.u,r)<=0?e=e.W:(n=e,e=e.U);return n}$(e,r){let n=this.h;for(;e;){let i=this.v(e.u,r);if(i<0)n=e,e=e.W;else if(i>0)e=e.U;else return e}return n}rr(e,r){let n=this.h;for(;e;)this.v(e.u,r)<0?(n=e,e=e.W):e=e.U;return n}ue(e){for(;;){let r=e.tt;if(r===this.h)return;if(e.ee===1){e.ee=0;return}if(e===r.U){let n=r.W;if(n.ee===1)n.ee=0,r.ee=1,r===this.Y?this.Y=r.te():r.te();else if(n.W&&n.W.ee===1){n.ee=r.ee,r.ee=0,n.W.ee=0,r===this.Y?this.Y=r.te():r.te();return}else n.U&&n.U.ee===1?(n.ee=1,n.U.ee=0,n.se()):(n.ee=1,e=r);}else {let n=r.U;if(n.ee===1)n.ee=0,r.ee=1,r===this.Y?this.Y=r.se():r.se();else if(n.U&&n.U.ee===1){n.ee=r.ee,r.ee=0,n.U.ee=0,r===this.Y?this.Y=r.se():r.se();return}else n.W&&n.W.ee===1?(n.ee=1,n.W.ee=0,n.te()):(n.ee=1,e=r);}}}fe(e){if(this.i===1)return this.clear(),this.h;let r=e;for(;r.U||r.W;){if(r.W)for(r=r.W;r.U;)r=r.U;else r=r.U;[e.u,r.u]=[r.u,e.u],[e.l,r.l]=[r.l,e.l],e=r;}this.h.U===r?this.h.U=r.tt:this.h.W===r&&(this.h.W=r.tt),this.ue(r);let n=r.tt;return r===n.U?n.U=void 0:n.W=void 0,this.i-=1,this.Y.ee=0,n}oe(e,r){return e===void 0?!1:this.oe(e.U,r)||r(e)?!0:this.oe(e.W,r)}he(e){for(;;){let r=e.tt;if(r.ee===0)return;let n=r.tt;if(r===n.U){let i=n.W;if(i&&i.ee===1){if(i.ee=r.ee=0,n===this.Y)return;n.ee=1,e=n;continue}else if(e===r.W){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=n),r.W=e.U,n.U=e.W,e.U=r,e.W=n,n===this.Y)this.Y=e,this.h.tt=e;else {let s=n.tt;s.U===n?s.U=e:s.W=e;}return e.tt=n.tt,r.tt=e,n.tt=e,n.ee=1,{parentNode:r,grandParent:n,curNode:e}}else r.ee=0,n===this.Y?this.Y=n.se():n.se(),n.ee=1;}else {let i=n.U;if(i&&i.ee===1){if(i.ee=r.ee=0,n===this.Y)return;n.ee=1,e=n;continue}else if(e===r.U){if(e.ee=0,e.U&&(e.U.tt=n),e.W&&(e.W.tt=r),n.W=e.U,r.U=e.W,e.U=n,e.W=r,n===this.Y)this.Y=e,this.h.tt=e;else {let s=n.tt;s.U===n?s.U=e:s.W=e;}return e.tt=n.tt,r.tt=e,n.tt=e,n.ee=1,{parentNode:r,grandParent:n,curNode:e}}else r.ee=0,n===this.Y?this.Y=n.te():n.te(),n.ee=1;}return}}ne(e,r,n){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,r),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let i,s=this.h.U,o=this.v(s.u,e);if(o===0){s.l=r;return}else if(o>0)s.U=new this.re(e,r),s.U.tt=s,i=s.U,this.h.U=i;else {let a=this.h.W,c=this.v(a.u,e);if(c===0){a.l=r;return}else if(c<0)a.W=new this.re(e,r),a.W.tt=a,i=a.W,this.h.W=i;else {if(n!==void 0){let f=n.o;if(f!==this.h){let h=this.v(f.u,e);if(h===0){f.l=r;return}else if(h>0){let d=f.L(),w=this.v(d.u,e);if(w===0){d.l=r;return}else w<0&&(i=new this.re(e,r),d.W===void 0?(d.W=i,i.tt=d):(f.U=i,i.tt=f));}}}if(i===void 0)for(i=this.Y;;){let f=this.v(i.u,e);if(f>0){if(i.U===void 0){i.U=new this.re(e,r),i.U.tt=i,i=i.U;break}i=i.U;}else if(f<0){if(i.W===void 0){i.W=new this.re(e,r),i.W.tt=i,i=i.W;break}i=i.W;}else {i.l=r;return}}}}return this.i+=1,i}I(e,r){for(;e;){let n=this.v(e.u,r);if(n<0)e=e.W;else if(n>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0;}updateKeyByIterator(e,r){let n=e.o;if(n===this.h&&(0, ky.throwIteratorAccessError)(),this.i===1)return n.u=r,!0;if(n===this.h.U)return this.v(n.B().u,r)>0?(n.u=r,!0):!1;if(n===this.h.W)return this.v(n.L().u,r)<0?(n.u=r,!0):!1;let i=n.L().u;if(this.v(i,r)>=0)return !1;let s=n.B().u;return this.v(s,r)<=0?!1:(n.u=r,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=0,n=this;return this.oe(this.Y,function(i){return e===r?(n.V(i),!0):(r+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return !1;let r=this.I(this.Y,e);return r===this.h?!1:(this.V(r),!0)}eraseElementByIterator(e){let r=e.o;r===this.h&&(0, ky.throwIteratorAccessError)();let n=r.W===void 0;return e.iteratorType===0?n&&e.next():(!n||r.U===void 0)&&e.next(),this.V(r),e}forEach(e){let r=0;for(let n of this)e(n,r++,this);}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r,n=0;for(let i of this){if(n===e){r=i;break}n+=1;}return r}getHeight(){if(this.i===0)return 0;let e=function(r){return r?Math.max(e(r.U),e(r.W))+1:0};return e(this.Y)}},o1=ou;Bo.default=o1;});var uu=D(No=>{A();x();I();Object.defineProperty(No,"t",{value:!0});No.default=void 0;var s1=It(),Mo=xt(),au=class extends s1.ContainerIterator{constructor(e,r,n){super(n),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0, Mo.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0, Mo.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0, Mo.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0, Mo.throwIteratorAccessError)(),this.o=this.o.L(),this});}get index(){let e=this.o,r=this.h.tt;if(e===this.h)return r?r.rt-1:0;let n=0;for(e.U&&(n+=e.U.rt);e!==r;){let i=e.tt;e===i.W&&(n+=1,i.U&&(n+=i.U.rt)),e=i;}return n}},a1=au;No.default=a1;});var By=D(qo=>{A();x();I();Object.defineProperty(qo,"t",{value:!0});qo.default=void 0;var u1=Cy(su()),l1=Cy(uu()),c1=xt();function Cy(t){return t&&t.t?t:{default:t}}var dt=class t extends l1.default{constructor(e,r,n,i){super(e,r,i),this.container=n;}get pointer(){return this.o===this.h&&(0, c1.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},lu=class extends u1.default{constructor(e=[],r,n){super(r,n);let i=this;e.forEach(function(s){i.insert(s);});}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W));}begin(){return new dt(this.h.U||this.h,this.h,this)}end(){return new dt(this.h,this.h,this)}rBegin(){return new dt(this.h.W||this.h,this.h,this,1)}rEnd(){return new dt(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,r){return this.M(e,void 0,r)}find(e){let r=this.I(this.Y,e);return new dt(r,this.h,this)}lowerBound(e){let r=this.X(this.Y,e);return new dt(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new dt(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new dt(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new dt(r,this.h,this)}union(e){let r=this;return e.forEach(function(n){r.insert(n);}),this.i}[Symbol.iterator](){return this.K(this.Y)}},f1=lu;qo.default=f1;});var Ny=D(Lo=>{A();x();I();Object.defineProperty(Lo,"t",{value:!0});Lo.default=void 0;var h1=My(su()),d1=My(uu()),p1=xt();function My(t){return t&&t.t?t:{default:t}}var pt=class t extends d1.default{constructor(e,r,n,i){super(e,r,i),this.container=n;}get pointer(){this.o===this.h&&(0, p1.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,n){if(n==="0")return e.o.u;if(n==="1")return e.o.l},set(r,n,i){if(n!=="1")throw new TypeError("props must be 1");return e.o.l=i,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},cu=class extends h1.default{constructor(e=[],r,n){super(r,n);let i=this;e.forEach(function(s){i.setElement(s[0],s[1]);});}*K(e){e!==void 0&&(yield*this.K(e.U),yield [e.u,e.l],yield*this.K(e.W));}begin(){return new pt(this.h.U||this.h,this.h,this)}end(){return new pt(this.h,this.h,this)}rBegin(){return new pt(this.h.W||this.h,this.h,this,1)}rEnd(){return new pt(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return [e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return [e.u,e.l]}lowerBound(e){let r=this.X(this.Y,e);return new pt(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new pt(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new pt(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new pt(r,this.h,this)}setElement(e,r,n){return this.M(e,r,n)}find(e){let r=this.I(this.Y,e);return new pt(r,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let r=this;return e.forEach(function(n){r.setElement(n[0],n[1]);}),this.i}[Symbol.iterator](){return this.K(this.Y)}},y1=cu;Lo.default=y1;});var hu=D(fu=>{A();x();I();Object.defineProperty(fu,"t",{value:!0});fu.default=g1;function g1(t){let e=typeof t;return e==="object"&&t!==null||e==="function"}});var gu=D(mn=>{A();x();I();Object.defineProperty(mn,"t",{value:!0});mn.HashContainerIterator=mn.HashContainer=void 0;var qy=It(),du=b1(hu()),Kn=xt();function b1(t){return t&&t.t?t:{default:t}}var pu=class extends qy.ContainerIterator{constructor(e,r,n){super(n),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0, Kn.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0, Kn.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0, Kn.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0, Kn.throwIteratorAccessError)(),this.o=this.o.L,this});}};mn.HashContainerIterator=pu;var yu=class extends qy.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h;}V(e){let{L:r,B:n}=e;r.B=n,n.L=r,e===this.p&&(this.p=n),e===this._&&(this._=r),this.i-=1;}M(e,r,n){n===void 0&&(n=(0, du.default)(e));let i;if(n){let s=e[this.HASH_TAG];if(s!==void 0)return this.H[s].l=r,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:r,L:this._,B:this.h},this.H.push(i);}else {let s=this.g[e];if(s)return s.l=r,this.i;i={u:e,l:r,L:this._,B:this.h},this.g[e]=i;}return this.i===0?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,r){if(r===void 0&&(r=(0, du.default)(e)),r){let n=e[this.HASH_TAG];return n===void 0?this.h:this.H[n]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(r){delete r.u[e];}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h;}eraseElementByKey(e,r){let n;if(r===void 0&&(r=(0, du.default)(e)),r){let i=e[this.HASH_TAG];if(i===void 0)return !1;delete e[this.HASH_TAG],n=this.H[i],delete this.H[i];}else {if(n=this.g[e],n===void 0)return !1;delete this.g[e];}return this.V(n),!0}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0, Kn.throwIteratorAccessError)(),this.V(r),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}};mn.HashContainer=yu;});var Uy=D(Uo=>{A();x();I();Object.defineProperty(Uo,"t",{value:!0});Uo.default=void 0;var Ly=gu(),w1=xt(),Dr=class t extends Ly.HashContainerIterator{constructor(e,r,n,i){super(e,r,i),this.container=n;}get pointer(){return this.o===this.h&&(0, w1.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},bu=class extends Ly.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(n){r.insert(n);});}begin(){return new Dr(this.p,this.h,this)}end(){return new Dr(this.h,this.h,this)}rBegin(){return new Dr(this._,this.h,this,1)}rEnd(){return new Dr(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,r){return this.M(e,void 0,r)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.u}find(e,r){let n=this.I(e,r);return new Dr(n,this.h,this)}forEach(e){let r=0,n=this.p;for(;n!==this.h;)e(n.u,r++,this),n=n.B;}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B;}.bind(this)()}},m1=bu;Uo.default=m1;});var jy=D(Do=>{A();x();I();Object.defineProperty(Do,"t",{value:!0});Do.default=void 0;var Dy=gu(),_1=S1(hu()),v1=xt();function S1(t){return t&&t.t?t:{default:t}}var jr=class t extends Dy.HashContainerIterator{constructor(e,r,n,i){super(e,r,i),this.container=n;}get pointer(){this.o===this.h&&(0, v1.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,n){if(n==="0")return e.o.u;if(n==="1")return e.o.l},set(r,n,i){if(n!=="1")throw new TypeError("props must be 1");return e.o.l=i,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},wu=class extends Dy.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(n){r.setElement(n[0],n[1]);});}begin(){return new jr(this.p,this.h,this)}end(){return new jr(this.h,this.h,this)}rBegin(){return new jr(this._,this.h,this,1)}rEnd(){return new jr(this.h,this.h,this,1)}front(){if(this.i!==0)return [this.p.u,this.p.l]}back(){if(this.i!==0)return [this._.u,this._.l]}setElement(e,r,n){return this.M(e,r,n)}getElementByKey(e,r){if(r===void 0&&(r=(0, _1.default)(e)),r){let i=e[this.HASH_TAG];return i!==void 0?this.H[i].l:void 0}let n=this.g[e];return n?n.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return [r.u,r.l]}find(e,r){let n=this.I(e,r);return new jr(n,this.h,this)}forEach(e){let r=0,n=this.p;for(;n!==this.h;)e([n.u,n.l],r++,this),n=n.B;}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield [e.u,e.l],e=e.B;}.bind(this)()}},E1=wu;Do.default=E1;});var Fy=D(it=>{A();x();I();Object.defineProperty(it,"t",{value:!0});Object.defineProperty(it,"Deque",{enumerable:!0,get:function(){return O1.default}});Object.defineProperty(it,"HashMap",{enumerable:!0,get:function(){return B1.default}});Object.defineProperty(it,"HashSet",{enumerable:!0,get:function(){return C1.default}});Object.defineProperty(it,"LinkList",{enumerable:!0,get:function(){return P1.default}});Object.defineProperty(it,"OrderedMap",{enumerable:!0,get:function(){return k1.default}});Object.defineProperty(it,"OrderedSet",{enumerable:!0,get:function(){return R1.default}});Object.defineProperty(it,"PriorityQueue",{enumerable:!0,get:function(){return x1.default}});Object.defineProperty(it,"Queue",{enumerable:!0,get:function(){return I1.default}});Object.defineProperty(it,"Stack",{enumerable:!0,get:function(){return A1.default}});Object.defineProperty(it,"Vector",{enumerable:!0,get:function(){return T1.default}});var A1=Tt(Ey()),I1=Tt(Ay()),x1=Tt(Iy()),T1=Tt(xy()),P1=Tt(Ty()),O1=Tt(Py()),R1=Tt(By()),k1=Tt(Ny()),C1=Tt(Uy()),B1=Tt(jy());function Tt(t){return t&&t.t?t:{default:t}}});var $y=D((cj,Wy)=>{A();x();I();var M1=Fy().OrderedSet,Pt=At()("number-allocator:trace"),N1=At()("number-allocator:error");function Ve(t,e){this.low=t,this.high=e;}Ve.prototype.equals=function(t){return this.low===t.low&&this.high===t.high};Ve.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0};function Ot(t,e){if(!(this instanceof Ot))return new Ot(t,e);this.min=t,this.max=e,this.ss=new M1([],(r,n)=>r.compare(n)),Pt("Create"),this.clear();}Ot.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low};Ot.prototype.alloc=function(){if(this.ss.size()===0)return Pt("alloc():empty"),null;let t=this.ss.begin(),e=t.pointer.low,r=t.pointer.high,n=e;return n+1<=r?this.ss.updateKeyByIterator(t,new Ve(e+1,r)):this.ss.eraseElementByPos(0),Pt("alloc():"+n),n};Ot.prototype.use=function(t){let e=new Ve(t,t),r=this.ss.lowerBound(e);if(!r.equals(this.ss.end())){let n=r.pointer.low,i=r.pointer.high;return r.pointer.equals(e)?(this.ss.eraseElementByIterator(r),Pt("use():"+t),!0):n>t?!1:n===t?(this.ss.updateKeyByIterator(r,new Ve(n+1,i)),Pt("use():"+t),!0):i===t?(this.ss.updateKeyByIterator(r,new Ve(n,i-1)),Pt("use():"+t),!0):(this.ss.updateKeyByIterator(r,new Ve(t+1,i)),this.ss.insert(new Ve(n,t-1)),Pt("use():"+t),!0)}return Pt("use():failed"),!1};Ot.prototype.free=function(t){if(t<this.min||t>this.max){N1("free():"+t+" is out of range");return}let e=new Ve(t,t),r=this.ss.upperBound(e);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(e);return}r.pre();let n=r.pointer.high;r.pointer.high+1===t?this.ss.updateKeyByIterator(r,new Ve(n,t)):this.ss.insert(e);}else if(r.equals(this.ss.begin()))if(t+1===r.pointer.low){let n=r.pointer.high;this.ss.updateKeyByIterator(r,new Ve(t,n));}else this.ss.insert(e);else {let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===t?t+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new Ve(s,i))):this.ss.updateKeyByIterator(r,new Ve(s,t)):t+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new Ve(t,i))):this.ss.insert(e);}Pt("free():"+t);};Ot.prototype.clear=function(){Pt("clear()"),this.ss.clear(),this.ss.insert(new Ve(this.min,this.max));};Ot.prototype.intervalCount=function(){return this.ss.size()};Ot.prototype.dump=function(){console.log("length:"+this.ss.size());for(let t of this.ss)console.log(t);};Wy.exports=Ot;});var mu=D((_j,Hy)=>{A();x();I();var q1=$y();Hy.exports.NumberAllocator=q1;});var Vy=D(vu=>{A();x();I();Object.defineProperty(vu,"__esModule",{value:!0});var L1=Sy(),U1=mu(),_u=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new L1.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new U1.NumberAllocator(1,e),this.max=e,this.length=0);}put(e,r){if(r===0||r>this.max)return !1;let n=this.aliasToTopic.get(r);return n&&delete this.topicToAlias[n],this.aliasToTopic.set(r,e),this.topicToAlias[e]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let r=this.topicToAlias[e];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0;}getLruAlias(){let e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};vu.default=_u;});var Gy=D(Qn=>{A();x();I();var D1=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var j1=zn(),F1=D1(Vy()),W1=Mr(),$1=(t,e)=>{t.log("_handleConnack");let{options:r}=t,i=r.protocolVersion===5?e.reasonCode:e.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new F1.default(e.properties.topicAliasMaximum));}e.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=e.properties.serverKeepAlive),e.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=e.properties.maximumPacketSize);}if(i===0)t.reconnecting=!1,t._onConnect(e);else if(i>0){let s=new W1.ErrorWithReasonCode(`Connection refused: ${j1.ReasonCodes[i]}`,i);t.emit("error",s),t.options.reconnectOnConnackError&&t._cleanUp(!0);}};Qn.default=$1;});var zy=D(Su=>{A();x();I();Object.defineProperty(Su,"__esModule",{value:!0});var H1=(t,e,r)=>{t.log("handling pubrel packet");let n=typeof r<"u"?r:t.noop,{messageId:i}=e,s={cmd:"pubcomp",messageId:i};t.incomingStore.get(e,(o,a)=>{o?t._sendPacket(s,n):(t.emit("message",a.topic,a.payload,a),t.handleMessage(a,c=>{if(c)return n(c);t.incomingStore.del(a,t.noop),t._sendPacket(s,n);}));});};Su.default=H1;});var Ky=D(Yn=>{A();x();I();var Jn=Yn&&Yn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yn,"__esModule",{value:!0});var V1=Jn(dy()),G1=Jn(by()),z1=Jn(Gy()),K1=Jn(zn()),Q1=Jn(zy()),Y1=(t,e,r)=>{let{options:n}=t;if(n.protocolVersion===5&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<e.length)return t.emit("error",new Error(`exceeding packets size ${e.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0, V1.default)(t,e,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing(),(0, K1.default)(t,e),r();break;case"pubrel":t.reschedulePing(),(0, Q1.default)(t,e,r);break;case"connack":(0, z1.default)(t,e),r();break;case"auth":t.reschedulePing(),(0, G1.default)(t,e),r();break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};Yn.default=Y1;});var Iu=D(Au=>{A();x();I();Object.defineProperty(Au,"__esModule",{value:!0});var Eu=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535));}allocate(){let e=this.nextId++;return this.nextId===65536&&(this.nextId=1),e}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(e){return !0}deallocate(e){}clear(){}};Au.default=Eu;});var Qy=D(Tu=>{A();x();I();Object.defineProperty(Tu,"__esModule",{value:!0});var xu=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e;}put(e,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={};}};Tu.default=xu;});var Yy=D(_n=>{A();x();I();var J1=_n&&_n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_n,"__esModule",{value:!0});_n.TypedEventEmitter=void 0;var X1=J1((er(),me(Zt))),Z1=Mr(),jo=class{};_n.TypedEventEmitter=jo;(0, Z1.applyMixin)(jo,X1.default);});var Xn=D((GF,Wt)=>{A();x();I();function Pu(t){"@babel/helpers - typeof";return Wt.exports=Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt.exports.__esModule=!0,Wt.exports.default=Wt.exports,Pu(t)}Wt.exports=Pu,Wt.exports.__esModule=!0,Wt.exports.default=Wt.exports;});var Xy=D((r8,Zn)=>{A();x();I();var Jy=Xn().default;function eA(t,e){if(Jy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (e==="string"?String:Number)(t)}Zn.exports=eA,Zn.exports.__esModule=!0,Zn.exports.default=Zn.exports;});var Zy=D((h8,ei)=>{A();x();I();var tA=Xn().default,rA=Xy();function nA(t){var e=rA(t,"string");return tA(e)=="symbol"?e:e+""}ei.exports=nA,ei.exports.__esModule=!0,ei.exports.default=ei.exports;});var eg=D((S8,ti)=>{A();x();I();var iA=Zy();function oA(t,e,r){return (e=iA(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}ti.exports=oA,ti.exports.__esModule=!0,ti.exports.default=ti.exports;});var tg=D((C8,ri)=>{A();x();I();function sA(t){if(Array.isArray(t))return t}ri.exports=sA,ri.exports.__esModule=!0,ri.exports.default=ri.exports;});var rg=D((W8,ni)=>{A();x();I();function aA(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,o,a=[],c=!0,f=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1;}else for(;!(c=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(h){f=!0,i=h;}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return a}}ni.exports=aA,ni.exports.__esModule=!0,ni.exports.default=ni.exports;});var ng=D((X8,ii)=>{A();x();I();function uA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}ii.exports=uA,ii.exports.__esModule=!0,ii.exports.default=ii.exports;});var og=D((u6,oi)=>{A();x();I();var ig=ng();function lA(t,e){if(t){if(typeof t=="string")return ig(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ig(t,e):void 0}}oi.exports=lA,oi.exports.__esModule=!0,oi.exports.default=oi.exports;});var sg=D((w6,si)=>{A();x();I();function cA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}si.exports=cA,si.exports.__esModule=!0,si.exports.default=si.exports;});var ag=D((P6,ai)=>{A();x();I();var fA=tg(),hA=rg(),dA=og(),pA=sg();function yA(t,e){return fA(t)||hA(t,e)||dA(t,e)||pA()}ai.exports=yA,ai.exports.__esModule=!0,ai.exports.default=ai.exports;});var Ou=D((Fo,ug)=>{A();x();I();(function(t,e){typeof Fo=="object"&&typeof ug<"u"?e(Fo):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}));})(Fo,function(t){var e=function(w){return function(y){var P=w(y);return y.add(P),P}},r=function(w){return function(y,P){return w.set(y,P),P}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,o=function(w,y){return function(P){var E=y.get(P),b=E===void 0?P.size:E<s?E+1:0;if(!P.has(b))return w(P,b);if(P.size<i){for(;P.has(b);)b=Math.floor(Math.random()*s);return w(P,b)}if(P.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;P.has(b);)b=Math.floor(Math.random()*n);return w(P,b)}},a=new WeakMap,c=r(a),f=o(c,a),h=e(f);t.addUniqueNumber=h,t.generateUniqueNumber=f;});});var cg=D((z6,ui)=>{A();x();I();function lg(t,e,r,n,i,s,o){try{var a=t[s](o),c=a.value;}catch(f){return void r(f)}a.done?e(c):Promise.resolve(c).then(n,i);}function gA(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){lg(s,n,i,o,a,"next",c);}function a(c){lg(s,n,i,o,a,"throw",c);}o(void 0);})}}ui.exports=gA,ui.exports.__esModule=!0,ui.exports.default=ui.exports;});var Ru=D((nW,li)=>{A();x();I();function bA(t,e){this.v=t,this.k=e;}li.exports=bA,li.exports.__esModule=!0,li.exports.default=li.exports;});var ku=D((dW,$t)=>{A();x();I();function Wo(t,e,r,n){var i=Object.defineProperty;try{i({},"",{});}catch{i=0;}$t.exports=Wo=function(o,a,c,f){function h(d,w){Wo(o,d,function(y){return this._invoke(d,w,y)});}a?i?i(o,a,{value:c,enumerable:!f,configurable:!f,writable:!f}):o[a]=c:(h("next",0),h("throw",1),h("return",2));},$t.exports.__esModule=!0,$t.exports.default=$t.exports,Wo(t,e,r,n);}$t.exports=Wo,$t.exports.__esModule=!0,$t.exports.default=$t.exports;});var Cu=D((EW,Ht)=>{A();x();I();var Rt=ku();function fg(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(y,P,E,b){var m=P&&P.prototype instanceof a?P:a,v=Object.create(m.prototype);return Rt(v,"_invoke",function(R,T,g){var O,_,q,$=0,j=g||[],J=!1,W={p:0,n:0,v:t,a:H,f:H.bind(t,4),d:function(K,X){return O=K,_=0,q=t,W.n=X,o}};function H(G,K){for(_=G,q=K,e=0;!J&&$&&!X&&e<j.length;e++){var X,Q=j[e],V=W.p,te=Q[2];G>3?(X=te===K)&&(q=Q[(_=Q[4])?5:(_=3,3)],Q[4]=Q[5]=t):Q[0]<=V&&((X=G<2&&V<Q[1])?(_=0,W.v=K,W.n=Q[1]):V<te&&(X=G<3||Q[0]>K||K>te)&&(Q[4]=G,Q[5]=K,W.n=te,_=0));}if(X||G>1)return o;throw J=!0,K}return function(G,K,X){if($>1)throw TypeError("Generator is already running");for(J&&K===1&&H(K,X),_=K,q=X;(e=_<2?t:q)||!J;){O||(_?_<3?(_>1&&(W.n=-1),H(_,q)):W.n=q:W.v=q);try{if($=2,O){if(_||(G="next"),e=O[G]){if(!(e=e.call(O,q)))throw TypeError("iterator result is not an object");if(!e.done)return e;q=e.value,_<2&&(_=0);}else _===1&&(e=O.return)&&e.call(O),_<2&&(q=TypeError("The iterator does not provide a '"+G+"' method"),_=1);O=t;}else if((e=(J=W.n<0)?q:R.call(T,W))!==o)break}catch(Q){O=t,_=1,q=Q;}finally{$=1;}}return {value:e,done:J}}}(y,E,b),!0),v}var o={};function a(){}function c(){}function f(){}e=Object.getPrototypeOf;var h=[][n]?e(e([][n]())):(Rt(e={},n,function(){return this}),e),d=f.prototype=a.prototype=Object.create(h);function w(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,f):(y.__proto__=f,Rt(y,i,"GeneratorFunction")),y.prototype=Object.create(d),y}return c.prototype=f,Rt(d,"constructor",f),Rt(f,"constructor",c),c.displayName="GeneratorFunction",Rt(f,i,"GeneratorFunction"),Rt(d),Rt(d,i,"Generator"),Rt(d,n,function(){return this}),Rt(d,"toString",function(){return "[object Generator]"}),(Ht.exports=fg=function(){return {w:s,m:w}},Ht.exports.__esModule=!0,Ht.exports.default=Ht.exports)()}Ht.exports=fg,Ht.exports.__esModule=!0,Ht.exports.default=Ht.exports;});var Nu=D((BW,ci)=>{A();x();I();var wA=Ru(),Bu=ku();function Mu(t,e){function r(i,s,o,a){try{var c=t[i](s),f=c.value;return f instanceof wA?e.resolve(f.v).then(function(h){r("next",h,o,a);},function(h){r("throw",h,o,a);}):e.resolve(f).then(function(h){c.value=h,o(c);},function(h){return r("throw",h,o,a)})}catch(h){a(h);}}var n;this.next||(Bu(Mu.prototype),Bu(Mu.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Bu(this,"_invoke",function(i,s,o){function a(){return new e(function(c,f){r(i,o,c,f);})}return n=n?n.then(a,a):a()},!0);}ci.exports=Mu,ci.exports.__esModule=!0,ci.exports.default=ci.exports;});var qu=D(($W,fi)=>{A();x();I();var mA=Cu(),_A=Nu();function vA(t,e,r,n,i){return new _A(mA().w(t,e,r,n),i||Promise)}fi.exports=vA,fi.exports.__esModule=!0,fi.exports.default=fi.exports;});var hg=D((ZW,hi)=>{A();x();I();var SA=qu();function EA(t,e,r,n,i){var s=SA(t,e,r,n,i);return s.next().then(function(o){return o.done?o.value:s.next()})}hi.exports=EA,hi.exports.__esModule=!0,hi.exports.default=hi.exports;});var dg=D((l4,di)=>{A();x();I();function AA(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function i(){for(;r.length;)if((n=r.pop())in e)return i.value=n,i.done=!1,i;return i.done=!0,i}}di.exports=AA,di.exports.__esModule=!0,di.exports.default=di.exports;});var pg=D((m4,pi)=>{A();x();I();var IA=Xn().default;function xA(t){if(t!=null){var e=t[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return {next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(IA(t)+" is not iterable")}pi.exports=xA,pi.exports.__esModule=!0,pi.exports.default=pi.exports;});var gg=D((O4,Vt)=>{A();x();I();var TA=Ru(),PA=Cu(),OA=hg(),RA=qu(),kA=Nu(),CA=dg(),yg=pg();function Lu(){var t=PA(),e=t.m(Lu),r=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(o){var a=typeof o=="function"&&o.constructor;return !!a&&(a===r||(a.displayName||a.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function s(o){var a,c;return function(f){a||(a={stop:function(){return c(f.a,2)},catch:function(){return f.v},abrupt:function(d,w){return c(f.a,i[d],w)},delegateYield:function(d,w,y){return a.resultName=w,c(f.d,yg(d),y)},finish:function(d){return c(f.f,d)}},c=function(d,w,y){f.p=a.prev,f.n=a.next;try{return d(w,y)}finally{a.next=f.n;}}),a.resultName&&(a[a.resultName]=f.v,a.resultName=void 0),a.sent=f.v,a.next=f.n;try{return o.call(this,a)}finally{f.p=a.prev,f.n=a.next;}}}return (Vt.exports=Lu=function(){return {wrap:function(c,f,h,d){return t.w(s(c),f,h,d&&d.reverse())},isGeneratorFunction:n,mark:t.m,awrap:function(c,f){return new TA(c,f)},AsyncIterator:kA,async:function(c,f,h,d,w){return (n(f)?RA:OA)(s(c),f,h,d,w)},keys:CA,values:yg}},Vt.exports.__esModule=!0,Vt.exports.default=Vt.exports)()}Vt.exports=Lu,Vt.exports.__esModule=!0,Vt.exports.default=Vt.exports;});var wg=D((D4,bg)=>{A();x();I();var $o=gg()();bg.exports=$o;try{regeneratorRuntime=$o;}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=$o:Function("r","regeneratorRuntime = r")($o);}});var _g=D((Ho,mg)=>{A();x();I();(function(t,e){typeof Ho=="object"&&typeof mg<"u"?e(Ho,eg(),ag(),Ou(),cg(),wg()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.brokerFactory={},t._defineProperty,t._slicedToArray,t.fastUniqueNumbers,t._asyncToGenerator,t._regeneratorRuntime));})(Ho,function(t,e,r,n,i,s){var o=function(m){return typeof m.start=="function"},a=new WeakMap;function c(b,m){var v=Object.keys(b);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(b);m&&(R=R.filter(function(T){return Object.getOwnPropertyDescriptor(b,T).enumerable})),v.push.apply(v,R);}return v}function f(b){for(var m=1;m<arguments.length;m++){var v=arguments[m]!=null?arguments[m]:{};m%2?c(Object(v),!0).forEach(function(R){e(b,R,v[R]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(v)):c(Object(v)).forEach(function(R){Object.defineProperty(b,R,Object.getOwnPropertyDescriptor(v,R));});}return b}var h=function(m){return f(f({},m),{},{connect:function(R){var T=R.call;return i(s.mark(function g(){var O,_,q,$;return s.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return O=new MessageChannel,_=O.port1,q=O.port2,j.next=1,T("connect",{port:_},[_]);case 1:return $=j.sent,a.set(q,$),j.abrupt("return",q);case 2:case"end":return j.stop()}},g)}))},disconnect:function(R){var T=R.call;return function(){var g=i(s.mark(function O(_){var q;return s.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(q=a.get(_),q!==void 0){$.next=1;break}throw new Error("The given port is not connected.");case 1:return $.next=2,T("disconnect",{portId:q});case 2:case"end":return $.stop()}},O)}));return function(O){return g.apply(this,arguments)}}()},isSupported:function(R){var T=R.call;return function(){return T("isSupported")}}})};function d(b,m){var v=Object.keys(b);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(b);m&&(R=R.filter(function(T){return Object.getOwnPropertyDescriptor(b,T).enumerable})),v.push.apply(v,R);}return v}function w(b){for(var m=1;m<arguments.length;m++){var v=arguments[m]!=null?arguments[m]:{};m%2?d(Object(v),!0).forEach(function(R){e(b,R,v[R]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(v)):d(Object(v)).forEach(function(R){Object.defineProperty(b,R,Object.getOwnPropertyDescriptor(v,R));});}return b}var y=new WeakMap,P=function(m){if(y.has(m))return y.get(m);var v=new Map;return y.set(m,v),v},E=function(m){var v=h(m);return function(R){var T=P(R);R.addEventListener("message",function(H){var G=H.data,K=G.id;if(K!==null&&T.has(K)){var X=T.get(K),Q=X.reject,V=X.resolve;T.delete(K),G.error===void 0?V(G.result):Q(new Error(G.error.message));}}),o(R)&&R.start();for(var g=function(G){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Q,V){var te=n.generateUniqueNumber(T);T.set(te,{reject:V,resolve:Q}),K===null?R.postMessage({id:te,method:G},X):R.postMessage({id:te,method:G,params:K},X);})},O=function(G,K){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];R.postMessage({id:null,method:G,params:K},X);},_={},q=0,$=Object.entries(v);q<$.length;q++){var j=r($[q],2),J=j[0],W=j[1];_=w(w({},_),{},e({},J,W({call:g,notify:O})));}return w({},_)}};t.createBroker=E;});});var Sg=D((Vo,vg)=>{A();x();I();(function(t,e){typeof Vo=="object"&&typeof vg<"u"?e(Vo,Xn(),_g(),Ou()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t._typeof,t.brokerFactory,t.fastUniqueNumbers));})(Vo,function(t,e,r,n){var i=new Map([[0,null]]),s=new Map([[0,null]]),o=r.createBroker({clearInterval:function(f){var h=f.call;return function(d){e(i.get(d))==="symbol"&&(i.set(d,null),h("clear",{timerId:d,timerType:"interval"}).then(function(){i.delete(d);}));}},clearTimeout:function(f){var h=f.call;return function(d){e(s.get(d))==="symbol"&&(s.set(d,null),h("clear",{timerId:d,timerType:"timeout"}).then(function(){s.delete(d);}));}},setInterval:function(f){var h=f.call;return function(d){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,y=arguments.length,P=new Array(y>2?y-2:0),E=2;E<y;E++)P[E-2]=arguments[E];var b=Symbol(),m=n.generateUniqueNumber(i);i.set(m,b);var v=function(){return h("set",{delay:w,now:performance.timeOrigin+performance.now(),timerId:m,timerType:"interval"}).then(function(){var T=i.get(m);if(T===void 0)throw new Error("The timer is in an undefined state.");T===b&&(d.apply(void 0,P),i.get(m)===b&&v());})};return v(),m}},setTimeout:function(f){var h=f.call;return function(d){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,y=arguments.length,P=new Array(y>2?y-2:0),E=2;E<y;E++)P[E-2]=arguments[E];var b=Symbol(),m=n.generateUniqueNumber(s);return s.set(m,b),h("set",{delay:w,now:performance.timeOrigin+performance.now(),timerId:m,timerType:"timeout"}).then(function(){var v=s.get(m);if(v===void 0)throw new Error("The timer is in an undefined state.");v===b&&(s.delete(m),d.apply(void 0,P));}),m}}}),a=function(f){var h=new Worker(f);return o(h)};t.load=a,t.wrap=o;});});var Ag=D((Go,Eg)=>{A();x();I();(function(t,e){typeof Go=="object"&&typeof Eg<"u"?e(Go,Sg()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimers={},t.workerTimersBroker));})(Go,function(t,e){var r=function(h,d){var w=null;return function(){if(w!==null)return w;var y=new Blob([d],{type:"application/javascript; charset=utf-8"}),P=URL.createObjectURL(y);return w=h(P),setTimeout(function(){return URL.revokeObjectURL(P)}),w}},n=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,i=r(e.load,n),s=function(h){return i().clearInterval(h)},o=function(h){return i().clearTimeout(h)},a=function(){var h;return (h=i()).setInterval.apply(h,arguments)},c=function(){var h;return (h=i()).setTimeout.apply(h,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=a,t.setTimeout=c;});});var yi=D(Fr=>{A();x();I();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.isReactNativeBrowser=Fr.isWebWorker=void 0;var BA=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&M?.versions?!Object.prototype.hasOwnProperty.call(M.versions,"electron"):typeof window.document<"u":!1,Ig=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),xg=()=>typeof navigator<"u"&&navigator.product==="ReactNative",MA=BA()||Ig()||xg();Fr.isWebWorker=Ig();Fr.isReactNativeBrowser=xg();Fr.default=MA;});var Rg=D(Gt=>{A();x();I();var NA=Gt&&Gt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),qA=Gt&&Gt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),LA=Gt&&Gt.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&NA(r,e,n[i]);return qA(r,e),r}}();Object.defineProperty(Gt,"__esModule",{value:!0});var Tg=Ag(),Uu=LA(yi()),Pg={set:Tg.setInterval,clear:Tg.clearInterval},Og={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},UA=t=>{switch(t){case"native":return Og;case"worker":return Pg;case"auto":default:return Uu.default&&!Uu.isWebWorker&&!Uu.isReactNativeBrowser?Pg:Og}};Gt.default=UA;});var ju=D(gi=>{A();x();I();var DA=gi&&gi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gi,"__esModule",{value:!0});var jA=DA(Rg()),Du=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,r){this.client=e,this.timer=typeof r=="object"&&"set"in r&&"clear"in r?r:(0, jA.default)(r),this.setKeepalive(e.options.keepalive);}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null);}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`);}destroy(){this.clear(),this.destroyed=!0;}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout());},this._intervalEvery);}};gi.default=Du;});var zo=D(yt=>{A();x();I();var FA=yt&&yt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),WA=yt&&yt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),Ng=yt&&yt.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&FA(r,e,n[i]);return WA(r,e),r}}(),fr=yt&&yt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yt,"__esModule",{value:!0});var Fu=fr(sy()),$A=or(),kg=fr(cy()),HA=fr(At()),Cg=Ng(Na()),vn=fr(Ua()),VA=fr(Ky()),GA=fr(Iu()),zA=fr(Qy()),bi=Mr(),KA=Yy(),QA=fr(ju()),Bg=Ng(yi()),Wu=globalThis.setImmediate||((...t)=>{let e=t.shift();(0, bi.nextTick)(()=>{e(...t);});}),Mg={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},$u=class t extends KA.TypedEventEmitter{static VERSION=bi.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_deferredReconnect;connackPacket;static defaultId(){return `mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let n in Mg)typeof this.options[n]>"u"?this.options[n]=Mg[n]:this.options[n]=r[n];this.log=this.options.log||(0, HA.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),Bg.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",Bg.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId=typeof r.clientId=="string"?r.clientId:t.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=r.protocolVersion===5&&r.customHandleAcks?r.customHandleAcks:(...n)=>{n[3](null,0);},this.options.writeCache||(Fu.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new GA.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new vn.default,this.incomingStore=r.incomingStore||new vn.default,this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new zA.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:n}=this,i=()=>{let s=n.shift();this.log("deliver :: entry %o",s);let o=null;if(!s){this._resubscribe();return}o=s.packet,this.log("deliver :: call _sendPacket for %o",o);let a=!0;o.messageId&&o.messageId!==0&&(this.messageIdProvider.register(o.messageId)||(a=!1)),a?this._sendPacket(o,c=>{s.cb&&s.cb(c),i();}):(this.log("messageId: %d has already used. The message is skipped and removed.",o.messageId),i());};this.log("connect :: sending queued packets"),i();}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect();}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect());}handleAuth(e,r){r();}handleMessage(e,r){r();}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let e=new $A.Writable,r=Fu.default.parser(this.options),n=null,i=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new vn.default,this.outgoingStore=this.options.outgoingStore||new vn.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",f=>{this.log("parser :: on packet push to packets array."),i.push(f);});let s=()=>{this.log("work :: getting next packet in queue");let f=i.shift();if(f)this.log("work :: packet pulled from queue"),(0, VA.default)(this,f,o);else {this.log("work :: no packets in queue");let h=n;n=null,this.log("work :: done flag is %s",!!h),h&&h();}},o=()=>{if(i.length)(0, bi.nextTick)(s);else {let f=n;n=null,f();}};e._write=(f,h,d)=>{n=d,this.log("writable stream :: parsing buffer"),r.parse(f),s();};let a=f=>{this.log("streamErrorHandler :: error",f.message),f.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",f)):this.noop(f);};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",a),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close");}),this.log("connect: sending packet `connect`");let c={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(c.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(c),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let f={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(f);}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0);},this.options.connectTimeout),this}publish(e,r,n,i){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:s}=this;typeof n=="function"&&(i=n,n=null),n=n||{},n={...{qos:0,retain:!1,dup:!1},...n};let{qos:a,retain:c,dup:f,properties:h,cbStorePut:d}=n;if(this._checkDisconnecting(i))return this;let w=()=>{let y=0;if((a===1||a===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let P={cmd:"publish",topic:e,payload:r,qos:a,retain:c,messageId:y,dup:f};switch(s.protocolVersion===5&&(P.properties=h),this.log("publish :: qos",a),a){case 1:case 2:this.outgoing[P.messageId]={volatile:!1,cb:i||this.noop},this.log("MqttClient:publish: packet cmd: %s",P.cmd),this._sendPacket(P,void 0,d);break;default:this.log("MqttClient:publish: packet cmd: %s",P.cmd),this._sendPacket(P,i,d);break}return !0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!w())&&this._storeProcessingQueue.push({invoke:w,cbStorePut:n.cbStorePut,callback:i}),this}publishAsync(e,r,n){return new Promise((i,s)=>{this.publish(e,r,n,(o,a)=>{o?s(o):i(a);});})}subscribe(e,r,n){let i=this.options.protocolVersion;typeof r=="function"&&(n=r),n=n||this.noop;let s=!1,o=[];typeof e=="string"?(e=[e],o=e):Array.isArray(e)?o=e:typeof e=="object"&&(s=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let a=Cg.validateTopics(o);if(a!==null)return Wu(n,new Error(`Invalid topic ${a}`)),this;if(this._checkDisconnecting(n))return this.log("subscribe: discconecting true"),this;let c={qos:0};i===5&&(c.nl=!1,c.rap=!1,c.rh=0),r={...c,...r};let{properties:f}=r,h=[],d=(P,E)=>{if(E=E||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,P)||this._resubscribeTopics[P].qos<E.qos||s){let b={topic:P,qos:E.qos};i===5&&(b.nl=E.nl,b.rap=E.rap,b.rh=E.rh,b.properties=f),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",b.topic,b.qos),h.push(b);}};if(Array.isArray(e)?e.forEach(P=>{this.log("subscribe: array topic %s",P),d(P);}):Object.keys(e).forEach(P=>{this.log("subscribe: object topic %s, %o",P,e[P]),d(P,e[P]);}),!h.length)return n(null,[]),this;let w=(P,E)=>{let b={cmd:"subscribe",subscriptions:P,messageId:E};if(f&&(b.properties=f),this.options.resubscribe){this.log("subscribe :: resubscribe true");let v=[];P.forEach(R=>{if(this.options.reconnectPeriod>0){let T={qos:R.qos};i===5&&(T.nl=R.nl||!1,T.rap=R.rap||!1,T.rh=R.rh||0,T.properties=R.properties),this._resubscribeTopics[R.topic]=T,v.push(R.topic);}}),this.messageIdToTopic[b.messageId]=v;}let m=new Promise((v,R)=>{this.outgoing[b.messageId]={volatile:!0,cb(T,g){if(!T){let{granted:O}=g;for(let _=0;_<O.length;_+=1)P[_].qos=O[_];}T?R(new bi.ErrorWithSubackPacket(T.message,g)):v(g);}};});return this.log("subscribe :: call _sendPacket"),this._sendPacket(b),m},y=()=>{let P=this.options.subscribeBatchSize??h.length,E=[];for(let b=0;b<h.length;b+=P){let m=h.slice(b,b+P),v=this._nextId();if(v===null)return this.log("No messageId left"),!1;E.push(w(m,v));}return Promise.all(E).then(b=>{n(null,h,b.at(-1));}).catch(b=>{n(b,h,b.packet);}),!0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!y())&&this._storeProcessingQueue.push({invoke:y,callback:n}),this}subscribeAsync(e,r){return new Promise((n,i)=>{this.subscribe(e,r,(s,o)=>{s?i(s):n(o);});})}unsubscribe(e,r,n){typeof e=="string"&&(e=[e]),typeof r=="function"&&(n=r),n=n||this.noop;let i=Cg.validateTopics(e);if(i!==null)return Wu(n,new Error(`Invalid topic ${i}`)),this;if(this._checkDisconnecting(n))return this;let s=()=>{let o=this._nextId();if(o===null)return this.log("No messageId left"),!1;let a={cmd:"unsubscribe",messageId:o,unsubscriptions:[]};return typeof e=="string"?a.unsubscriptions=[e]:Array.isArray(e)&&(a.unsubscriptions=e),this.options.resubscribe&&a.unsubscriptions.forEach(c=>{delete this._resubscribeTopics[c];}),typeof r=="object"&&r.properties&&(a.properties=r.properties),this.outgoing[a.messageId]={volatile:!0,cb:n},this.log("unsubscribe: call _sendPacket"),this._sendPacket(a),!0};return (this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this}unsubscribeAsync(e,r){return new Promise((n,i)=>{this.unsubscribe(e,r,(s,o)=>{s?i(s):n(o);});})}end(e,r,n){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(n=n||r,r=e,e=!1),typeof r!="object"&&(n=n||r,r=null),this.log("end :: cb? %s",!!n),(!n||typeof n!="function")&&(n=this.noop);let i=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(o=>{this.outgoingStore.close(a=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),n){let c=o||a;this.log("end :: closeStores: invoking callback with args"),n(c);}});}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1);},s=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0, bi.nextTick)(i);},r);};return this.disconnecting?(n(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,s,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),s()),this)}endAsync(e,r){return new Promise((n,i)=>{this.end(e,r,s=>{s?i(s):n();});})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:r}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{r(new Error("Message removed"));});}return this}reconnect(e){this.log("client reconnect");let r=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new vn.default,this.outgoingStore=this.options.outgoingStore||new vn.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect();};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e]);}));}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e]);}));}_removeTopicAliasAndRecoverTopicName(e){let r;e.properties&&(r=e.properties.topicAlias);let n=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,n),n.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(n=this.topicAliasSend.getTopicByAlias(r),typeof n>"u")return new Error("Unregistered Topic Alias");e.topic=n;}r&&delete e.properties.topicAlias;}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect();}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect());}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect();},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...");}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null);}_cleanUp(e,r,n={}){if(r&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",r)),this.log("_cleanUp :: forced? %s",e),e)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else {let i={cmd:"disconnect",...n};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(i,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),Wu(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId);});});});}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),r&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",r),r());}_storeAndSend(e,r,n){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let i=e,s;if(i.cmd==="publish"&&(i=(0, kg.default)(e),s=this._removeTopicAliasAndRecoverTopicName(i),s))return r&&r(s);this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n(),this._writePacket(e,r);});}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let n=e.topic.toString();if(this.topicAliasSend)if(r){if(n.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",n,r),!this.topicAliasSend.put(n,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}else n.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(n),r?(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",n,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(n,r),e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",n,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(n),r&&(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",n,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e);}_writePacket(e,r){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let n=Fu.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",n),!n&&r&&r!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",r)):r&&(this.log("_writePacket :: invoking cb"),r());}_sendPacket(e,r,n,i){this.log("_sendPacket :: (%s) :: start",this.options.clientId),n=n||this.noop,r=r||this.noop;let s=this._applyTopicAlias(e);if(s){r(s);return}if(!this.connected){if(e.cmd==="auth"){this._writePacket(e,r);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(e,r,n);return}if(i){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,n);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,n);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId);}_storePacket(e,r,n){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),n=n||this.noop;let i=e;if(i.cmd==="publish"){i=(0, kg.default)(e);let o=this._removeTopicAliasAndRecoverTopicName(i);if(o)return r&&r(o)}let s=i.qos||0;s===0&&this.queueQoSZero||i.cmd!=="publish"?this.queue.push({packet:i,cb:r}):s>0?(r=this.outgoing[i.messageId]?this.outgoing[i.messageId].cb:null,this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n();})):r&&r(new Error("No connection to broker"));}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new QA.default(this,this.options.timerVariant));}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null);}reschedulePing(e=!1){this.keepaliveManager&&this.options.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing();}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule();}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"});}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0);}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let r=0;r<e.length;r++){let n={};n[e[r]]=this._resubscribeTopics[e[r]],n.resubscribe=!0,this.subscribe(n,{properties:n[e[r]].properties});}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1;}_onConnect(e){if(this.disconnected){this.emit("connect",e);return}this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let r=()=>{let n=this.outgoingStore.createStream(),i=()=>{n.destroy(),n=null,this._flushStoreProcessingQueue(),s();},s=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={};};this.once("close",i),n.on("error",a=>{s(),this._flushStoreProcessingQueue(),this.removeListener("close",i),this.emit("error",a);});let o=()=>{if(!n)return;let a=n.read(1),c;if(!a){n.once("readable",o);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[a.messageId]){o();return}!this.disconnecting&&!this.reconnectTimer?(c=this.outgoing[a.messageId]?this.outgoing[a.messageId].cb:null,this.outgoing[a.messageId]={volatile:!1,cb(f,h){c&&c(f,h),o();}},this._packetIdsDuringStoreProcessing[a.messageId]=!0,this.messageIdProvider.register(a.messageId)?this._sendPacket(a,void 0,void 0,!0):this.log("messageId: %d has already used.",a.messageId)):n.destroy&&n.destroy();};n.on("end",()=>{let a=!0;for(let c in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[c]){a=!1;break}this.removeListener("close",i),a?(s(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):r();}),o();};r();}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return !1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0);}_removeOutgoingAndStoreMessage(e,r){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(n,i)=>{r(n,i),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue();});}};yt.default=$u;});var qg=D(Vu=>{A();x();I();Object.defineProperty(Vu,"__esModule",{value:!0});var YA=mu(),Hu=class{numberAllocator;lastId;constructor(){this.numberAllocator=new YA.NumberAllocator(1,65535);}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e);}clear(){this.numberAllocator.clear();}};Vu.default=Hu;});function JA(){if(Lg)return Gu;Lg=!0;let t=2147483647,e=36,r=1,n=26,i=38,s=700,o=72,a=128,c="-",f=/^xn--/,h=/[^\0-\x7F]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=e-r,P=Math.floor,E=String.fromCharCode;function b(H){throw new RangeError(w[H])}function m(H,G){let K=[],X=H.length;for(;X--;)K[X]=G(H[X]);return K}function v(H,G){let K=H.split("@"),X="";K.length>1&&(X=K[0]+"@",H=K[1]),H=H.replace(d,".");let Q=H.split("."),V=m(Q,G).join(".");return X+V}function R(H){let G=[],K=0,X=H.length;for(;K<X;){let Q=H.charCodeAt(K++);if(Q>=55296&&Q<=56319&&K<X){let V=H.charCodeAt(K++);(V&64512)==56320?G.push(((Q&1023)<<10)+(V&1023)+65536):(G.push(Q),K--);}else G.push(Q);}return G}let T=H=>String.fromCodePoint(...H),g=function(H){return H>=48&&H<58?26+(H-48):H>=65&&H<91?H-65:H>=97&&H<123?H-97:e},O=function(H,G){return H+22+75*(H<26)-((G!=0)<<5)},_=function(H,G,K){let X=0;for(H=K?P(H/s):H>>1,H+=P(H/G);H>y*n>>1;X+=e)H=P(H/y);return P(X+(y+1)*H/(H+i))},q=function(H){let G=[],K=H.length,X=0,Q=a,V=o,te=H.lastIndexOf(c);te<0&&(te=0);for(let Y=0;Y<te;++Y)H.charCodeAt(Y)>=128&&b("not-basic"),G.push(H.charCodeAt(Y));for(let Y=te>0?te+1:0;Y<K;){let ee=X;for(let Z=1,ne=e;;ne+=e){Y>=K&&b("invalid-input");let fe=g(H.charCodeAt(Y++));fe>=e&&b("invalid-input"),fe>P((t-X)/Z)&&b("overflow"),X+=fe*Z;let be=ne<=V?r:ne>=V+n?n:ne-V;if(fe<be)break;let ye=e-be;Z>P(t/ye)&&b("overflow"),Z*=ye;}let pe=G.length+1;V=_(X-ee,pe,ee==0),P(X/pe)>t-Q&&b("overflow"),Q+=P(X/pe),X%=pe,G.splice(X++,0,Q);}return String.fromCodePoint(...G)},$=function(H){let G=[];H=R(H);let K=H.length,X=a,Q=0,V=o;for(let ee of H)ee<128&&G.push(E(ee));let te=G.length,Y=te;for(te&&G.push(c);Y<K;){let ee=t;for(let Z of H)Z>=X&&Z<ee&&(ee=Z);let pe=Y+1;ee-X>P((t-Q)/pe)&&b("overflow"),Q+=(ee-X)*pe,X=ee;for(let Z of H)if(Z<X&&++Q>t&&b("overflow"),Z===X){let ne=Q;for(let fe=e;;fe+=e){let be=fe<=V?r:fe>=V+n?n:fe-V;if(ne<be)break;let ye=ne-be,Ae=e-be;G.push(E(O(be+ye%Ae,0))),ne=P(ye/Ae);}G.push(E(O(ne,0))),V=_(Q,pe,Y===te),Q=0,++Y;}++Q,++X;}return G.join("")};return Gu={version:"2.3.1",ucs2:{decode:R,encode:T},decode:q,encode:$,toASCII:function(H){return v(H,function(G){return h.test(G)?"xn--"+$(G):G})},toUnicode:function(H){return v(H,function(G){return f.test(G)?q(G.slice(4).toLowerCase()):G})}},Gu}var Gu,Lg,hr,Ug=ze(()=>{A();x();I();Gu={},Lg=!1;hr=JA(),hr.decode,hr.encode,hr.toASCII,hr.toUnicode,hr.ucs2,hr.version;});function XA(){return Dg||(Dg=!0,zu=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var i=42;e[r]=i;for(r 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]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return !1}return !0}),zu}function ZA(){return jg||(jg=!0,Ku=Error),Ku}function eI(){return Fg||(Fg=!0,Qu=EvalError),Qu}function tI(){return Wg||(Wg=!0,Yu=RangeError),Yu}function rI(){return $g||($g=!0,Ju=ReferenceError),Ju}function sb(){return Hg||(Hg=!0,Xu=SyntaxError),Xu}function Sn(){return Vg||(Vg=!0,Zu=TypeError),Zu}function nI(){return Gg||(Gg=!0,el=URIError),el}function iI(){if(zg)return tl;zg=!0;var t=typeof Symbol<"u"&&Symbol,e=XA();return tl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},tl}function oI(){if(Kg)return rl;Kg=!0;var t={__proto__:null,foo:{}},e=Object;return rl=function(){return {__proto__:t}.foo===t.foo&&!(t instanceof e)},rl}function sI(){if(Qg)return nl;Qg=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(c,f){for(var h=[],d=0;d<c.length;d+=1)h[d]=c[d];for(var w=0;w<f.length;w+=1)h[w+c.length]=f[w];return h},s=function(c,f){for(var h=[],d=f,w=0;d<c.length;d+=1,w+=1)h[w]=c[d];return h},o=function(a,c){for(var f="",h=0;h<a.length;h+=1)f+=a[h],h+1<a.length&&(f+=c);return f};return nl=function(c){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var h=s(arguments,1),d,w=function(){if(this instanceof d){var m=f.apply(this,i(h,arguments));return Object(m)===m?m:this}return f.apply(c,i(h,arguments))},y=r(0,f.length-h.length),P=[],E=0;E<y;E++)P[E]="$"+E;if(d=Function("binder","return function ("+o(P,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var b=function(){};b.prototype=f.prototype,d.prototype=new b,b.prototype=null;}return d},nl}function dl(){if(Yg)return il;Yg=!0;var t=sI();return il=Function.prototype.bind||t,il}function aI(){if(Jg)return ol;Jg=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=dl();return ol=r.call(t,e),ol}function Wr(){if(Xg)return sl;Xg=!0;var t,e=ZA(),r=eI(),n=tI(),i=rI(),s=sb(),o=Sn(),a=nI(),c=Function,f=function(Q){try{return c('"use strict"; return ('+Q+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"");}catch{h=null;}var d=function(){throw new o},w=h?function(){try{return arguments.callee,d}catch{try{return h(arguments,"callee").get}catch{return d}}}():d,y=iI()(),P=oI()(),E=Object.getPrototypeOf||(P?function(Q){return Q.__proto__}:null),b={},m=typeof Uint8Array>"u"||!E?t:E(Uint8Array),v={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":y&&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%":r,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":c,"%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%":y&&E?E(E([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!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%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!E?t:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&E?E(""[Symbol.iterator]()):t,"%Symbol%":y?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":w,"%TypedArray%":m,"%TypeError%":o,"%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%":a,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(E)try{null.error;}catch(Q){var R=E(E(Q));v["%Error.prototype%"]=R;}var T=function Q(V){var te;if(V==="%AsyncFunction%")te=f("async function () {}");else if(V==="%GeneratorFunction%")te=f("function* () {}");else if(V==="%AsyncGeneratorFunction%")te=f("async function* () {}");else if(V==="%AsyncGenerator%"){var Y=Q("%AsyncGeneratorFunction%");Y&&(te=Y.prototype);}else if(V==="%AsyncIteratorPrototype%"){var ee=Q("%AsyncGenerator%");ee&&E&&(te=E(ee.prototype));}return v[V]=te,te},g={__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"]},O=dl(),_=aI(),q=O.call(Function.call,Array.prototype.concat),$=O.call(Function.apply,Array.prototype.splice),j=O.call(Function.call,String.prototype.replace),J=O.call(Function.call,String.prototype.slice),W=O.call(Function.call,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,K=function(V){var te=J(V,0,1),Y=J(V,-1);if(te==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ee=[];return j(V,H,function(pe,Z,ne,fe){ee[ee.length]=ne?j(fe,G,"$1"):Z||pe;}),ee},X=function(V,te){var Y=V,ee;if(_(g,Y)&&(ee=g[Y],Y="%"+ee[0]+"%"),_(v,Y)){var pe=v[Y];if(pe===b&&(pe=T(Y)),typeof pe>"u"&&!te)throw new o("intrinsic "+V+" exists, but is not available. Please file an issue!");return {alias:ee,name:Y,value:pe}}throw new s("intrinsic "+V+" does not exist!")};return sl=function(V,te){if(typeof V!="string"||V.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,V)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=K(V),ee=Y.length>0?Y[0]:"",pe=X("%"+ee+"%",te),Z=pe.name,ne=pe.value,fe=!1,be=pe.alias;be&&(ee=be[0],$(Y,q([0,1],be)));for(var ye=1,Ae=!0;ye<Y.length;ye+=1){var _e=Y[ye],ve=J(_e,0,1),Oe=J(_e,-1);if((ve==='"'||ve==="'"||ve==="`"||Oe==='"'||Oe==="'"||Oe==="`")&&ve!==Oe)throw new s("property names with quotes must have matching quotes");if((_e==="constructor"||!Ae)&&(fe=!0),ee+="."+_e,Z="%"+ee+"%",_(v,Z))ne=v[Z];else if(ne!=null){if(!(_e in ne)){if(!te)throw new o("base intrinsic for "+V+" exists, but the property is not available.");return}if(h&&ye+1>=Y.length){var xe=h(ne,_e);Ae=!!xe,Ae&&"get"in xe&&!("originalValue"in xe.get)?ne=xe.get:ne=ne[_e];}else Ae=_(ne,_e),ne=ne[_e];Ae&&!fe&&(v[Z]=ne);}}return ne},sl}function pl(){if(Zg)return al;Zg=!0;var t=Wr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1});}catch{e=!1;}return al=e,al}function ab(){if(eb)return ul;eb=!0;var t=Wr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length");}catch{e=null;}return ul=e,ul}function uI(){if(tb)return ll;tb=!0;var t=pl(),e=sb(),r=Sn(),n=ab();return ll=function(s,o,a){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,w=!!n&&n(s,o);if(t)t(s,o,{configurable:h===null&&w?w.configurable:!h,enumerable:c===null&&w?w.enumerable:!c,value:a,writable:f===null&&w?w.writable:!f});else if(d||!c&&!f&&!h)s[o]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ll}function lI(){if(rb)return cl;rb=!0;var t=pl(),e=function(){return !!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return !0}},cl=e,cl}function cI(){if(nb)return fl;nb=!0;var t=Wr(),e=uI(),r=lI()(),n=ab(),i=Sn(),s=t("%Math.floor%");return fl=function(a,c){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,d=!0;if("length"in a&&n){var w=n(a,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(d=!1);}return (h||d||!f)&&(r?e(a,"length",c,!0,!0):e(a,"length",c)),a},fl}function fI(){if(ib)return wi;ib=!0;var t=dl(),e=Wr(),r=cI(),n=Sn(),i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),o=e("%Reflect.apply%",!0)||t.call(s,i),a=pl(),c=e("%Math.max%");wi=function(d){if(typeof d!="function")throw new n("a function is required");var w=o(t,s,arguments);return r(w,1+c(0,d.length-(arguments.length-1)),!0)};var f=function(){return o(t,i,arguments)};return a?a(wi,"apply",{value:f}):wi.apply=f,wi}function ub(){if(ob)return hl;ob=!0;var t=Wr(),e=fI(),r=e(t("String.prototype.indexOf"));return hl=function(i,s){var o=t(i,!!s);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},hl}var zu,Dg,Ku,jg,Qu,Fg,Yu,Wg,Ju,$g,Xu,Hg,Zu,Vg,el,Gg,tl,zg,rl,Kg,nl,Qg,il,Yg,ol,Jg,sl,Xg,al,Zg,ul,eb,ll,tb,cl,rb,fl,nb,wi,ib,hl,ob,lb=ze(()=>{A();x();I();zu={},Dg=!1;Ku={},jg=!1;Qu={},Fg=!1;Yu={},Wg=!1;Ju={},$g=!1;Xu={},Hg=!1;Zu={},Vg=!1;el={},Gg=!1;tl={},zg=!1;rl={},Kg=!1;nl={},Qg=!1;il={},Yg=!1;ol={},Jg=!1;sl={},Xg=!1;al={},Zg=!1;ul={},eb=!1;ll={},tb=!1;cl={},rb=!1;fl={},nb=!1;wi={},ib=!1;hl={},ob=!1;});function wl(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function hI(){!En||!$r||(En=!1,$r.length?zt=$r.concat(zt):Ko=-1,zt.length&&cb());}function cb(){if(!En){var t=setTimeout(hI,0);En=!0;for(var e=zt.length;e;){for($r=zt,zt=[];++Ko<e;)$r&&$r[Ko].run();Ko=-1,e=zt.length;}$r=null,En=!1,clearTimeout(t);}}function dI(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];zt.push(new fb(t,e)),zt.length===1&&!En&&setTimeout(cb,0);}function fb(t,e){this.fun=t,this.array=e;}function We(){}function RI(t){wl("_linkedBinding");}function MI(t){wl("dlopen");}function NI(){return []}function qI(){return []}function VI(t,e){if(!t)throw new Error(e||"assertion error")}function QI(){return !1}function hx(){return dr.now()/1e3}function bl(t){var e=Math.floor((Date.now()-dr.now())*.001),r=dr.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=gl)),[n,i]}function pr(){return _l}function Ix(t){return []}var zt,En,$r,Ko,pI,yI,gI,bI,wI,mI,_I,vI,SI,EI,AI,II,xI,TI,PI,OI,kI,CI,BI,LI,UI,ml,DI,jI,FI,WI,$I,HI,GI,zI,KI,YI,JI,XI,ZI,ex,tx,rx,nx,ix,ox,sx,ax,ux,lx,cx,fx,dr,yl,gl,dx,px,yx,gx,bx,mx,_x,vx,Sx,Ex,Ax,_l,vl=ze(()=>{A();x();I();zt=[],En=!1,Ko=-1;fb.prototype.run=function(){this.fun.apply(null,this.array);};pI="browser",yI="x64",gI="browser",bI={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},wI=["/usr/bin/node"],mI=[],_I="v16.8.0",vI={},SI=function(t,e){console.warn((e?e+": ":"")+t);},EI=function(t){wl("binding");},AI=function(t){return 0},II=function(){return "/"},xI=function(t){},TI={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};PI=We,OI=[];kI={},CI=!1,BI={};LI=We,UI=We,ml=function(){return {}},DI=ml,jI=ml,FI=We,WI=We,$I=We,HI={};GI={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},zI=We,KI=We;YI=We,JI=We,XI=We,ZI=We,ex=We,tx=void 0,rx=void 0,nx=void 0,ix=We,ox=2,sx=1,ax="/bin/usr/node",ux=9229,lx="node",cx=[],fx=We,dr={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};dr.now===void 0&&(yl=Date.now(),dr.timing&&dr.timing.navigationStart&&(yl=dr.timing.navigationStart),dr.now=()=>Date.now()-yl);gl=1e9;bl.bigint=function(t){var e=bl(t);return typeof BigInt>"u"?e[0]*gl+e[1]:BigInt(e[0]*gl)+BigInt(e[1])};dx=10,px={},yx=0;gx=pr,bx=pr,mx=pr,_x=pr,vx=pr,Sx=We,Ex=pr,Ax=pr;_l={version:_I,versions:vI,arch:yI,platform:gI,release:TI,_rawDebug:PI,moduleLoadList:OI,binding:EI,_linkedBinding:RI,_events:px,_eventsCount:yx,_maxListeners:dx,on:pr,addListener:gx,once:bx,off:mx,removeListener:_x,removeAllListeners:vx,emit:Sx,prependListener:Ex,prependOnceListener:Ax,listeners:Ix,domain:kI,_exiting:CI,config:BI,dlopen:MI,uptime:hx,_getActiveRequests:NI,_getActiveHandles:qI,reallyExit:LI,_kill:UI,cpuUsage:ml,resourceUsage:DI,memoryUsage:jI,kill:FI,exit:WI,openStdin:$I,allowedNodeEnvironmentFlags:HI,assert:VI,features:GI,_fatalExceptions:zI,setUncaughtExceptionCaptureCallback:KI,hasUncaughtExceptionCaptureCallback:QI,emitWarning:SI,nextTick:dI,_tickCallback:YI,_debugProcess:JI,_debugEnd:XI,_startProfilerIdleNotifier:ZI,_stopProfilerIdleNotifier:ex,stdout:tx,stdin:nx,stderr:rx,abort:ix,umask:AI,chdir:xI,cwd:II,env:bI,title:pI,argv:wI,execArgv:mI,pid:ox,ppid:sx,execPath:ax,debugPort:ux,hrtime:bl,argv0:lx,_preload_modules:cx,setSourceMapsEnabled:fx};});function xx(){if(hb)return Sl;hb=!0;var t=_l;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function r(s,o){for(var a="",c=0,f=-1,h=0,d,w=0;w<=s.length;++w){if(w<s.length)d=s.charCodeAt(w);else {if(d===47)break;d=47;}if(d===47){if(!(f===w-1||h===1))if(f!==w-1&&h===2){if(a.length<2||c!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",c=0):(a=a.slice(0,y),c=a.length-1-a.lastIndexOf("/")),f=w,h=0;continue}}else if(a.length===2||a.length===1){a="",c=0,f=w,h=0;continue}}o&&(a.length>0?a+="/..":a="..",c=2);}else a.length>0?a+="/"+s.slice(f+1,w):a=s.slice(f+1,w),c=w-f-1;f=w,h=0;}else d===46&&h!==-1?++h:h=-1;}return a}function n(s,o){var a=o.dir||o.root,c=o.base||(o.name||"")+(o.ext||"");return a?a===o.root?a+c:a+s+c:c}var i={resolve:function(){for(var o="",a=!1,c,f=arguments.length-1;f>=-1&&!a;f--){var h;f>=0?h=arguments[f]:(c===void 0&&(c=t.cwd()),h=c),e(h),h.length!==0&&(o=h+"/"+o,a=h.charCodeAt(0)===47);}return o=r(o,!a),a?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return ".";var a=o.charCodeAt(0)===47,c=o.charCodeAt(o.length-1)===47;return o=r(o,!a),o.length===0&&!a&&(o="."),o.length>0&&c&&(o+="/"),a?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return ".";for(var o,a=0;a<arguments.length;++a){var c=arguments[a];e(c),c.length>0&&(o===void 0?o=c:o+="/"+c);}return o===void 0?".":i.normalize(o)},relative:function(o,a){if(e(o),e(a),o===a||(o=i.resolve(o),a=i.resolve(a),o===a))return "";for(var c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var f=o.length,h=f-c,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var w=a.length,y=w-d,P=h<y?h:y,E=-1,b=0;b<=P;++b){if(b===P){if(y>P){if(a.charCodeAt(d+b)===47)return a.slice(d+b+1);if(b===0)return a.slice(d+b)}else h>P&&(o.charCodeAt(c+b)===47?E=b:b===0&&(E=0));break}var m=o.charCodeAt(c+b),v=a.charCodeAt(d+b);if(m!==v)break;m===47&&(E=b);}var R="";for(b=c+E+1;b<=f;++b)(b===f||o.charCodeAt(b)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return ".";for(var a=o.charCodeAt(0),c=a===47,f=-1,h=!0,d=o.length-1;d>=1;--d)if(a=o.charCodeAt(d),a===47){if(!h){f=d;break}}else h=!1;return f===-1?c?"/":".":c&&f===1?"//":o.slice(0,f)},basename:function(o,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(o);var c=0,f=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=o.length){if(a.length===o.length&&a===o)return "";var w=a.length-1,y=-1;for(d=o.length-1;d>=0;--d){var P=o.charCodeAt(d);if(P===47){if(!h){c=d+1;break}}else y===-1&&(h=!1,y=d+1),w>=0&&(P===a.charCodeAt(w)?--w===-1&&(f=d):(w=-1,f=y));}return c===f?f=y:f===-1&&(f=o.length),o.slice(c,f)}else {for(d=o.length-1;d>=0;--d)if(o.charCodeAt(d)===47){if(!h){c=d+1;break}}else f===-1&&(h=!1,f=d+1);return f===-1?"":o.slice(c,f)}},extname:function(o){e(o);for(var a=-1,c=0,f=-1,h=!0,d=0,w=o.length-1;w>=0;--w){var y=o.charCodeAt(w);if(y===47){if(!h){c=w+1;break}continue}f===-1&&(h=!1,f=w+1),y===46?a===-1?a=w:d!==1&&(d=1):a!==-1&&(d=-1);}return a===-1||f===-1||d===0||d===1&&a===f-1&&a===c+1?"":o.slice(a,f)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var a={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return a;var c=o.charCodeAt(0),f=c===47,h;f?(a.root="/",h=1):h=0;for(var d=-1,w=0,y=-1,P=!0,E=o.length-1,b=0;E>=h;--E){if(c=o.charCodeAt(E),c===47){if(!P){w=E+1;break}continue}y===-1&&(P=!1,y=E+1),c===46?d===-1?d=E:b!==1&&(b=1):d!==-1&&(b=-1);}return d===-1||y===-1||b===0||b===1&&d===y-1&&d===w+1?y!==-1&&(w===0&&f?a.base=a.name=o.slice(1,y):a.base=a.name=o.slice(w,y)):(w===0&&f?(a.name=o.slice(1,d),a.base=o.slice(1,y)):(a.name=o.slice(w,d),a.base=o.slice(w,y)),a.ext=o.slice(d,y)),w>0?a.dir=o.slice(0,w-1):f&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Sl=i,Sl}var Sl,hb,El,db=ze(()=>{A();x();I();vl();Sl={},hb=!1;El=xx();});var Ib={};Kr(Ib,{URL:()=>jx,Url:()=>Nx,default:()=>Ge,fileURLToPath:()=>Eb,format:()=>qx,parse:()=>Dx,pathToFileURL:()=>Ab,resolve:()=>Lx,resolveObject:()=>Ux});function Px(){if(pb)return Al;pb=!0;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,a=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,f=c?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,d=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,y=w?WeakRef.prototype.deref:null,P=Boolean.prototype.valueOf,E=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,R=String.prototype.replace,T=String.prototype.toUpperCase,g=String.prototype.toLowerCase,O=RegExp.prototype.test,_=Array.prototype.concat,q=Array.prototype.join,$=Array.prototype.slice,j=Math.floor,J=typeof BigInt=="function"?BigInt.prototype.valueOf:null,W=Object.getOwnPropertySymbols,H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",K=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,X=Object.prototype.propertyIsEnumerable,Q=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function V(k,B){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||O.call(/e/,B))return B;var re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var ie=k<0?-j(-k):j(k);if(ie!==k){var oe=String(ie),ce=v.call(B,oe.length+1);return R.call(oe,re,"$&_")+"."+R.call(R.call(ce,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(B,re,"$&_")}var te=Tx,Y=te.custom,ee=Oe(Y)?Y:null;Al=function k(B,re,ie,oe){var ce=re||{};if(Re(ce,"quoteStyle")&&ce.quoteStyle!=="single"&&ce.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(ce,"maxStringLength")&&(typeof ce.maxStringLength=="number"?ce.maxStringLength<0&&ce.maxStringLength!==1/0:ce.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Qt=Re(ce,"customInspect")?ce.customInspect:!0;if(typeof Qt!="boolean"&&Qt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(ce,"indent")&&ce.indent!==null&&ce.indent!==" "&&!(parseInt(ce.indent,10)===ce.indent&&ce.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(ce,"numericSeparator")&&typeof ce.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var br=ce.numericSeparator;if(typeof B>"u")return "undefined";if(B===null)return "null";if(typeof B=="boolean")return B?"true":"false";if(typeof B=="string")return at(B,ce);if(typeof B=="number"){if(B===0)return 1/0/B>0?"0":"-0";var Ye=String(B);return br?V(B,Ye):Ye}if(typeof B=="bigint"){var Yt=String(B)+"n";return br?V(B,Yt):Yt}var es=typeof ce.depth>"u"?5:ce.depth;if(typeof ie>"u"&&(ie=0),ie>=es&&es>0&&typeof B=="object")return ne(B)?"[Array]":"[Object]";var Gr=C(ce,ie);if(typeof oe>"u")oe=[];else if(Bt(oe,B)>=0)return "[Circular]";function ut(zr,Ti,Qb){if(Ti&&(oe=$.call(oe),oe.push(Ti)),Qb){var oc={depth:ce.depth};return Re(ce,"quoteStyle")&&(oc.quoteStyle=ce.quoteStyle),k(zr,oc,ie+1,oe)}return k(zr,ce,ie+1,oe)}if(typeof B=="function"&&!be(B)){var Xl=Ct(B),Zl=F(B,ut);return "[Function"+(Xl?": "+Xl:" (anonymous)")+"]"+(Zl.length>0?" { "+q.call(Zl,", ")+" }":"")}if(Oe(B)){var ec=G?R.call(String(B),/^(Symbol\(.*\))_[^)]*$/,"$1"):H.call(B);return typeof B=="object"&&!G?p(ec):ec}if(Xo(B)){for(var Pn="<"+g.call(String(B.nodeName)),ts=B.attributes||[],xi=0;xi<ts.length;xi++)Pn+=" "+ts[xi].name+"="+pe(Z(ts[xi].value),"double",ce);return Pn+=">",B.childNodes&&B.childNodes.length&&(Pn+="..."),Pn+="</"+g.call(String(B.nodeName))+">",Pn}if(ne(B)){if(B.length===0)return "[]";var rs=F(B,ut);return Gr&&!S(rs)?"["+N(rs,Gr)+"]":"[ "+q.call(rs,", ")+" ]"}if(ye(B)){var ns=F(B,ut);return !("cause"in Error.prototype)&&"cause"in B&&!X.call(B,"cause")?"{ ["+String(B)+"] "+q.call(_.call("[cause]: "+ut(B.cause),ns),", ")+" }":ns.length===0?"["+String(B)+"]":"{ ["+String(B)+"] "+q.call(ns,", ")+" }"}if(typeof B=="object"&&Qt){if(ee&&typeof B[ee]=="function"&&te)return te(B,{depth:es-ie});if(Qt!=="symbol"&&typeof B.inspect=="function")return B.inspect()}if(xn(B)){var tc=[];return n&&n.call(B,function(zr,Ti){tc.push(ut(Ti,B,!0)+" => "+ut(zr,B));}),l("Map",r.call(B),tc,Gr)}if(Ze(B)){var rc=[];return a&&a.call(B,function(zr){rc.push(ut(zr,B));}),l("Set",o.call(B),rc,Gr)}if(Ii(B))return u("WeakMap");if(Tn(B))return u("WeakSet");if(Vr(B))return u("WeakRef");if(_e(B))return p(ut(Number(B)));if(xe(B))return p(ut(J.call(B)));if(ve(B))return p(P.call(B));if(Ae(B))return p(ut(String(B)));if(typeof window<"u"&&B===window)return "{ [object Window] }";if(typeof globalThis<"u"&&B===globalThis||typeof Il<"u"&&B===Il)return "{ [object globalThis] }";if(!fe(B)&&!be(B)){var is=F(B,ut),nc=Q?Q(B)===Object.prototype:B instanceof Object||B.constructor===Object,os=B instanceof Object?"":"null prototype",ic=!nc&&K&&Object(B)===B&&K in B?v.call(Ne(B),8,-1):os?"Object":"",Kb=nc||typeof B.constructor!="function"?"":B.constructor.name?B.constructor.name+" ":"",ss=Kb+(ic||os?"["+q.call(_.call([],ic||[],os||[]),": ")+"] ":"");return is.length===0?ss+"{}":Gr?ss+"{"+N(is,Gr)+"}":ss+"{ "+q.call(is,", ")+" }"}return String(B)};function pe(k,B,re){var ie=(re.quoteStyle||B)==="double"?'"':"'";return ie+k+ie}function Z(k){return R.call(String(k),/"/g,""")}function ne(k){return Ne(k)==="[object Array]"&&(!K||!(typeof k=="object"&&K in k))}function fe(k){return Ne(k)==="[object Date]"&&(!K||!(typeof k=="object"&&K in k))}function be(k){return Ne(k)==="[object RegExp]"&&(!K||!(typeof k=="object"&&K in k))}function ye(k){return Ne(k)==="[object Error]"&&(!K||!(typeof k=="object"&&K in k))}function Ae(k){return Ne(k)==="[object String]"&&(!K||!(typeof k=="object"&&K in k))}function _e(k){return Ne(k)==="[object Number]"&&(!K||!(typeof k=="object"&&K in k))}function ve(k){return Ne(k)==="[object Boolean]"&&(!K||!(typeof k=="object"&&K in k))}function Oe(k){if(G)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return !0;if(!k||typeof k!="object"||!H)return !1;try{return H.call(k),!0}catch{}return !1}function xe(k){if(!k||typeof k!="object"||!J)return !1;try{return J.call(k),!0}catch{}return !1}var st=Object.prototype.hasOwnProperty||function(k){return k in(this||Il)};function Re(k,B){return st.call(k,B)}function Ne(k){return E.call(k)}function Ct(k){if(k.name)return k.name;var B=m.call(b.call(k),/^function\s*([\w$]+)/);return B?B[1]:null}function Bt(k,B){if(k.indexOf)return k.indexOf(B);for(var re=0,ie=k.length;re<ie;re++)if(k[re]===B)return re;return -1}function xn(k){if(!r||!k||typeof k!="object")return !1;try{r.call(k);try{o.call(k);}catch{return !0}return k instanceof Map}catch{}return !1}function Ii(k){if(!f||!k||typeof k!="object")return !1;try{f.call(k,f);try{d.call(k,d);}catch{return !0}return k instanceof WeakMap}catch{}return !1}function Vr(k){if(!y||!k||typeof k!="object")return !1;try{return y.call(k),!0}catch{}return !1}function Ze(k){if(!o||!k||typeof k!="object")return !1;try{o.call(k);try{r.call(k);}catch{return !0}return k instanceof Set}catch{}return !1}function Tn(k){if(!d||!k||typeof k!="object")return !1;try{d.call(k,d);try{f.call(k,f);}catch{return !0}return k instanceof WeakSet}catch{}return !1}function Xo(k){return !k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function at(k,B){if(k.length>B.maxStringLength){var re=k.length-B.maxStringLength,ie="... "+re+" more character"+(re>1?"s":"");return at(v.call(k,0,B.maxStringLength),B)+ie}var oe=R.call(R.call(k,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Zo);return pe(oe,"single",B)}function Zo(k){var B=k.charCodeAt(0),re={8:"b",9:"t",10:"n",12:"f",13:"r"}[B];return re?"\\"+re:"\\x"+(B<16?"0":"")+T.call(B.toString(16))}function p(k){return "Object("+k+")"}function u(k){return k+" { ? }"}function l(k,B,re,ie){var oe=ie?N(re,ie):q.call(re,", ");return k+" ("+B+") {"+oe+"}"}function S(k){for(var B=0;B<k.length;B++)if(Bt(k[B],`
|
|
6
|
+
`)>=0)return !1;return !0}function C(k,B){var re;if(k.indent===" ")re=" ";else if(typeof k.indent=="number"&&k.indent>0)re=q.call(Array(k.indent+1)," ");else return null;return {base:re,prev:q.call(Array(B+1),re)}}function N(k,B){if(k.length===0)return "";var re=`
|
|
7
|
+
`+B.prev+B.base;return re+q.call(k,","+re)+`
|
|
8
|
+
`+B.prev}function F(k,B){var re=ne(k),ie=[];if(re){ie.length=k.length;for(var oe=0;oe<k.length;oe++)ie[oe]=Re(k,oe)?B(k[oe],k):"";}var ce=typeof W=="function"?W(k):[],Qt;if(G){Qt={};for(var br=0;br<ce.length;br++)Qt["$"+ce[br]]=ce[br];}for(var Ye in k)Re(k,Ye)&&(re&&String(Number(Ye))===Ye&&Ye<k.length||G&&Qt["$"+Ye]instanceof Symbol||(O.call(/[^\w$]/,Ye)?ie.push(B(Ye,k)+": "+B(k[Ye],k)):ie.push(Ye+": "+B(k[Ye],k))));if(typeof W=="function")for(var Yt=0;Yt<ce.length;Yt++)X.call(k,ce[Yt])&&ie.push("["+B(ce[Yt])+"]: "+B(k[ce[Yt]],k));return ie}return Al}function Ox(){if(yb)return xl;yb=!0;var t=Wr(),e=ub(),r=Px(),n=Sn(),i=t("%WeakMap%",!0),s=t("%Map%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),h=e("Map.prototype.set",!0),d=e("Map.prototype.has",!0),w=function(b,m){for(var v=b,R;(R=v.next)!==null;v=R)if(R.key===m)return v.next=R.next,R.next=b.next,b.next=R,R},y=function(b,m){var v=w(b,m);return v&&v.value},P=function(b,m,v){var R=w(b,m);R?R.value=v:b.next={key:m,next:b.next,value:v};},E=function(b,m){return !!w(b,m)};return xl=function(){var m,v,R,T={assert:function(g){if(!T.has(g))throw new n("Side channel does not contain "+r(g))},get:function(g){if(i&&g&&(typeof g=="object"||typeof g=="function")){if(m)return o(m,g)}else if(s){if(v)return f(v,g)}else if(R)return y(R,g)},has:function(g){if(i&&g&&(typeof g=="object"||typeof g=="function")){if(m)return c(m,g)}else if(s){if(v)return d(v,g)}else if(R)return E(R,g);return !1},set:function(g,O){i&&g&&(typeof g=="object"||typeof g=="function")?(m||(m=new i),a(m,g,O)):s?(v||(v=new s),h(v,g,O)):(R||(R={key:{},next:null}),P(R,g,O));}};return T},xl}function Bl(){if(gb)return Tl;gb=!0;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Tl={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Tl}function Sb(){if(bb)return Pl;bb=!0;var t=Bl(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var b=[],m=0;m<256;++m)b.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return b}(),i=function(m){for(;m.length>1;){var v=m.pop(),R=v.obj[v.prop];if(r(R)){for(var T=[],g=0;g<R.length;++g)typeof R[g]<"u"&&T.push(R[g]);v.obj[v.prop]=T;}}},s=function(m,v){for(var R=v&&v.plainObjects?Object.create(null):{},T=0;T<m.length;++T)typeof m[T]<"u"&&(R[T]=m[T]);return R},o=function b(m,v,R){if(!v)return m;if(typeof v!="object"){if(r(m))m.push(v);else if(m&&typeof m=="object")(R&&(R.plainObjects||R.allowPrototypes)||!e.call(Object.prototype,v))&&(m[v]=!0);else return [m,v];return m}if(!m||typeof m!="object")return [m].concat(v);var T=m;return r(m)&&!r(v)&&(T=s(m,R)),r(m)&&r(v)?(v.forEach(function(g,O){if(e.call(m,O)){var _=m[O];_&&typeof _=="object"&&g&&typeof g=="object"?m[O]=b(_,g,R):m.push(g);}else m[O]=g;}),m):Object.keys(v).reduce(function(g,O){var _=v[O];return e.call(g,O)?g[O]=b(g[O],_,R):g[O]=_,g},T)},a=function(m,v){return Object.keys(v).reduce(function(R,T){return R[T]=v[T],R},m)},c=function(b,m,v){var R=b.replace(/\+/g," ");if(v==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},f=1024,h=function(m,v,R,T,g){if(m.length===0)return m;var O=m;if(typeof m=="symbol"?O=Symbol.prototype.toString.call(m):typeof m!="string"&&(O=String(m)),R==="iso-8859-1")return escape(O).replace(/%u[0-9a-f]{4}/gi,function(H){return "%26%23"+parseInt(H.slice(2),16)+"%3B"});for(var _="",q=0;q<O.length;q+=f){for(var $=O.length>=f?O.slice(q,q+f):O,j=[],J=0;J<$.length;++J){var W=$.charCodeAt(J);if(W===45||W===46||W===95||W===126||W>=48&&W<=57||W>=65&&W<=90||W>=97&&W<=122||g===t.RFC1738&&(W===40||W===41)){j[j.length]=$.charAt(J);continue}if(W<128){j[j.length]=n[W];continue}if(W<2048){j[j.length]=n[192|W>>6]+n[128|W&63];continue}if(W<55296||W>=57344){j[j.length]=n[224|W>>12]+n[128|W>>6&63]+n[128|W&63];continue}J+=1,W=65536+((W&1023)<<10|$.charCodeAt(J)&1023),j[j.length]=n[240|W>>18]+n[128|W>>12&63]+n[128|W>>6&63]+n[128|W&63];}_+=j.join("");}return _},d=function(m){for(var v=[{obj:{o:m},prop:"o"}],R=[],T=0;T<v.length;++T)for(var g=v[T],O=g.obj[g.prop],_=Object.keys(O),q=0;q<_.length;++q){var $=_[q],j=O[$];typeof j=="object"&&j!==null&&R.indexOf(j)===-1&&(v.push({obj:O,prop:$}),R.push(j));}return i(v),m},w=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},y=function(m){return !m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},P=function(m,v){return [].concat(m,v)},E=function(m,v){if(r(m)){for(var R=[],T=0;T<m.length;T+=1)R.push(v(m[T]));return R}return v(m)};return Pl={arrayToObject:s,assign:a,combine:P,compact:d,decode:c,encode:h,isBuffer:y,isRegExp:w,maybeMap:E,merge:o},Pl}function Rx(){if(wb)return Ol;wb=!0;var t=Ox(),e=Sb(),r=Bl(),n=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,m){return b+"["+m+"]"},repeat:function(b){return b}},s=Array.isArray,o=Array.prototype.push,a=function(E,b){o.apply(E,s(b)?b:[b]);},c=Date.prototype.toISOString,f=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(b){return c.call(b)},skipNulls:!1,strictNullHandling:!1},d=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},w={},y=function E(b,m,v,R,T,g,O,_,q,$,j,J,W,H,G,K,X,Q){for(var V=b,te=Q,Y=0,ee=!1;(te=te.get(w))!==void 0&&!ee;){var pe=te.get(b);if(Y+=1,typeof pe<"u"){if(pe===Y)throw new RangeError("Cyclic object value");ee=!0;}typeof te.get(w)>"u"&&(Y=0);}if(typeof $=="function"?V=$(m,V):V instanceof Date?V=W(V):v==="comma"&&s(V)&&(V=e.maybeMap(V,function(Ne){return Ne instanceof Date?W(Ne):Ne})),V===null){if(g)return q&&!K?q(m,h.encoder,X,"key",H):m;V="";}if(d(V)||e.isBuffer(V)){if(q){var Z=K?m:q(m,h.encoder,X,"key",H);return [G(Z)+"="+G(q(V,h.encoder,X,"value",H))]}return [G(m)+"="+G(String(V))]}var ne=[];if(typeof V>"u")return ne;var fe;if(v==="comma"&&s(V))K&&q&&(V=e.maybeMap(V,q)),fe=[{value:V.length>0?V.join(",")||null:void 0}];else if(s($))fe=$;else {var be=Object.keys(V);fe=j?be.sort(j):be;}var ye=_?m.replace(/\./g,"%2E"):m,Ae=R&&s(V)&&V.length===1?ye+"[]":ye;if(T&&s(V)&&V.length===0)return Ae+"[]";for(var _e=0;_e<fe.length;++_e){var ve=fe[_e],Oe=typeof ve=="object"&&typeof ve.value<"u"?ve.value:V[ve];if(!(O&&Oe===null)){var xe=J&&_?ve.replace(/\./g,"%2E"):ve,st=s(V)?typeof v=="function"?v(Ae,xe):Ae:Ae+(J?"."+xe:"["+xe+"]");Q.set(b,Y);var Re=t();Re.set(w,Q),a(ne,E(Oe,st,v,R,T,g,O,_,v==="comma"&&K&&s(V)?null:q,$,j,J,W,H,G,K,X,Re));}}return ne},P=function(b){if(!b)return h;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var m=b.charset||h.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=r.default;if(typeof b.format<"u"){if(!n.call(r.formatters,b.format))throw new TypeError("Unknown format option provided.");v=b.format;}var R=r.formatters[v],T=h.filter;(typeof b.filter=="function"||s(b.filter))&&(T=b.filter);var g;if(b.arrayFormat in i?g=b.arrayFormat:"indices"in b?g=b.indices?"indices":"repeat":g=h.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var O=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:h.allowDots:!!b.allowDots;return {addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:h.addQueryPrefix,allowDots:O,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:g,charset:m,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:h.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?h.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:h.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:h.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:h.encodeValuesOnly,filter:T,format:v,formatter:R,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:h.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:h.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:h.strictNullHandling}};return Ol=function(E,b){var m=E,v=P(b),R,T;typeof v.filter=="function"?(T=v.filter,m=T("",m)):s(v.filter)&&(T=v.filter,R=T);var g=[];if(typeof m!="object"||m===null)return "";var O=i[v.arrayFormat],_=O==="comma"&&v.commaRoundTrip;R||(R=Object.keys(m)),v.sort&&R.sort(v.sort);for(var q=t(),$=0;$<R.length;++$){var j=R[$];v.skipNulls&&m[j]===null||a(g,y(m[j],j,O,_,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,q));}var J=g.join(v.delimiter),W=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?W+="utf8=%26%2310003%3B&":W+="utf8=%E2%9C%93&"),J.length>0?W+J:""},Ol}function kx(){if(mb)return Rl;mb=!0;var t=Sb(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(y,P){return String.fromCharCode(parseInt(P,10))})},s=function(w,y){return w&&typeof w=="string"&&y.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(y,P){var E={__proto__:null},b=P.ignoreQueryPrefix?y.replace(/^\?/,""):y;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=P.parameterLimit===1/0?void 0:P.parameterLimit,v=b.split(P.delimiter,m),R=-1,T,g=P.charset;if(P.charsetSentinel)for(T=0;T<v.length;++T)v[T].indexOf("utf8=")===0&&(v[T]===a?g="utf-8":v[T]===o&&(g="iso-8859-1"),R=T,T=v.length);for(T=0;T<v.length;++T)if(T!==R){var O=v[T],_=O.indexOf("]="),q=_===-1?O.indexOf("="):_+1,$,j;q===-1?($=P.decoder(O,n.decoder,g,"key"),j=P.strictNullHandling?null:""):($=P.decoder(O.slice(0,q),n.decoder,g,"key"),j=t.maybeMap(s(O.slice(q+1),P),function(W){return P.decoder(W,n.decoder,g,"value")})),j&&P.interpretNumericEntities&&g==="iso-8859-1"&&(j=i(j)),O.indexOf("[]=")>-1&&(j=r(j)?[j]:j);var J=e.call(E,$);J&&P.duplicates==="combine"?E[$]=t.combine(E[$],j):(!J||P.duplicates==="last")&&(E[$]=j);}return E},f=function(w,y,P,E){for(var b=E?y:s(y,P),m=w.length-1;m>=0;--m){var v,R=w[m];if(R==="[]"&&P.parseArrays)v=P.allowEmptyArrays&&(b===""||P.strictNullHandling&&b===null)?[]:[].concat(b);else {v=P.plainObjects?Object.create(null):{};var T=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,g=P.decodeDotInKeys?T.replace(/%2E/g,"."):T,O=parseInt(g,10);!P.parseArrays&&g===""?v={0:b}:!isNaN(O)&&R!==g&&String(O)===g&&O>=0&&P.parseArrays&&O<=P.arrayLimit?(v=[],v[O]=b):g!=="__proto__"&&(v[g]=b);}b=v;}return b},h=function(y,P,E,b){if(y){var m=E.allowDots?y.replace(/\.([^.[]+)/g,"[$1]"):y,v=/(\[[^[\]]*])/,R=/(\[[^[\]]*])/g,T=E.depth>0&&v.exec(m),g=T?m.slice(0,T.index):m,O=[];if(g){if(!E.plainObjects&&e.call(Object.prototype,g)&&!E.allowPrototypes)return;O.push(g);}for(var _=0;E.depth>0&&(T=R.exec(m))!==null&&_<E.depth;){if(_+=1,!E.plainObjects&&e.call(Object.prototype,T[1].slice(1,-1))&&!E.allowPrototypes)return;O.push(T[1]);}if(T){if(E.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+E.depth+" and strictDepth is true");O.push("["+m.slice(T.index)+"]");}return f(O,P,E,b)}},d=function(y){if(!y)return n;if(typeof y.allowEmptyArrays<"u"&&typeof y.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof y.decodeDotInKeys<"u"&&typeof y.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(y.decoder!==null&&typeof y.decoder<"u"&&typeof y.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof y.charset<"u"&&y.charset!=="utf-8"&&y.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=typeof y.charset>"u"?n.charset:y.charset,E=typeof y.duplicates>"u"?n.duplicates:y.duplicates;if(E!=="combine"&&E!=="first"&&E!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof y.allowDots>"u"?y.decodeDotInKeys===!0?!0:n.allowDots:!!y.allowDots;return {allowDots:b,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof y.allowPrototypes=="boolean"?y.allowPrototypes:n.allowPrototypes,allowSparse:typeof y.allowSparse=="boolean"?y.allowSparse:n.allowSparse,arrayLimit:typeof y.arrayLimit=="number"?y.arrayLimit:n.arrayLimit,charset:P,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:n.charsetSentinel,comma:typeof y.comma=="boolean"?y.comma:n.comma,decodeDotInKeys:typeof y.decodeDotInKeys=="boolean"?y.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof y.decoder=="function"?y.decoder:n.decoder,delimiter:typeof y.delimiter=="string"||t.isRegExp(y.delimiter)?y.delimiter:n.delimiter,depth:typeof y.depth=="number"||y.depth===!1?+y.depth:n.depth,duplicates:E,ignoreQueryPrefix:y.ignoreQueryPrefix===!0,interpretNumericEntities:typeof y.interpretNumericEntities=="boolean"?y.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof y.parameterLimit=="number"?y.parameterLimit:n.parameterLimit,parseArrays:y.parseArrays!==!1,plainObjects:typeof y.plainObjects=="boolean"?y.plainObjects:n.plainObjects,strictDepth:typeof y.strictDepth=="boolean"?!!y.strictDepth:n.strictDepth,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:n.strictNullHandling}};return Rl=function(w,y){var P=d(y);if(w===""||w===null||typeof w>"u")return P.plainObjects?Object.create(null):{};for(var E=typeof w=="string"?c(w,P):w,b=P.plainObjects?Object.create(null):{},m=Object.keys(E),v=0;v<m.length;++v){var R=m[v],T=h(R,E[R],P,typeof w=="string");b=t.merge(b,T,P);}return P.allowSparse===!0?b:t.compact(b)},Rl}function Cx(){if(_b)return kl;_b=!0;var t=Rx(),e=kx(),r=Bl();return kl={formats:r,parse:e,stringify:t},kl}function Bx(){if(vb)return Hr;vb=!0;var t=hr;function e(){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;}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",`
|
|
9
|
+
`," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),f=["/","?","#"],h=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=Cx();function m(g,O,_){if(g&&typeof g=="object"&&g instanceof e)return g;var q=new e;return q.parse(g,O,_),q}e.prototype.parse=function(g,O,_){if(typeof g!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof g);var q=g.indexOf("?"),$=q!==-1&&q<g.indexOf("#")?"?":"#",j=g.split($),J=/\\/g;j[0]=j[0].replace(J,"/"),g=j.join($);var W=g;if(W=W.trim(),!_&&g.split("#").length===1){var H=i.exec(W);if(H)return this.path=W,this.href=W,this.pathname=H[1],H[2]?(this.search=H[2],O?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):O&&(this.search="",this.query={}),this}var G=r.exec(W);if(G){G=G[0];var K=G.toLowerCase();this.protocol=K,W=W.substr(G.length);}if(_||G||W.match(/^\/\/[^@/]+@[^@/]+/)){var X=W.substr(0,2)==="//";X&&!(G&&P[G])&&(W=W.substr(2),this.slashes=!0);}if(!P[G]&&(X||G&&!E[G])){for(var Q=-1,V=0;V<f.length;V++){var te=W.indexOf(f[V]);te!==-1&&(Q===-1||te<Q)&&(Q=te);}var Y,ee;Q===-1?ee=W.lastIndexOf("@"):ee=W.lastIndexOf("@",Q),ee!==-1&&(Y=W.slice(0,ee),W=W.slice(ee+1),this.auth=decodeURIComponent(Y)),Q=-1;for(var V=0;V<c.length;V++){var te=W.indexOf(c[V]);te!==-1&&(Q===-1||te<Q)&&(Q=te);}Q===-1&&(Q=W.length),this.host=W.slice(0,Q),W=W.slice(Q),this.parseHost(),this.hostname=this.hostname||"";var pe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!pe)for(var Z=this.hostname.split(/\./),V=0,ne=Z.length;V<ne;V++){var fe=Z[V];if(fe&&!fe.match(d)){for(var be="",ye=0,Ae=fe.length;ye<Ae;ye++)fe.charCodeAt(ye)>127?be+="x":be+=fe[ye];if(!be.match(d)){var _e=Z.slice(0,V),ve=Z.slice(V+1),Oe=fe.match(w);Oe&&(_e.push(Oe[1]),ve.unshift(Oe[2])),ve.length&&(W="/"+ve.join(".")+W),this.hostname=_e.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),pe||(this.hostname=t.toASCII(this.hostname));var xe=this.port?":"+this.port:"",st=this.hostname||"";this.host=st+xe,this.href+=this.host,pe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),W[0]!=="/"&&(W="/"+W));}if(!y[K])for(var V=0,ne=a.length;V<ne;V++){var Re=a[V];if(W.indexOf(Re)!==-1){var Ne=encodeURIComponent(Re);Ne===Re&&(Ne=escape(Re)),W=W.split(Re).join(Ne);}}var Ct=W.indexOf("#");Ct!==-1&&(this.hash=W.substr(Ct),W=W.slice(0,Ct));var Bt=W.indexOf("?");if(Bt!==-1?(this.search=W.substr(Bt),this.query=W.substr(Bt+1),O&&(this.query=b.parse(this.query)),W=W.slice(0,Bt)):O&&(this.search="",this.query={}),W&&(this.pathname=W),E[K]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var xe=this.pathname||"",xn=this.search||"";this.path=xe+xn;}return this.href=this.format(),this};function v(g){return typeof g=="string"&&(g=m(g)),g instanceof e?g.format():e.prototype.format.call(g)}e.prototype.format=function(){var g=this.auth||"";g&&(g=encodeURIComponent(g),g=g.replace(/%3A/i,":"),g+="@");var O=this.protocol||"",_=this.pathname||"",q=this.hash||"",$=!1,j="";this.host?$=g+this.host:this.hostname&&($=g+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&($+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(j=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var J=this.search||j&&"?"+j||"";return O&&O.substr(-1)!==":"&&(O+=":"),this.slashes||(!O||E[O])&&$!==!1?($="//"+($||""),_&&_.charAt(0)!=="/"&&(_="/"+_)):$||($=""),q&&q.charAt(0)!=="#"&&(q="#"+q),J&&J.charAt(0)!=="?"&&(J="?"+J),_=_.replace(/[?#]/g,function(W){return encodeURIComponent(W)}),J=J.replace("#","%23"),O+$+_+J+q};function R(g,O){return m(g,!1,!0).resolve(O)}e.prototype.resolve=function(g){return this.resolveObject(m(g,!1,!0)).format()};function T(g,O){return g?m(g,!1,!0).resolveObject(O):O}return e.prototype.resolveObject=function(g){if(typeof g=="string"){var O=new e;O.parse(g,!1,!0),g=O;}for(var _=new e,q=Object.keys(this),$=0;$<q.length;$++){var j=q[$];_[j]=this[j];}if(_.hash=g.hash,g.href==="")return _.href=_.format(),_;if(g.slashes&&!g.protocol){for(var J=Object.keys(g),W=0;W<J.length;W++){var H=J[W];H!=="protocol"&&(_[H]=g[H]);}return E[_.protocol]&&_.hostname&&!_.pathname&&(_.pathname="/",_.path=_.pathname),_.href=_.format(),_}if(g.protocol&&g.protocol!==_.protocol){if(!E[g.protocol]){for(var G=Object.keys(g),K=0;K<G.length;K++){var X=G[K];_[X]=g[X];}return _.href=_.format(),_}if(_.protocol=g.protocol,!g.host&&!P[g.protocol]){for(var ne=(g.pathname||"").split("/");ne.length&&!(g.host=ne.shift()););g.host||(g.host=""),g.hostname||(g.hostname=""),ne[0]!==""&&ne.unshift(""),ne.length<2&&ne.unshift(""),_.pathname=ne.join("/");}else _.pathname=g.pathname;if(_.search=g.search,_.query=g.query,_.host=g.host||"",_.auth=g.auth,_.hostname=g.hostname||g.host,_.port=g.port,_.pathname||_.search){var Q=_.pathname||"",V=_.search||"";_.path=Q+V;}return _.slashes=_.slashes||g.slashes,_.href=_.format(),_}var te=_.pathname&&_.pathname.charAt(0)==="/",Y=g.host||g.pathname&&g.pathname.charAt(0)==="/",ee=Y||te||_.host&&g.pathname,pe=ee,Z=_.pathname&&_.pathname.split("/")||[],ne=g.pathname&&g.pathname.split("/")||[],fe=_.protocol&&!E[_.protocol];if(fe&&(_.hostname="",_.port=null,_.host&&(Z[0]===""?Z[0]=_.host:Z.unshift(_.host)),_.host="",g.protocol&&(g.hostname=null,g.port=null,g.host&&(ne[0]===""?ne[0]=g.host:ne.unshift(g.host)),g.host=null),ee=ee&&(ne[0]===""||Z[0]==="")),Y)_.host=g.host||g.host===""?g.host:_.host,_.hostname=g.hostname||g.hostname===""?g.hostname:_.hostname,_.search=g.search,_.query=g.query,Z=ne;else if(ne.length)Z||(Z=[]),Z.pop(),Z=Z.concat(ne),_.search=g.search,_.query=g.query;else if(g.search!=null){if(fe){_.host=Z.shift(),_.hostname=_.host;var be=_.host&&_.host.indexOf("@")>0?_.host.split("@"):!1;be&&(_.auth=be.shift(),_.hostname=be.shift(),_.host=_.hostname);}return _.search=g.search,_.query=g.query,(_.pathname!==null||_.search!==null)&&(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.href=_.format(),_}if(!Z.length)return _.pathname=null,_.search?_.path="/"+_.search:_.path=null,_.href=_.format(),_;for(var ye=Z.slice(-1)[0],Ae=(_.host||g.host||Z.length>1)&&(ye==="."||ye==="..")||ye==="",_e=0,ve=Z.length;ve>=0;ve--)ye=Z[ve],ye==="."?Z.splice(ve,1):ye===".."?(Z.splice(ve,1),_e++):_e&&(Z.splice(ve,1),_e--);if(!ee&&!pe)for(;_e--;_e)Z.unshift("..");ee&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),Ae&&Z.join("/").substr(-1)!=="/"&&Z.push("");var Oe=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(fe){_.hostname=Oe?"":Z.length?Z.shift():"",_.host=_.hostname;var be=_.host&&_.host.indexOf("@")>0?_.host.split("@"):!1;be&&(_.auth=be.shift(),_.hostname=be.shift(),_.host=_.hostname);}return ee=ee||_.host&&Z.length,ee&&!Oe&&Z.unshift(""),Z.length>0?_.pathname=Z.join("/"):(_.pathname=null,_.path=null),(_.pathname!==null||_.search!==null)&&(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.auth=g.auth||_.auth,_.slashes=_.slashes||g.slashes,_.href=_.format(),_},e.prototype.parseHost=function(){var g=this.host,O=n.exec(g);O&&(O=O[0],O!==":"&&(this.port=O.substr(1)),g=g.substr(0,g.length-O.length)),g&&(this.hostname=g);},Hr.parse=m,Hr.resolve=R,Hr.resolveObject=T,Hr.format=v,Hr.Url=e,Hr}function Eb(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 Cl?Jx(t):Xx(t)}function Jx(t){let e=t.hostname,r=t.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let i=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&i===102||r[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Vx,"\\"),r=decodeURIComponent(r),e!=="")return `\\\\${e}${r}`;{let n=r.codePointAt(1)|32,i=r[2];if(n<$x||n>Hx||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function Xx(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let n=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function Ab(t){let e=El.resolve(t),r=t.charCodeAt(t.length-1);(r===Wx||Cl&&r===Fx)&&e[e.length-1]!==El.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(Gx,"%25")),!Cl&&e.includes("\\")&&(e=e.replace(zx,"%5C")),e.includes(`
|
|
10
|
+
`)&&(e=e.replace(Kx,"%0A")),e.includes("\r")&&(e=e.replace(Qx,"%0D")),e.includes(" ")&&(e=e.replace(Yx,"%09")),n.pathname=e,n}var Tx,Al,pb,Il,xl,yb,Tl,gb,Pl,bb,Ol,wb,Rl,mb,kl,_b,Hr,vb,Ge,Mx,Nx,qx,Lx,Ux,Dx,jx,Fx,Wx,$x,Hx,Cl,Vx,Gx,zx,Kx,Qx,Yx,xb=ze(()=>{A();x();I();Ug();lb();db();vl();Tx=Object.freeze(Object.create(null)),Al={},pb=!1,Il=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;xl={},yb=!1;Tl={},gb=!1;Pl={},bb=!1;Ol={},wb=!1;Rl={},mb=!1;kl={},_b=!1;Hr={},vb=!1;Ge=Bx();Ge.parse;Ge.resolve;Ge.resolveObject;Ge.format;Ge.Url;Mx=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ge.URL=typeof URL<"u"?URL:null;Ge.pathToFileURL=Ab;Ge.fileURLToPath=Eb;Nx=Ge.Url,qx=Ge.format,Lx=Ge.resolve,Ux=Ge.resolveObject,Dx=Ge.parse,jx=Ge.URL,Fx=92,Wx=47,$x=97,Hx=122,Cl=Mx==="win32",Vx=/\//g,Gx=/%/g,zx=/\\/g,Kx=/\n/g,Qx=/\r/g,Yx=/\t/g;});var Pb=D((A9,Tb)=>{A();x();I();Tb.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};});var Qo=D(mi=>{A();x();I();Object.defineProperty(mi,"__esModule",{value:!0});mi.BufferedDuplex=void 0;mi.writev=Rb;var Zx=or(),Ob=(ke(),me(qe));function Rb(t,e){let r=new Array(t.length);for(let n=0;n<t.length;n++)typeof t[n].chunk=="string"?r[n]=Ob.Buffer.from(t[n].chunk,"utf8"):r[n]=t[n].chunk;this._write(Ob.Buffer.concat(r),"binary",e);}var Ml=class extends Zx.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,r,n){super({objectMode:!0}),this.proxy=r,this.socket=n,this.writeQueue=[],e.objectMode||(this._writev=Rb.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i);});}_read(e){this.proxy.read(e);}_write(e,r,n){this.isSocketOpen?this.writeToProxy(e,r,n):this.writeQueue.push({chunk:e,encoding:r,cb:n});}_final(e){this.writeQueue=[],this.proxy.end(e);}_destroy(e,r){this.writeQueue=[],this.proxy.destroy(),r(e);}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue();}writeToProxy(e,r,n){this.proxy.write(e,r)===!1?this.proxy.once("drain",n):n();}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:r,cb:n}=this.writeQueue.shift();this.writeToProxy(e,r,n);}}};mi.BufferedDuplex=Ml;});var _i=D(gr=>{A();x();I();var ql=gr&&gr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gr,"__esModule",{value:!0});gr.streamBuilder=gr.browserStreamBuilder=void 0;var Yo=(ke(),me(qe)),kb=ql(Pb()),eT=ql(At()),tT=or(),rT=ql(yi()),Nl=Qo(),yr=(0, eT.default)("mqttjs:ws"),nT=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function Cb(t,e){let r=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function Bb(t){let e=t;return t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!rT.default&&!t.forceNativeWebSocket&&t.protocol==="wss"&&nT.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r]);}),e}function iT(t){let e=Bb(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=Number(r.port));}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function oT(t,e,r){yr("createWebSocket"),yr(`protocol: ${r.protocolId} ${r.protocolVersion}`);let n=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";yr(`creating new Websocket for url: ${e} and protocol: ${n}`);let i;return r.createWebsocket?i=r.createWebsocket(e,[n],r):i=new kb.default(e,[n],r.wsOptions),i}function sT(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",n=Cb(e,t),i;return e.createWebsocket?i=e.createWebsocket(n,[r],e):i=new WebSocket(n,[r]),i.binaryType="arraybuffer",i}var aT=(t,e)=>{yr("streamBuilder");let r=Bb(e);r.hostname=r.hostname||r.host||"localhost";let n=Cb(r,t),i=oT(t,n,r),s=kb.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy();}),s};gr.streamBuilder=aT;var uT=(t,e)=>{yr("browserStreamBuilder");let r,i=iT(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,a=sT(t,e),c=h(e,E,b);e.objectMode||(c._writev=Nl.writev.bind(c)),c.on("close",()=>{a.close();});let f=typeof a.addEventListener<"u";a.readyState===a.OPEN?(r=c,r.socket=a):(r=new Nl.BufferedDuplex(e,c,a),f?a.addEventListener("open",d):a.onopen=d),f?(a.addEventListener("close",w),a.addEventListener("error",y),a.addEventListener("message",P)):(a.onclose=w,a.onerror=y,a.onmessage=P);function h(m,v,R){let T=new tT.Transform({objectMode:m.objectMode});return T._write=v,T._flush=R,T}function d(){yr("WebSocket onOpen"),r instanceof Nl.BufferedDuplex&&r.socketReady();}function w(m){yr("WebSocket onClose",m),r.end(),r.destroy();}function y(m){yr("WebSocket onError",m);let v=new Error("WebSocket error");v.event=m,r.destroy(v);}async function P(m){if(!c||!c.readable||!c.writable)return;let{data:v}=m;v instanceof ArrayBuffer?v=Yo.Buffer.from(v):v instanceof Blob?v=Yo.Buffer.from(await new Response(v).arrayBuffer()):v=Yo.Buffer.from(v,"utf8"),c.push(v);}function E(m,v,R){if(a.bufferedAmount>i){setTimeout(E,s,m,v,R);return}o&&typeof m=="string"&&(m=Yo.Buffer.from(m,"utf8"));try{a.send(m);}catch(T){return R(T)}R();}function b(m){a.close(),m();}return r};gr.browserStreamBuilder=uT;});var Ll={};Kr(Ll,{Server:()=>Je,Socket:()=>Je,Stream:()=>Je,_createServerHandle:()=>Je,_normalizeArgs:()=>Je,_setSimultaneousAccepts:()=>Je,connect:()=>Je,createConnection:()=>Je,createServer:()=>Je,default:()=>lT,isIP:()=>Je,isIPv4:()=>Je,isIPv6:()=>Je});function Je(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var lT,Ul=ze(()=>{A();x();I();lT={_createServerHandle:Je,_normalizeArgs:Je,_setSimultaneousAccepts:Je,connect:Je,createConnection:Je,createServer:Je,isIP:Je,isIPv4:Je,isIPv6:Je,Server:Je,Socket:Je,Stream:Je};});var Dl=D((lH,Mb)=>{A();x();I();Mb.exports={};});var Fl=D(vi=>{A();x();I();var jl=vi&&vi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vi,"__esModule",{value:!0});var cT=jl((Ul(),me(Ll))),fT=jl(At()),hT=jl(Dl()),dT=(0, fT.default)("mqttjs:tcp"),pT=(t,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return (0, hT.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:r,path:n}=e,i=e.hostname;return dT("port %d and host %s",r,i),cT.default.createConnection({port:r,host:i,path:n})};vi.default=pT;});var Nb={};Kr(Nb,{default:()=>yT});var yT,qb=ze(()=>{A();x();I();yT={};});var $l=D(Si=>{A();x();I();var Wl=Si&&Si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Si,"__esModule",{value:!0});var Lb=(qb(),me(Nb)),gT=Wl((Ul(),me(Ll))),bT=Wl(At()),wT=Wl(Dl()),mT=(0, bT.default)("mqttjs:tls");function _T(t){let{host:e,port:r,socksProxy:n,...i}=t;if(n!==void 0){let s=(0, wT.default)(e,r,n,{timeout:t.socksTimeout});return (0, Lb.connect)({...i,socket:s})}return (0, Lb.connect)(t)}var vT=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",gT.default.isIP(e.host)===0&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,mT("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=_T(e);r.on("secureConnect",()=>{e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n);});function n(i){e.rejectUnauthorized&&t.emit("error",i),r.end();}return r.on("error",n),r};Si.default=vT;});var Gl=D(Vl=>{A();x();I();Object.defineProperty(Vl,"__esModule",{value:!0});var Ub=(ke(),me(qe)),ST=or(),ET=Qo(),kt,Hl,Xe;function AT(){let t=new ST.Transform;return t._write=(e,r,n)=>{kt.send({data:e.buffer,success(){n();},fail(i){n(new Error(i));}});},t._flush=e=>{kt.close({success(){e();}});},t}function IT(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={});}function xT(t,e){let r=t.protocol==="wxs"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function TT(){kt.onOpen(()=>{Xe.socketReady();}),kt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=Ub.Buffer.from(e):e=Ub.Buffer.from(e,"utf8"),Hl.push(e);}),kt.onClose(()=>{Xe.emit("close"),Xe.end(),Xe.destroy();}),kt.onError(t=>{let e=new Error(t.errMsg);Xe.destroy(e);});}var PT=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";IT(e);let n=xT(e,t);kt=wx.connectSocket({url:n,protocols:[r]}),Hl=AT(),Xe=new ET.BufferedDuplex(e,Hl,kt),Xe._destroy=(s,o)=>{kt.close({success(){o&&o(s);}});};let i=Xe.destroy;return Xe.destroy=(s,o)=>(Xe.destroy=i,setTimeout(()=>{kt.close({fail(){Xe._destroy(s,o);}});},0),Xe),TT(),Xe};Vl.default=PT;});var Ql=D(Kl=>{A();x();I();Object.defineProperty(Kl,"__esModule",{value:!0});var zl=(ke(),me(qe)),OT=or(),RT=Qo(),Kt,Ei,An,Db=!1;function kT(){let t=new OT.Transform;return t._write=(e,r,n)=>{Kt.sendSocketMessage({data:e.buffer,success(){n();},fail(){n(new Error);}});},t._flush=e=>{Kt.closeSocket({success(){e();}});},t}function CT(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={});}function BT(t,e){let r=t.protocol==="alis"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function MT(){Db||(Db=!0,Kt.onSocketOpen(()=>{An.socketReady();}),Kt.onSocketMessage(t=>{if(typeof t.data=="string"){let e=zl.Buffer.from(t.data,"base64");Ei.push(e);}else {let e=new FileReader;e.addEventListener("load",()=>{if(e.result instanceof ArrayBuffer){Ei.push(zl.Buffer.from(e.result));return}Ei.push(zl.Buffer.from(e.result,"utf-8"));}),e.readAsArrayBuffer(t.data);}}),Kt.onSocketClose(()=>{An.end(),An.destroy();}),Kt.onSocketError(t=>{An.destroy(t);}));}var NT=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";CT(e);let n=BT(e,t);return Kt=e.my,Kt.connectSocket({url:n,protocols:r}),Ei=kT(),An=new RT.BufferedDuplex(e,Ei,Kt),MT(),An};Kl.default=NT;});var $b=D(In=>{A();x();I();var Jo=In&&In.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});In.connectAsync=jT;var qT=Jo(At()),LT=Jo((xb(),me(Ib))),UT=Jo(zo()),jb=Jo(yi());typeof M?.nextTick!="function"&&(M.nextTick=setImmediate);var Fb=(0, qT.default)("mqttjs"),Me=null;function DT(t){let e;if(t.auth)if(e=t.auth.match(/^(.+):(.+)$/),e){let[,r,n]=e;t.username=r,t.password=n;}else t.username=t.auth;}function Wb(t,e){if(Fb("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let i=LT.default.parse(t,!0),s={};if(i.port!=null&&(s.port=Number(i.port)),s.host=i.hostname,s.query=i.query,s.auth=i.auth,s.protocol=i.protocol,s.path=i.path,e={...s,...e},!e.protocol)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"");}if(e.unixSocket=e.unixSocket||e.protocol?.includes("+unix"),e.unixSocket?e.protocol=e.protocol.replace("+unix",""):!e.protocol?.startsWith("ws")&&!e.protocol?.startsWith("wx")&&delete e.path,DT(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),jb.default||e.unixSocket?e.socksProxy=void 0:e.socksProxy===void 0&&typeof M<"u"&&(e.socksProxy=M.env.MQTTJS_SOCKS_PROXY),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${e.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(Me||(Me={},!jb.default&&!e.forceNativeWebSocket?(Me.ws=_i().streamBuilder,Me.wss=_i().streamBuilder,Me.mqtt=Fl().default,Me.tcp=Fl().default,Me.ssl=$l().default,Me.tls=Me.ssl,Me.mqtts=$l().default):(Me.ws=_i().browserStreamBuilder,Me.wss=_i().browserStreamBuilder,Me.wx=Gl().default,Me.wxs=Gl().default,Me.ali=Ql().default,Me.alis=Ql().default)),!Me[e.protocol]){let i=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((s,o)=>i&&o%2===0?!1:typeof Me[s]=="function")[0];}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(i){return e.servers&&((!i._reconnectCount||i._reconnectCount===e.servers.length)&&(i._reconnectCount=0),e.host=e.servers[i._reconnectCount].host,e.port=e.servers[i._reconnectCount].port,e.protocol=e.servers[i._reconnectCount].protocol?e.servers[i._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,i._reconnectCount++),Fb("calling streambuilder for",e.protocol),Me[e.protocol](i,e)}let n=new UT.default(r,e);return n.on("error",()=>{}),n}function jT(t,e,r=!0){return new Promise((n,i)=>{let s=Wb(t,e),o={connect:c=>{a(),n(s);},end:()=>{a(),n(s);},error:c=>{a(),s.end(),i(c);}};r===!1&&(o.close=()=>{o.error(new Error("Couldn't connect to server"));});function a(){Object.keys(o).forEach(c=>{s.off(c,o[c]);});}Object.keys(o).forEach(c=>{s.on(c,o[c]);});})}In.default=Wb;});var Jl=D(ge=>{A();x();I();var Hb=ge&&ge.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),FT=ge&&ge.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),WT=ge&&ge.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&Hb(r,e,n[i]);return FT(r,e),r}}(),Yl=ge&&ge.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hb(e,t,r);},Ai=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0});ge.ReasonCodes=ge.KeepaliveManager=ge.UniqueMessageIdProvider=ge.DefaultMessageIdProvider=ge.Store=ge.MqttClient=ge.connectAsync=ge.connect=ge.Client=void 0;var Vb=Ai(zo());ge.MqttClient=Vb.default;var $T=Ai(Iu());ge.DefaultMessageIdProvider=$T.default;var HT=Ai(qg());ge.UniqueMessageIdProvider=HT.default;var VT=Ai(Ua());ge.Store=VT.default;var Gb=WT($b());ge.connect=Gb.default;Object.defineProperty(ge,"connectAsync",{enumerable:!0,get:function(){return Gb.connectAsync}});var GT=Ai(ju());ge.KeepaliveManager=GT.default;ge.Client=Vb.default;Yl(zo(),ge);Yl(Mr(),ge);Yl(Na(),ge);var zT=zn();Object.defineProperty(ge,"ReasonCodes",{enumerable:!0,get:function(){return zT.ReasonCodes}});});var XT=D(ot=>{A();x();I();var zb=ot&&ot.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),KT=ot&&ot.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e});}:function(t,e){t.default=e;}),QT=ot&&ot.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&zb(r,e,n[i]);return KT(r,e),r}}(),YT=ot&&ot.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zb(e,t,r);};Object.defineProperty(ot,"__esModule",{value:!0});var JT=QT(Jl());ot.default=JT;YT(Jl(),ot);});var mqtt = XT();
|
|
8
11
|
/*! Bundled license information:
|
|
9
12
|
|
|
10
|
-
@jspm/core/nodelibs/browser/
|
|
13
|
+
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
11
14
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
15
|
+
|
|
16
|
+
safe-buffer/index.js:
|
|
17
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
18
|
+
|
|
19
|
+
@babel/runtime/helpers/regenerator.js:
|
|
20
|
+
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
12
21
|
*/
|
|
13
22
|
|
|
14
23
|
class CloudInteropAPIError extends Error {
|
|
@@ -170,13 +179,18 @@ class IntentController {
|
|
|
170
179
|
body: JSON.stringify({ findOptions }),
|
|
171
180
|
});
|
|
172
181
|
if (!startResponse.ok) {
|
|
173
|
-
throw new Error(startResponse.statusText);
|
|
182
|
+
throw new Error(`Error creating intent discovery record: ${startResponse.statusText}`);
|
|
174
183
|
}
|
|
175
184
|
// TODO: type this response?
|
|
176
185
|
const json = await startResponse.json();
|
|
177
186
|
this.#discovery.id = json.discoveryId;
|
|
178
187
|
this.#discovery.sessionCount = json.sessionCount;
|
|
179
188
|
this.#discovery.state = 'in-progress';
|
|
189
|
+
if (this.#discovery.sessionCount === 1) {
|
|
190
|
+
// since we have no other connected sessions, we can end discovery immediately
|
|
191
|
+
await this.#endIntentDiscovery(false);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
180
194
|
// Listen out for discovery results directly sent to us
|
|
181
195
|
await this.#mqttClient.subscribeAsync(`${this.#sessionDetails.sessionRootTopic}/commands/${this.#discovery.id}`);
|
|
182
196
|
this.#discoveryTimeout = setTimeout(() => this.#endIntentDiscovery(), clampedTimeout);
|
|
@@ -187,10 +201,8 @@ class IntentController {
|
|
|
187
201
|
throw new CloudInteropAPIError('Error starting intent discovery', 'ERR_STARTING_INTENT_DISCOVERY', error);
|
|
188
202
|
}
|
|
189
203
|
}
|
|
190
|
-
async #endIntentDiscovery() {
|
|
204
|
+
async #endIntentDiscovery(mqttUnsubscribe = true) {
|
|
191
205
|
if (this.#discovery.state !== 'in-progress') {
|
|
192
|
-
// TODO: remove debug logs
|
|
193
|
-
this.#logger('debug', 'Intent discovery not in progress');
|
|
194
206
|
return;
|
|
195
207
|
}
|
|
196
208
|
if (this.#discoveryTimeout) {
|
|
@@ -200,10 +212,12 @@ class IntentController {
|
|
|
200
212
|
this.#discovery.state = 'ended';
|
|
201
213
|
// emit our aggregated events
|
|
202
214
|
this.#events.emitEvent('aggregate-intent-details', { responses: this.#discovery.pendingIntentDetailsEvents });
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
this.#
|
|
206
|
-
|
|
215
|
+
if (mqttUnsubscribe) {
|
|
216
|
+
// gracefully end discovery
|
|
217
|
+
await this.#mqttClient.unsubscribeAsync(`${this.#sessionDetails.sessionRootTopic}/commands/${this.#discovery.id}`).catch(() => {
|
|
218
|
+
this.#logger('warn', `Error ending intent discovery: could not unsubscribe from discovery id ${this.#discovery.id}`);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
207
221
|
await fetch(`${this.#url}/api/intents/${this.#sessionDetails.sessionId}/${this.#discovery.id}`, {
|
|
208
222
|
method: 'DELETE',
|
|
209
223
|
headers: getRequestHeaders(this.#connectionParams),
|
|
@@ -212,7 +226,6 @@ class IntentController {
|
|
|
212
226
|
if (!deleteResponse.ok) {
|
|
213
227
|
throw new Error(`Error ending intent discovery: ${deleteResponse.statusText}`);
|
|
214
228
|
}
|
|
215
|
-
this.#logger('debug', 'Intent discovery ended');
|
|
216
229
|
})
|
|
217
230
|
.catch((error) => {
|
|
218
231
|
this.#logger('warn', `Error ending intent discovery: ${error}`);
|
|
@@ -257,7 +270,8 @@ class IntentController {
|
|
|
257
270
|
}
|
|
258
271
|
async sendIntentResult(initiatingSessionId, result) {
|
|
259
272
|
if (!isErrorIntentResult(result)) {
|
|
260
|
-
// cloud-encode the source app id
|
|
273
|
+
// cloud-encode the source app id to support chained intent actions over cloud
|
|
274
|
+
// https://fdc3.finos.org/docs/2.0/api/spec#resolution-object -> "Use metadata about the resolving app instance to target a further intent"
|
|
261
275
|
const source = getSourceFromSession(this.#sessionDetails);
|
|
262
276
|
const encoded = encodeAppId(typeof result.source === 'string' ? result.source : result.source.appId, source);
|
|
263
277
|
result.source = typeof result.source === 'string' ? encoded : { ...result.source, appId: encoded };
|
|
@@ -598,8 +612,13 @@ class CloudInteropAPI {
|
|
|
598
612
|
if (contextEvent.source.sessionId === sessionDetails.sessionId) {
|
|
599
613
|
return;
|
|
600
614
|
}
|
|
601
|
-
const { contextGroup,
|
|
602
|
-
this.#events.emitEvent('context', {
|
|
615
|
+
const { context, payload, contextGroup, channelName, source, history } = contextEvent;
|
|
616
|
+
this.#events.emitEvent('context', {
|
|
617
|
+
contextGroup: channelName || contextGroup,
|
|
618
|
+
context: payload || context,
|
|
619
|
+
source,
|
|
620
|
+
history: { ...history, clientReceived: Date.now() },
|
|
621
|
+
});
|
|
603
622
|
}
|
|
604
623
|
else if (topic.startsWith(`${sessionDetails.sessionRootTopic}/commands`)) {
|
|
605
624
|
this.#handleCommandMessage(messageEnvelope);
|