mqtt 5.15.2 → 5.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +73 -0
  2. package/build/lib/KeepaliveManager.js +1 -1
  3. package/build/lib/KeepaliveManager.js.map +1 -1
  4. package/build/lib/client.d.ts +16 -1
  5. package/build/lib/client.js +129 -23
  6. package/build/lib/client.js.map +1 -1
  7. package/build/lib/handlers/ack.d.ts +1 -0
  8. package/build/lib/handlers/ack.js +13 -1
  9. package/build/lib/handlers/ack.js.map +1 -1
  10. package/build/lib/handlers/auth.d.ts +6 -2
  11. package/build/lib/handlers/auth.js +31 -9
  12. package/build/lib/handlers/auth.js.map +1 -1
  13. package/build/lib/handlers/connack.d.ts +4 -2
  14. package/build/lib/handlers/connack.js +24 -14
  15. package/build/lib/handlers/connack.js.map +1 -1
  16. package/build/lib/handlers/index.js +40 -16
  17. package/build/lib/handlers/index.js.map +1 -1
  18. package/build/lib/handlers/publish.js +35 -11
  19. package/build/lib/handlers/publish.js.map +1 -1
  20. package/build/lib/handlers/pubrel.js +1 -0
  21. package/build/lib/handlers/pubrel.js.map +1 -1
  22. package/build/lib/number-allocator.d.ts +12 -0
  23. package/build/lib/number-allocator.js +61 -0
  24. package/build/lib/number-allocator.js.map +1 -0
  25. package/build/lib/shared.d.ts +5 -1
  26. package/build/lib/shared.js.map +1 -1
  27. package/build/lib/topic-alias-send.js +1 -1
  28. package/build/lib/topic-alias-send.js.map +1 -1
  29. package/build/lib/unique-message-id-provider.js +1 -1
  30. package/build/lib/unique-message-id-provider.js.map +1 -1
  31. package/build/mqtt.d.ts +1 -0
  32. package/build/tsconfig.build.tsbuildinfo +1 -1
  33. package/dist/mqtt.esm.js +8 -8
  34. package/dist/mqtt.js +445 -2996
  35. package/dist/mqtt.min.js +8 -8
  36. package/package.json +5 -5
package/dist/mqtt.esm.js CHANGED
@@ -1,11 +1,11 @@
1
- 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 j=(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 N={};Kr(N,{_debugEnd:()=>Qc,_debugProcess:()=>Kc,_events:()=>hf,_eventsCount:()=>df,_exiting:()=>Oc,_fatalExceptions:()=>Hc,_getActiveHandles:()=>Bc,_getActiveRequests:()=>Cc,_kill:()=>Nc,_linkedBinding:()=>Tc,_maxListeners:()=>ff,_preload_modules:()=>uf,_rawDebug:()=>Ic,_startProfilerIdleNotifier:()=>Yc,_stopProfilerIdleNotifier:()=>Jc,_tickCallback:()=>zc,abort:()=>tf,addListener:()=>pf,allowedNodeEnvironmentFlags:()=>Fc,arch:()=>fc,argv:()=>pc,argv0:()=>af,assert:()=>Wc,binding:()=>mc,browser:()=>Ac,chdir:()=>Sc,config:()=>Rc,cpuUsage:()=>Ri,cwd:()=>vc,debugPort:()=>sf,default:()=>Ef,dlopen:()=>kc,domain:()=>Pc,emit:()=>mf,emitWarning:()=>wc,env:()=>dc,execArgv:()=>yc,execPath:()=>of,exit:()=>Dc,features:()=>$c,hasUncaughtExceptionCaptureCallback:()=>Gc,hrtime:()=>Oi,kill:()=>Uc,listeners:()=>Sf,memoryUsage:()=>Lc,moduleLoadList:()=>xc,nextTick:()=>uc,off:()=>gf,on:()=>Nt,once:()=>yf,openStdin:()=>jc,pid:()=>rf,platform:()=>hc,ppid:()=>nf,prependListener:()=>_f,prependOnceListener:()=>vf,reallyExit:()=>Mc,release:()=>Ec,removeAllListeners:()=>wf,removeListener:()=>bf,resourceUsage:()=>qc,setSourceMapsEnabled:()=>lf,setUncaughtExceptionCaptureCallback:()=>Vc,stderr:()=>Zc,stdin:()=>ef,stdout:()=>Xc,title:()=>cc,umask:()=>_c,uptime:()=>cf,version:()=>gc,versions:()=>bc});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&&ac())}function ac(){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 uc(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 lc(t,e)),Mt.length===1&&!Qr&&setTimeout(ac,0)}function lc(t,e){this.fun=t,this.array=e}function Ue(){}function Tc(t){cs("_linkedBinding")}function kc(t){cs("dlopen")}function Cc(){return[]}function Bc(){return[]}function Wc(t,e){if(!t)throw new Error(e||"assertion error")}function Gc(){return!1}function cf(){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 Ef}function Sf(t){return[]}var Mt,Qr,wr,Pi,cc,fc,hc,dc,pc,yc,gc,bc,wc,mc,_c,vc,Sc,Ec,Ac,Ic,xc,Pc,Oc,Rc,Mc,Nc,Ri,qc,Lc,Uc,Dc,jc,Fc,$c,Hc,Vc,zc,Kc,Qc,Yc,Jc,Xc,Zc,ef,tf,rf,nf,of,sf,af,uf,lf,Jt,us,ls,ff,hf,df,pf,yf,gf,bf,wf,mf,_f,vf,Ef,Af=ze(()=>{A();x();I();Mt=[],Qr=!1,Pi=-1;lc.prototype.run=function(){this.fun.apply(null,this.array)};cc="browser",fc="x64",hc="browser",dc={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},pc=["/usr/bin/node"],yc=[],gc="v16.8.0",bc={},wc=function(t,e){console.warn((e?e+": ":"")+t)},mc=function(t){cs("binding")},_c=function(t){return 0},vc=function(){return"/"},Sc=function(t){},Ec={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Ac=!0,Ic=Ue,xc=[];Pc={},Oc=!1,Rc={};Mc=Ue,Nc=Ue,Ri=function(){return{}},qc=Ri,Lc=Ri,Uc=Ue,Dc=Ue,jc=Ue,Fc={};$c={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Hc=Ue,Vc=Ue;zc=Ue,Kc=Ue,Qc=Ue,Yc=Ue,Jc=Ue,Xc=void 0,Zc=void 0,ef=void 0,tf=Ue,rf=2,nf=1,of="/bin/usr/node",sf=9229,af="node",uf=[],lf=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])};ff=10,hf={},df=0;pf=Nt,yf=Nt,gf=Nt,bf=Nt,wf=Nt,mf=Ue,_f=Nt,vf=Nt;Ef={version:gc,versions:bc,arch:fc,platform:hc,browser:Ac,release:Ec,_rawDebug:Ic,moduleLoadList:xc,binding:mc,_linkedBinding:Tc,_events:hf,_eventsCount:df,_maxListeners:ff,on:Nt,addListener:pf,once:yf,off:gf,removeListener:bf,removeAllListeners:wf,emit:mf,prependListener:_f,prependOnceListener:vf,listeners:Sf,domain:Pc,_exiting:Oc,config:Rc,dlopen:kc,uptime:cf,_getActiveRequests:Cc,_getActiveHandles:Bc,reallyExit:Mc,_kill:Nc,cpuUsage:Ri,resourceUsage:qc,memoryUsage:Lc,kill:Uc,exit:Dc,openStdin:jc,allowedNodeEnvironmentFlags:Fc,assert:Wc,features:$c,_fatalExceptions:Hc,setUncaughtExceptionCaptureCallback:Vc,hasUncaughtExceptionCaptureCallback:Gc,emitWarning:wc,nextTick:uc,_tickCallback:zc,_debugProcess:Kc,_debugEnd:Qc,_startProfilerIdleNotifier:Yc,_stopProfilerIdleNotifier:Jc,stdout:Xc,stdin:ef,stderr:Zc,abort:tf,umask:_c,chdir:Sc,cwd:vc,env:dc,title:cc,argv:pc,execArgv:yc,pid:rf,ppid:nf,execPath:of,debugPort:sf,hrtime:Oi,argv0:af,_preload_modules:uf,setSourceMapsEnabled:lf}});var I=ze(()=>{Af()});function tw(){if(If)return On;If=!0,On.byteLength=a,On.toByteArray=f,On.fromByteArray=m;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(g){var P=g.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=g.indexOf("=");S===-1&&(S=P);var b=S===P?0:4-S%4;return[S,b]}function a(g){var P=o(g),S=P[0],b=P[1];return(S+b)*3/4-b}function c(g,P,S){return(P+S)*3/4-S}function f(g){var P,S=o(g),b=S[0],w=S[1],_=new r(c(g,b,w)),R=0,T=w>0?b-4:b,y;for(y=0;y<T;y+=4)P=e[g.charCodeAt(y)]<<18|e[g.charCodeAt(y+1)]<<12|e[g.charCodeAt(y+2)]<<6|e[g.charCodeAt(y+3)],_[R++]=P>>16&255,_[R++]=P>>8&255,_[R++]=P&255;return w===2&&(P=e[g.charCodeAt(y)]<<2|e[g.charCodeAt(y+1)]>>4,_[R++]=P&255),w===1&&(P=e[g.charCodeAt(y)]<<10|e[g.charCodeAt(y+1)]<<4|e[g.charCodeAt(y+2)]>>2,_[R++]=P>>8&255,_[R++]=P&255),_}function h(g){return t[g>>18&63]+t[g>>12&63]+t[g>>6&63]+t[g&63]}function d(g,P,S){for(var b,w=[],_=P;_<S;_+=3)b=(g[_]<<16&16711680)+(g[_+1]<<8&65280)+(g[_+2]&255),w.push(h(b));return w.join("")}function m(g){for(var P,S=g.length,b=S%3,w=[],_=16383,R=0,T=S-b;R<T;R+=_)w.push(d(g,R,R+_>T?T:R+_));return b===1?(P=g[S-1],w.push(t[P>>2]+t[P<<4&63]+"==")):b===2&&(P=(g[S-2]<<8)+g[S-1],w.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),w.join("")}return On}function rw(){if(xf)return ki;xf=!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,m=r?-1:1,g=t[e+d];for(d+=m,s=g&(1<<-h)-1,g>>=-h,h+=a;h>0;s=s*256+t[e+d],d+=m,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+t[e+d],d+=m,h-=8);if(s===0)s=1-f;else{if(s===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f}return(g?-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,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,P=n?1:-1,S=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+=m/c:e+=m*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+g]=a&255,g+=P,a/=256,i-=8);for(o=o<<i|a,f+=i;f>0;t[r+g]=o&255,g+=P,o/=256,f-=8);t[r+g-P]|=S*128},ki}function Pf(){if(Tf)return mr;Tf=!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=w,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 g(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 E=p.valueOf&&p.valueOf();if(E!=null&&E!==p)return o.from(E,u,l);let C=S(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=_(p,u)|0,E=s(l),C=E.write(p,u);return C!==l&&(E=E.slice(0,C)),E}function m(p){let u=p.length<0?0:b(p.length)|0,l=s(u);for(let E=0;E<u;E+=1)l[E]=p[E]&255;return l}function g(p){if(Ze(p,Uint8Array)){let u=new Uint8Array(p);return P(u.buffer,u.byteOffset,u.byteLength)}return m(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 E;return u===void 0&&l===void 0?E=new Uint8Array(p):l===void 0?E=new Uint8Array(p,u):E=new Uint8Array(p,u,l),Object.setPrototypeOf(E,o.prototype),E}function S(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):m(p);if(p.type==="Buffer"&&Array.isArray(p.data))return m(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 w(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 E=u.length,C=l.length;for(let q=0,$=Math.min(E,C);q<$;++q)if(u[q]!==l[q]){E=u[q],C=l[q];break}return E<C?-1:C<E?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 E;if(l===void 0)for(l=0,E=0;E<u.length;++E)l+=u[E].length;let C=o.allocUnsafe(l),q=0;for(E=0;E<u.length;++E){let $=u[E];if(Ze($,Uint8Array))q+$.length>C.length?(o.isBuffer($)||($=o.from($)),$.copy(C,q)):Uint8Array.prototype.set.call(C,$,q);else if(o.isBuffer($))$.copy(C,q);else throw new TypeError('"list" argument must be an Array of Buffers');q+=$.length}return C};function _(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,E=arguments.length>2&&arguments[2]===!0;if(!E&&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 E?-1:Ct(p).length;u=(""+u).toLowerCase(),C=!0}}o.byteLength=_;function R(p,u,l){let E=!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 ee(this,u,l);case"latin1":case"binary":return G(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(E)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function T(p,u,l){let E=p[u];p[u]=p[l],p[l]=E}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,E,C,q){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),E===void 0&&(E=u?u.length:0),C===void 0&&(C=0),q===void 0&&(q=this.length),l<0||E>u.length||C<0||q>this.length)throw new RangeError("out of range index");if(C>=q&&l>=E)return 0;if(C>=q)return-1;if(l>=E)return 1;if(l>>>=0,E>>>=0,C>>>=0,q>>>=0,this===u)return 0;let $=q-C,k=E-l,B=Math.min($,k),re=this.slice(C,q),ie=u.slice(l,E);for(let oe=0;oe<B;++oe)if(re[oe]!==ie[oe]){$=re[oe],k=ie[oe];break}return $<k?-1:k<$?1:0};function y(p,u,l,E,C){if(p.length===0)return-1;if(typeof l=="string"?(E=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,E)),o.isBuffer(u))return u.length===0?-1:O(p,u,l,E,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,E,C);throw new TypeError("val must be string, number or Buffer")}function O(p,u,l,E,C){let q=1,$=p.length,k=u.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(p.length<2||u.length<2)return-1;q=2,$/=2,k/=2,l/=2}function B(ie,oe){return q===1?ie[oe]:ie.readUInt16BE(oe*q)}let re;if(C){let ie=-1;for(re=l;re<$;re++)if(B(p,re)===B(u,ie===-1?0:re-ie)){if(ie===-1&&(ie=re),re-ie+1===k)return ie*q}else ie!==-1&&(re-=re-ie),ie=-1}else for(l+k>$&&(l=$-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,E){return this.indexOf(u,l,E)!==-1},o.prototype.indexOf=function(u,l,E){return y(this,u,l,E,!0)},o.prototype.lastIndexOf=function(u,l,E){return y(this,u,l,E,!1)};function v(p,u,l,E){l=Number(l)||0;let C=p.length-l;E?(E=Number(E),E>C&&(E=C)):E=C;let q=u.length;E>q/2&&(E=q/2);let $;for($=0;$<E;++$){let k=parseInt(u.substr($*2,2),16);if(Tn(k))return $;p[l+$]=k}return $}function M(p,u,l,E){return Vr(Ct(u,p.length-l),p,l,E)}function F(p,u,l,E){return Vr(Bt(u),p,l,E)}function U(p,u,l,E){return Vr(Ii(u),p,l,E)}function Q(p,u,l,E){return Vr(xn(u,p.length-l),p,l,E)}o.prototype.write=function(u,l,E,C){if(l===void 0)C="utf8",E=this.length,l=0;else if(E===void 0&&typeof l=="string")C=l,E=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(E)?(E=E>>>0,C===void 0&&(C="utf8")):(C=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let q=this.length-l;if((E===void 0||E>q)&&(E=q),u.length>0&&(E<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let $=!1;for(;;)switch(C){case"hex":return v(this,u,l,E);case"utf8":case"utf-8":return M(this,u,l,E);case"ascii":case"latin1":case"binary":return F(this,u,l,E);case"base64":return U(this,u,l,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,u,l,E);default:if($)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),$=!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 E=[],C=u;for(;C<l;){let q=p[C],$=null,k=q>239?4:q>223?3:q>191?2:1;if(C+k<=l){let B,re,ie,oe;switch(k){case 1:q<128&&($=q);break;case 2:B=p[C+1],(B&192)===128&&(oe=(q&31)<<6|B&63,oe>127&&($=oe));break;case 3:B=p[C+1],re=p[C+2],(B&192)===128&&(re&192)===128&&(oe=(q&15)<<12|(B&63)<<6|re&63,oe>2047&&(oe<55296||oe>57343)&&($=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=(q&15)<<18|(B&63)<<12|(re&63)<<6|ie&63,oe>65535&&oe<1114112&&($=oe))}}$===null?($=65533,k=1):$>65535&&($-=65536,E.push($>>>10&1023|55296),$=56320|$&1023),E.push($),C+=k}return J(E)}let z=4096;function J(p){let u=p.length;if(u<=z)return String.fromCharCode.apply(String,p);let l="",E=0;for(;E<u;)l+=String.fromCharCode.apply(String,p.slice(E,E+=z));return l}function ee(p,u,l){let E="";l=Math.min(p.length,l);for(let C=u;C<l;++C)E+=String.fromCharCode(p[C]&127);return E}function G(p,u,l){let E="";l=Math.min(p.length,l);for(let C=u;C<l;++C)E+=String.fromCharCode(p[C]);return E}function V(p,u,l){let E=p.length;(!u||u<0)&&(u=0),(!l||l<0||l>E)&&(l=E);let C="";for(let q=u;q<l;++q)C+=Xo[p[q]];return C}function te(p,u,l){let E=p.slice(u,l),C="";for(let q=0;q<E.length-1;q+=2)C+=String.fromCharCode(E[q]+E[q+1]*256);return C}o.prototype.slice=function(u,l){let E=this.length;u=~~u,l=l===void 0?E:~~l,u<0?(u+=E,u<0&&(u=0)):u>E&&(u=E),l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),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,E){u=u>>>0,l=l>>>0,E||Y(u,l,this.length);let C=this[u],q=1,$=0;for(;++$<l&&(q*=256);)C+=this[u+$]*q;return C},o.prototype.readUintBE=o.prototype.readUIntBE=function(u,l,E){u=u>>>0,l=l>>>0,E||Y(u,l,this.length);let C=this[u+--l],q=1;for(;l>0&&(q*=256);)C+=this[u+--l]*q;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],E=this[u+7];(l===void 0||E===void 0)&&st(u,this.length-8);let C=l+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,q=this[++u]+this[++u]*2**8+this[++u]*2**16+E*2**24;return BigInt(C)+(BigInt(q)<<BigInt(32))}),o.prototype.readBigUInt64BE=at(function(u){u=u>>>0,xe(u,"offset");let l=this[u],E=this[u+7];(l===void 0||E===void 0)&&st(u,this.length-8);let C=l*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],q=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+E;return(BigInt(C)<<BigInt(32))+BigInt(q)}),o.prototype.readIntLE=function(u,l,E){u=u>>>0,l=l>>>0,E||Y(u,l,this.length);let C=this[u],q=1,$=0;for(;++$<l&&(q*=256);)C+=this[u+$]*q;return q*=128,C>=q&&(C-=Math.pow(2,8*l)),C},o.prototype.readIntBE=function(u,l,E){u=u>>>0,l=l>>>0,E||Y(u,l,this.length);let C=l,q=1,$=this[u+--C];for(;C>0&&(q*=256);)$+=this[u+--C]*q;return q*=128,$>=q&&($-=Math.pow(2,8*l)),$},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 E=this[u]|this[u+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(u,l){u=u>>>0,l||Y(u,2,this.length);let E=this[u+1]|this[u]<<8;return E&32768?E|4294901760:E},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],E=this[u+7];(l===void 0||E===void 0)&&st(u,this.length-8);let C=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(E<<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],E=this[u+7];(l===void 0||E===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+E)}),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 X(p,u,l,E,C,q){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>C||u<q)throw new RangeError('"value" argument is out of bounds');if(l+E>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(u,l,E,C){if(u=+u,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,u,l,E,k,0)}let q=1,$=0;for(this[l]=u&255;++$<E&&(q*=256);)this[l+$]=u/q&255;return l+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(u,l,E,C){if(u=+u,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,u,l,E,k,0)}let q=E-1,$=1;for(this[l+q]=u&255;--q>=0&&($*=256);)this[l+q]=u/$&255;return l+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(u,l,E){return u=+u,l=l>>>0,E||X(this,u,l,1,255,0),this[l]=u&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(u,l,E){return u=+u,l=l>>>0,E||X(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,E){return u=+u,l=l>>>0,E||X(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,E){return u=+u,l=l>>>0,E||X(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,E){return u=+u,l=l>>>0,E||X(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 ce(p,u,l,E,C){Oe(u,E,C,p,l,7);let q=Number(u&BigInt(4294967295));p[l++]=q,q=q>>8,p[l++]=q,q=q>>8,p[l++]=q,q=q>>8,p[l++]=q;let $=Number(u>>BigInt(32)&BigInt(4294967295));return p[l++]=$,$=$>>8,p[l++]=$,$=$>>8,p[l++]=$,$=$>>8,p[l++]=$,l}function Z(p,u,l,E,C){Oe(u,E,C,p,l,7);let q=Number(u&BigInt(4294967295));p[l+7]=q,q=q>>8,p[l+6]=q,q=q>>8,p[l+5]=q,q=q>>8,p[l+4]=q;let $=Number(u>>BigInt(32)&BigInt(4294967295));return p[l+3]=$,$=$>>8,p[l+2]=$,$=$>>8,p[l+1]=$,$=$>>8,p[l]=$,l+8}o.prototype.writeBigUInt64LE=at(function(u,l=0){return ce(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,E,C){if(u=+u,l=l>>>0,!C){let B=Math.pow(2,8*E-1);X(this,u,l,E,B-1,-B)}let q=0,$=1,k=0;for(this[l]=u&255;++q<E&&($*=256);)u<0&&k===0&&this[l+q-1]!==0&&(k=1),this[l+q]=(u/$>>0)-k&255;return l+E},o.prototype.writeIntBE=function(u,l,E,C){if(u=+u,l=l>>>0,!C){let B=Math.pow(2,8*E-1);X(this,u,l,E,B-1,-B)}let q=E-1,$=1,k=0;for(this[l+q]=u&255;--q>=0&&($*=256);)u<0&&k===0&&this[l+q+1]!==0&&(k=1),this[l+q]=(u/$>>0)-k&255;return l+E},o.prototype.writeInt8=function(u,l,E){return u=+u,l=l>>>0,E||X(this,u,l,1,127,-128),u<0&&(u=255+u+1),this[l]=u&255,l+1},o.prototype.writeInt16LE=function(u,l,E){return u=+u,l=l>>>0,E||X(this,u,l,2,32767,-32768),this[l]=u&255,this[l+1]=u>>>8,l+2},o.prototype.writeInt16BE=function(u,l,E){return u=+u,l=l>>>0,E||X(this,u,l,2,32767,-32768),this[l]=u>>>8,this[l+1]=u&255,l+2},o.prototype.writeInt32LE=function(u,l,E){return u=+u,l=l>>>0,E||X(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,E){return u=+u,l=l>>>0,E||X(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 ce(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,E,C,q){if(l+E>p.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function he(p,u,l,E,C){return u=+u,l=l>>>0,C||ne(p,u,l,4),e.write(p,u,l,E,23,4),l+4}o.prototype.writeFloatLE=function(u,l,E){return he(this,u,l,!0,E)},o.prototype.writeFloatBE=function(u,l,E){return he(this,u,l,!1,E)};function be(p,u,l,E,C){return u=+u,l=l>>>0,C||ne(p,u,l,8),e.write(p,u,l,E,52,8),l+8}o.prototype.writeDoubleLE=function(u,l,E){return be(this,u,l,!0,E)},o.prototype.writeDoubleBE=function(u,l,E){return be(this,u,l,!1,E)},o.prototype.copy=function(u,l,E,C){if(!o.isBuffer(u))throw new TypeError("argument should be a Buffer");if(E||(E=0),!C&&C!==0&&(C=this.length),l>=u.length&&(l=u.length),l||(l=0),C>0&&C<E&&(C=E),C===E||u.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=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-E&&(C=u.length-l+E);let q=C-E;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,E,C):Uint8Array.prototype.set.call(u,this.subarray(E,C),l),q},o.prototype.fill=function(u,l,E,C){if(typeof u=="string"){if(typeof l=="string"?(C=l,l=0,E=this.length):typeof E=="string"&&(C=E,E=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 $=u.charCodeAt(0);(C==="utf8"&&$<128||C==="latin1")&&(u=$)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(l<0||this.length<l||this.length<E)throw new RangeError("Out of range index");if(E<=l)return this;l=l>>>0,E=E===void 0?this.length:E>>>0,u||(u=0);let q;if(typeof u=="number")for(q=l;q<E;++q)this[q]=u;else{let $=o.isBuffer(u)?u:o.from(u,C),k=$.length;if(k===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(q=0;q<E-l;++q)this[q+l]=$[q%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 E=`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"),E+=` It must be ${u}. Received ${C}`,E},RangeError);function _e(p){let u="",l=p.length,E=p[0]==="-"?1:0;for(;l>=E+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,E,C,q){if(p>l||p<u){let $=typeof u=="bigint"?"n":"",k;throw u===0||u===BigInt(0)?k=`>= 0${$} and < 2${$} ** ${(q+1)*8}${$}`:k=`>= -(2${$} ** ${(q+1)*8-1}${$}) and < 2 ** ${(q+1)*8-1}${$}`,new ye.ERR_OUT_OF_RANGE("value",k,p)}ve(E,C,q)}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,E=p.length,C=null,q=[];for(let $=0;$<E;++$){if(l=p.charCodeAt($),l>55295&&l<57344){if(!C){if(l>56319){(u-=3)>-1&&q.push(239,191,189);continue}else if($+1===E){(u-=3)>-1&&q.push(239,191,189);continue}C=l;continue}if(l<56320){(u-=3)>-1&&q.push(239,191,189),C=l;continue}l=(C-55296<<10|l-56320)+65536}else C&&(u-=3)>-1&&q.push(239,191,189);if(C=null,l<128){if((u-=1)<0)break;q.push(l)}else if(l<2048){if((u-=2)<0)break;q.push(l>>6|192,l&63|128)}else if(l<65536){if((u-=3)<0)break;q.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((u-=4)<0)break;q.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return q}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,E,C,q=[];for(let $=0;$<p.length&&!((u-=2)<0);++$)l=p.charCodeAt($),E=l>>8,C=l%256,q.push(C),q.push(E);return q}function Ii(p){return t.toByteArray(Ne(p))}function Vr(p,u,l,E){let C;for(C=0;C<E&&!(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 E=l*16;for(let C=0;C<16;++C)u[E+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,If,ki,xf,mr,Tf,Of=ze(()=>{A();x();I();On={},If=!1;ki={},xf=!1;mr={},Tf=!1});var qe={};Kr(qe,{Buffer:()=>D,INSPECT_MAX_BYTES:()=>nw,default:()=>Xt,kMaxLength:()=>iw});var Xt,D,nw,iw,ke=ze(()=>{A();x();I();Of();Xt=Pf();Xt.Buffer;Xt.SlowBuffer;Xt.INSPECT_MAX_BYTES;Xt.kMaxLength;D=Xt.Buffer,nw=Xt.INSPECT_MAX_BYTES,iw=Xt.kMaxLength});var x=ze(()=>{ke()});var Ee=j((NP,Rf)=>{"use strict";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}
2
- `;super(r),this.name="AggregateError",this.errors=e}};Rf.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=j((VP,kf)=>{"use strict";A();x();I();kf.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=j((tO,Mf)=>{"use strict";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 Cf(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 Bf(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=Cf(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=Cf(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);Mf.exports={AbortError:ds,aggregateTwoErrors:Bf(dw),hideStackFrames:Bf,codes:Bi}});var Yr=j((fO,Mi)=>{"use strict";A();x();I();var{AbortController:Nf,AbortSignal:pw}=typeof self<"u"?self:typeof window<"u"?window:void 0;Mi.exports=Nf;Mi.exports.AbortSignal=pw;Mi.exports.default=Nf});var Zt={};Kr(Zt,{EventEmitter:()=>gw,default:()=>Rn,defaultMaxListeners:()=>bw,init:()=>ww,listenerCount:()=>mw,on:()=>_w,once:()=>vw});function yw(){if(qf)return Ni;qf=!0;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(y,O,v){return Function.prototype.apply.call(y,O,v)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:r=function(y){return Object.getOwnPropertyNames(y)};function n(T){console&&console.warn&&console.warn(T)}var i=Number.isNaN||function(y){return y!==y};function s(){s.init.call(this)}Ni=s,Ni.once=w,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(y){if(typeof y!="number"||y<0||i(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function c(T){return T._maxListeners===void 0?s.defaultMaxListeners:T._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(y){for(var O=[],v=1;v<arguments.length;v++)O.push(arguments[v]);var M=y==="error",F=this._events;if(F!==void 0)M=M&&F.error===void 0;else if(!M)return!1;if(M){var U;if(O.length>0&&(U=O[0]),U instanceof Error)throw U;var Q=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw Q.context=U,Q}var W=F[y];if(W===void 0)return!1;if(typeof W=="function")e(W,this,O);else for(var H=W.length,z=P(W,H),v=0;v<H;++v)e(z[v],this,O);return!0};function f(T,y,O,v){var M,F,U;if(a(O),F=T._events,F===void 0?(F=T._events=Object.create(null),T._eventsCount=0):(F.newListener!==void 0&&(T.emit("newListener",y,O.listener?O.listener:O),F=T._events),U=F[y]),U===void 0)U=F[y]=O,++T._eventsCount;else if(typeof U=="function"?U=F[y]=v?[O,U]:[U,O]:v?U.unshift(O):U.push(O),M=c(T),M>0&&U.length>M&&!U.warned){U.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=T,Q.type=y,Q.count=U.length,n(Q)}return T}s.prototype.addListener=function(y,O){return f(this,y,O,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(y,O){return f(this,y,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,y,O){var v={fired:!1,wrapFn:void 0,target:T,type:y,listener:O},M=h.bind(v);return M.listener=O,v.wrapFn=M,M}s.prototype.once=function(y,O){return a(O),this.on(y,d(this,y,O)),this},s.prototype.prependOnceListener=function(y,O){return a(O),this.prependListener(y,d(this,y,O)),this},s.prototype.removeListener=function(y,O){var v,M,F,U,Q;if(a(O),M=this._events,M===void 0)return this;if(v=M[y],v===void 0)return this;if(v===O||v.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete M[y],M.removeListener&&this.emit("removeListener",y,v.listener||O));else if(typeof v!="function"){for(F=-1,U=v.length-1;U>=0;U--)if(v[U]===O||v[U].listener===O){Q=v[U].listener,F=U;break}if(F<0)return this;F===0?v.shift():S(v,F),v.length===1&&(M[y]=v[0]),M.removeListener!==void 0&&this.emit("removeListener",y,Q||O)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(y){var O,v,M;if(v=this._events,v===void 0)return this;if(v.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):v[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete v[y]),this;if(arguments.length===0){var F=Object.keys(v),U;for(M=0;M<F.length;++M)U=F[M],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=v[y],typeof O=="function")this.removeListener(y,O);else if(O!==void 0)for(M=O.length-1;M>=0;M--)this.removeListener(y,O[M]);return this};function m(T,y,O){var v=T._events;if(v===void 0)return[];var M=v[y];return M===void 0?[]:typeof M=="function"?O?[M.listener||M]:[M]:O?b(M):P(M,M.length)}s.prototype.listeners=function(y){return m(this,y,!0)},s.prototype.rawListeners=function(y){return m(this,y,!1)},s.listenerCount=function(T,y){return typeof T.listenerCount=="function"?T.listenerCount(y):g.call(T,y)},s.prototype.listenerCount=g;function g(T){var y=this._events;if(y!==void 0){var O=y[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,y){for(var O=new Array(y),v=0;v<y;++v)O[v]=T[v];return O}function S(T,y){for(;y+1<T.length;y++)T[y]=T[y+1];T.pop()}function b(T){for(var y=new Array(T.length),O=0;O<y.length;++O)y[O]=T[O].listener||T[O];return y}function w(T,y){return new Promise(function(O,v){function M(U){T.removeListener(y,F),v(U)}function F(){typeof T.removeListener=="function"&&T.removeListener("error",M),O([].slice.call(arguments))}R(T,y,F,{once:!0}),y!=="error"&&_(T,M,{once:!0})})}function _(T,y,O){typeof T.on=="function"&&R(T,"error",y,O)}function R(T,y,O,v){if(typeof T.on=="function")v.once?T.once(y,O):T.on(y,O);else if(typeof T.addEventListener=="function")T.addEventListener(y,function M(F){v.once&&T.removeEventListener(y,M),O(F)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return Ni}var Ni,qf,Rn,gw,bw,ww,mw,_w,vw,er=ze(()=>{A();x();I();Ni={},qf=!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=j((RO,ys)=>{"use strict";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,Lf=globalThis.Blob||Sw.Blob,kw=typeof Lf<"u"?function(e){return e instanceof Lf}:function(e){return!1},Uf=(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);Uf(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=>{Uf(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=j((jO,Kf)=>{"use strict";A();x();I();var{ArrayIsArray:bs,ArrayPrototypeIncludes:Wf,ArrayPrototypeJoin:$f,ArrayPrototypeMap:Bw,NumberIsInteger:ws,NumberIsNaN:Mw,NumberMAX_SAFE_INTEGER:Nw,NumberMIN_SAFE_INTEGER:qw,NumberParseInt:Lw,ObjectPrototypeHasOwnProperty:Uw,RegExpPrototypeExec:Hf,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:Df}}=De(),{normalizeEncoding:$w}=$e(),{isAsyncFunction:Hw,isArrayBufferView:Vw}=$e().types,jf={};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(Hf(Kw,t)===null)throw new Jr(e,t,Qw);t=Lw(t,8)}return Vf(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)}),Vf=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(!Wf(r,t)){let i="must be one of: "+$f(Bw(r,s=>typeof s=="string"?`'${s}'`:Dw(s)),", ");throw new Jr(e,t,i)}});function Gf(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++)Gf(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);zf(n,i)}}function sm(t,e="signal"){if(ms(t,e),jf[t]===void 0)throw jf[jw(t)]!==void 0?new Df(t+" (signals must use all capital letters)"):new Df(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 zf=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(!Wf(r,t))throw new je(e,`('${$f(r,"|")}')`,t)}var pm=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Ff(t,e){if(typeof t>"u"||!Hf(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 Ff(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];Ff(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"')}Kf.exports={isInt32:Gw,isUint32:zw,parseFileMode:Yw,validateArray:qi,validateStringArray:nm,validateBooleanArray:im,validateAbortSignalArray:om,validateBoolean:Gf,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:Vf,validateUndefined:hm,validateUnion:dm,validateAbortSignal:zf,validateLinkHeaderValue:ym}});var tr=j((YO,Xf)=>{A();x();I();var Te=Xf.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 Qf(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&&Yf())}function Yf(){if(!Zr){var t=Qf(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 Jf(t,e)),qt.length===1&&!Zr&&Qf(Yf)};function Jf(t,e){this.fun=t,this.array=e}Jf.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=j((sR,dh)=>{"use strict";A();x();I();var{SymbolAsyncIterator:Zf,SymbolIterator:eh,SymbolFor:Er}=Ee(),th=Er("nodejs.stream.destroyed"),rh=Er("nodejs.stream.errored"),Ss=Er("nodejs.stream.readable"),Es=Er("nodejs.stream.writable"),nh=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 ih(t){return!!(t&&!wt(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function oh(t){return!!(t&&!wt(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function sh(t){return!!(t&&!wt(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function vm(t){return ih(t)||oh(t)||sh(t)}function Sm(t,e){return t==null?!1:e===!0?typeof t[Zf]=="function":e===!1?typeof t[eh]=="function":typeof t[Zf]=="function"||typeof t[eh]=="function"}function ji(t){if(!wt(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[th]||n!=null&&n.destroyed)}function ah(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 uh(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 lh(t){return t&&t[Ss]!=null?t[Ss]:typeof t?.readable!="boolean"?null:ji(t)?!1:Ui(t)&&t.readable&&!uh(t)}function ch(t){return t&&t[Es]!=null?t[Es]:typeof t?.writable!="boolean"?null:ji(t)?!1:Di(t)&&t.writable&&!ah(t)}function Im(t,e){return wt(t)?ji(t)?!0:!(e?.readable!==!1&&lh(t)||e?.writable!==!1&&ch(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"&&fh(t)?t._closed:null}function fh(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function hh(t){return typeof t._sent100=="boolean"&&fh(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&&hh(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function km(t){var e;return!!(t&&((e=t[nh])!==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[rh])!==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))}dh.exports={isDestroyed:ji,kIsDestroyed:th,isDisturbed:km,kIsDisturbed:nh,isErrored:Cm,kIsErrored:rh,isReadable:lh,kIsReadable:Ss,kIsClosedPromise:wm,kControllerErrorFunction:mm,kIsWritable:Es,isClosed:Pm,isDuplexNodeStream:_m,isFinished:Im,isIterable:Sm,isReadableNodeStream:Ui,isReadableStream:ih,isReadableEnded:Am,isReadableFinished:uh,isReadableErrored:Tm,isNodeStream:wt,isWebStream:vm,isWritable:ch,isWritableNodeStream:Di,isWritableStream:oh,isWritableEnded:ah,isWritableFinished:Em,isWritableErrored:xm,isServerRequest:Om,isServerResponse:hh,willEmitClose:Rm,isTransformStream:sh}});var Ut=j((gR,Ps)=>{"use strict";A();x();I();var rr=tr(),{AbortError:Sh,codes:Bm}=De(),{ERR_INVALID_ARG_TYPE:Mm,ERR_STREAM_PREMATURE_CLOSE:ph}=Bm,{kEmptyObject:Is,once:xs}=$e(),{validateAbortSignal:Nm,validateFunction:qm,validateObject:Lm,validateBoolean:Um}=Xr(),{Promise:Dm,PromisePrototypeThen:jm,SymbolDispose:Eh}=Ee(),{isClosed:Fm,isReadable:yh,isReadableNodeStream:As,isReadableStream:Wm,isReadableFinished:gh,isReadableErrored:bh,isWritable:wh,isWritableNodeStream:mh,isWritableStream:$m,isWritableFinished:_h,isWritableErrored:vh,isNodeStream:Hm,willEmitClose:Vm,kIsClosedPromise:Gm}=mt(),en;function zm(t){return t.setHeader&&typeof t.abort=="function"}var Ts=()=>{};function Ah(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:mh(t),a=t._writableState,c=t._readableState,f=()=>{t.writable||m()},h=Vm(t)&&As(t)===s&&mh(t)===o,d=_h(t,!1),m=()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||s))&&(!s||g)&&r.call(t)},g=gh(t,!1),P=()=>{g=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||o))&&(!o||d)&&r.call(t)},S=y=>{r.call(t,y)},b=Fm(t),w=()=>{b=!0;let y=vh(t)||bh(t);if(y&&typeof y!="boolean")return r.call(t,y);if(s&&!g&&As(t,!0)&&!gh(t,!1))return r.call(t,new ph);if(o&&!d&&!_h(t,!1))return r.call(t,new ph);r.call(t)},_=()=>{b=!0;let y=vh(t)||bh(t);if(y&&typeof y!="boolean")return r.call(t,y);r.call(t)},R=()=>{t.req.on("finish",m)};zm(t)?(t.on("complete",m),h||t.on("abort",w),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",w),t.on("end",P),t.on("finish",m),e.error!==!1&&t.on("error",S),t.on("close",w),b?rr.nextTick(w):a!=null&&a.errorEmitted||c!=null&&c.errorEmitted?h||rr.nextTick(_):(!s&&(!h||yh(t))&&(d||wh(t)===!1)||!o&&(!h||wh(t))&&(g||yh(t)===!1)||c&&t.req&&t.aborted)&&rr.nextTick(_);let T=()=>{r=Ts,t.removeListener("aborted",w),t.removeListener("complete",m),t.removeListener("abort",w),t.removeListener("request",R),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",P),t.removeListener("error",S),t.removeListener("close",w)};if(e.signal&&!b){let y=()=>{let O=r;T(),O.call(t,new Sh(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)rr.nextTick(y);else{en=en||$e().addAbortListener;let O=en(e.signal,y),v=r;r=xs((...M)=>{O[Eh](),v.apply(t,M)})}}return T}function Km(t,e,r){let n=!1,i=Ts;if(e.signal)if(i=()=>{n=!0,r.call(t,new Sh(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[Eh](),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=Ah(t,e,a=>{n&&o(),a?s(a):i()})})}Ps.exports=Ah;Ps.exports.finished=Qm});var Ar=j((xR,Ch)=>{"use strict";A();x();I();var _t=tr(),{aggregateTwoErrors:Ym,codes:{ERR_MULTIPLE_CALLBACK:Jm},AbortError:Xm}=De(),{Symbol:Th}=Ee(),{kIsDestroyed:Zm,isDestroyed:e_,isFinished:t_,isServerRequest:r_}=mt(),Ph=Th("kDestroy"),Os=Th("kConstruct");function Oh(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):(Oh(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?Ih(this,t,e):this.once(Ph,function(s){Ih(this,Ym(s,t),e)}),this)}function Ih(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;Oh(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?_t.nextTick(i_,t,s):_t.nextTick(Rh,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function i_(t,e){Rs(t,e),Rh(t)}function Rh(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(Ph,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 xh(t){return t?.setHeader&&typeof t.abort=="function"}function kh(t){t.emit("close")}function l_(t,e){t.emit("error",e),_t.nextTick(kh,t)}function c_(t,e){!t||e_(t)||(!e&&!t_(t)&&(e=new Xm),r_(t)?(t.socket=null,t.destroy(e)):xh(t)?t.abort():xh(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(kh,t),t.destroyed||(t[Zm]=!0))}Ch.exports={construct:s_,destroyer:c_,destroy:n_,undestroy:o_,errorOrDestroy:ks}});var $i=j((qR,Mh)=>{"use strict";A();x();I();var{ArrayIsArray:f_,ObjectSetPrototypeOf:Bh}=Ee(),{EventEmitter:Fi}=(er(),me(Zt));function Wi(t){Fi.call(this,t)}Bh(Wi.prototype,Fi.prototype);Bh(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]]}Mh.exports={Stream:Wi,prependListener:Cs}});var kn=j((GR,Hi)=>{"use strict";A();x();I();var{SymbolDispose:h_}=Ee(),{AbortError:Nh,codes:d_}=De(),{isNodeStream:qh,isWebStream:p_,kControllerErrorFunction:y_}=mt(),g_=Ut(),{ERR_INVALID_ARG_TYPE:Lh}=d_,Bs,b_=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Lh(e,"AbortSignal",t)};Hi.exports.addAbortSignal=function(e,r){if(b_(e,"signal"),!qh(r)&&!p_(r))throw new Lh("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=qh(e)?()=>{e.destroy(new Nh(void 0,{cause:t.reason}))}:()=>{e[y_](new Nh(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 jh=j((nk,Dh)=>{"use strict";A();x();I();var{StringPrototypeSlice:Uh,SymbolIterator:w_,TypedArrayPrototypeSet:Vi,Uint8Array:m_}=Ee(),{Buffer:Ms}=(ke(),me(qe)),{inspect:__}=$e();Dh.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+=Uh(s,0,e),this.head=n,n.data=Uh(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=j((dk,Hh)=>{"use strict";A();x();I();var{MathFloor:v_,NumberIsInteger:S_}=Ee(),{validateInteger:E_}=Xr(),{ERR_INVALID_ARG_VALUE:A_}=De().codes,Fh=16*1024,Wh=16;function I_(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $h(t){return t?Wh:Fh}function x_(t,e){E_(e,"value",0),t?Wh=e:Fh=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 $h(t.objectMode)}Hh.exports={getHighWaterMark:T_,getDefaultHighWaterMark:$h,setDefaultHighWaterMark:x_}});var zh=j((Ns,Gh)=>{A();x();I();var Gi=(ke(),me(qe)),vt=Gi.Buffer;function Vh(t,e){for(var r in t)e[r]=t[r]}vt.from&&vt.alloc&&vt.allocUnsafe&&vt.allocUnsafeSlow?Gh.exports=Gi:(Vh(Gi,Ns),Ns.Buffer=Ir);function Ir(t,e,r){return vt(t,e,r)}Ir.prototype=Object.create(vt.prototype);Vh(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 Yh=j(Qh=>{"use strict";A();x();I();var Ls=zh().Buffer,Kh=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===Kh||!Kh(t)))throw new Error("Unknown encoding: "+t);return e||t}Qh.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,e);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=j((Wk,ed)=>{"use strict";A();x();I();var Jh=tr(),{PromisePrototypeThen:F_,SymbolAsyncIterator:Xh,SymbolIterator:Zh}=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[Xh])i=!0,n=e[Xh]();else if(e&&e[Zh])i=!1,n=e[Zh]();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),()=>Jh.nextTick(h,f),d=>Jh.nextTick(h,d||f))};async function a(f){let h=f!=null,d=typeof n.throw=="function";if(h&&d){let{value:m,done:g}=await n.throw(f);if(await m,g)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}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}ed.exports=V_});var Nn=j((Xk,wd)=>{"use strict";A();x();I();var lt=tr(),{ArrayPrototypeIndexOf:G_,NumberIsInteger:z_,NumberIsNaN:K_,NumberParseInt:Q_,ObjectDefineProperties:Gs,ObjectKeys:Y_,ObjectSetPrototypeOf:nd,Promise:id,SafeSet:J_,SymbolAsyncDispose:X_,SymbolAsyncIterator:Z_,Symbol:ev}=Ee();wd.exports=le;le.ReadableState=Yi;var{EventEmitter:tv}=(er(),me(Zt)),{Stream:nr,prependListener:rv}=$i(),{Buffer:Ds}=(ke(),me(qe)),{addAbortSignal:nv}=kn(),od=Ut(),de=$e().debuglog("stream",t=>{de=t}),iv=jh(),nn=Ar(),{getHighWaterMark:ov,getDefaultHighWaterMark:sv}=Cn(),{aggregateTwoErrors:td,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:sd}=Yh(),pv=Us();nd(le.prototype,nr.prototype);nd(le,nr);var js=()=>{},{errorOrDestroy:tn}=nn,rn=1,yv=2,ad=4,Mn=8,ud=16,zi=32,Ki=64,ld=128,gv=256,bv=512,wv=1024,Hs=2048,Vs=4096,mv=8192,_v=16384,vv=32768,cd=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(ad),reading:Ce(Mn),constructed:Ce(ud),sync:Ce(zi),needReadable:Ce(Ki),emittedReadable:Ce(ld),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(cd),readingMore:Ce(Sv),dataEmitted:Ce(Ev)});function Yi(t,e,r){typeof r!="boolean"&&(r=e instanceof St()),this.state=Hs|Vs|ud|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 sd(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 id((e,r)=>od(this,n=>n&&n!==t?r(n):e(null)))};le.prototype.push=function(t,e){return fd(this,t,e,!1)};le.prototype.unshift=function(t,e){return fd(this,t,e,!0)};function fd(t,e,r,n){de("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&ad)!==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&cd)!==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 sd(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 rd(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){de("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&=~ld),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return de("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Ws(this):Ji(this),null;if(t=rd(t,e),t===0&&e.ended)return e.length===0&&Ws(this),null;let n=(e.state&Ki)!==0;if(de("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,de("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,de("reading, ended or constructing",n);else if(n){de("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=rd(r,e))}let i;return t>0?i=gd(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(de("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,hd(t))}}function Ji(t){let e=t._readableState;de("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(de("emitReadable",e.flowing),e.emittedReadable=!0,lt.nextTick(hd,t))}function hd(t){let e=t._readableState;de("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,pd(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(de("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),de("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(w,_){de("onunpipe"),w===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,h())}function a(){de("onend"),t.end()}let c,f=!1;function h(){de("cleanup"),t.removeListener("close",P),t.removeListener("finish",S),c&&t.removeListener("drain",c),t.removeListener("error",g),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",m),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}function d(){f||(n.pipes.length===1&&n.pipes[0]===t?(de("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(de("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",m);function m(w){de("ondata");let _=t.write(w);de("dest.write",_),_===!1&&d()}function g(w){if(de("onerror",w),b(),t.removeListener("error",g),t.listenerCount("error")===0){let _=t._writableState||t._readableState;_&&!_.errorEmitted?tn(t,w):t.emit("error",w)}}rv(t,"error",g);function P(){t.removeListener("finish",S),b()}t.once("close",P);function S(){de("onfinish"),t.removeListener("close",P),b()}t.once("finish",S);function b(){de("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?d():n.flowing||(de("pipe resume"),r.resume()),t};function Pv(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(de("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(de("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,de("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"&&lt.nextTick(dd,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)&&lt.nextTick(dd,this),e};function dd(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){de("readable nexttick read 0"),t.read(0)}le.prototype.resume=function(){let t=this._readableState;return t.flowing||(de("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){de("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),pd(t),e.flowing&&!e.reading&&t.read(0)}le.prototype.pause=function(){return de("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(de("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[xr]=!0,this};function pd(t){let e=t._readableState;for(de("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 yd(this)};le.prototype.iterator=function(t){return t!==void 0&&dv(t,"options"),yd(this,t)};function yd(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=od(t,{writable:!1},o=>{i=o?td(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 id(n)}}}catch(o){throw i=td(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=gd;function gd(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;de("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,lt.nextTick(Bv,e,t))}function Bv(t,e){if(de("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 bd(){return $s===void 0&&($s={}),$s}le.fromWeb=function(t,e){return bd().newStreamReadableFromReadableStream(t,e)};le.toWeb=function(t,e){return bd().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=j((uC,Rd)=>{"use strict";A();x();I();var Tr=tr(),{ArrayPrototypeSlice:vd,Error:Nv,FunctionPrototypeSymbolHasInstance:Sd,ObjectDefineProperty:Ed,ObjectDefineProperties:qv,ObjectSetPrototypeOf:Ad,StringPrototypeToLowerCase:Lv,Symbol:Uv,SymbolHasInstance:Dv}=Ee();Rd.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:Id,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:xd}=De().codes,{errorOrDestroy:on}=to;Ad(Ie.prototype,qn.prototype);Ad(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 vd(this.buffered,this.bufferedIndex)};Ed(Un.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ie(t){let e=this instanceof St();if(!e&&!Sd(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)})}Ed(Ie,Dv,{__proto__:null,value:function(t){return Sd(this,t)?!0:this!==Ie?!1:t&&t._writableState instanceof Un}});Ie.prototype.pipe=function(){on(this,new Gv)};function Td(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 xd(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 Td(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 xd(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 md(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 _d(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 Id);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(_d,t,r,e,i):_d(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)):Pd(t,r,1,i))}function Xv({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Pd(t,e,r,n)}function Pd(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:vd(r,o);c.allBuffers=e.allBuffers,md(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;md(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=Td(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??Id());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 Od(){return zs===void 0&&(zs={}),zs}Ie.fromWeb=function(t,e){return Od().newStreamWritableFromWritableStream(t,e)};Ie.toWeb=function(t){return Od().newWritableStreamFromStreamWritable(t)}});var Vd=j((wC,Hd)=>{A();x();I();var Zs=tr(),r0=(ke(),me(qe)),{isReadable:n0,isWritable:i0,isIterable:kd,isNodeStream:o0,isReadableNodeStream:Cd,isWritableNodeStream:Bd,isDuplexNodeStream:s0,isReadableStream:Md,isWritableStream:Nd}=mt(),qd=Ut(),{AbortError:Wd,codes:{ERR_INVALID_ARG_TYPE:a0,ERR_INVALID_RETURN_VALUE:Ld}}=De(),{destroyer:un}=Ar(),u0=St(),$d=Nn(),l0=ro(),{createDeferredPromise:Ud}=$e(),Dd=Us(),jd=globalThis.Blob||r0.Blob,c0=typeof jd<"u"?function(e){return e instanceof jd}:function(e){return!1},f0=globalThis.AbortController||Yr().AbortController,{FunctionPrototypeCall:Fd}=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)}};Hd.exports=function t(e,r){if(s0(e))return e;if(Cd(e))return an({readable:e});if(Bd(e))return an({writable:e});if(o0(e))return an({writable:!1,readable:!1});if(Md(e))return an({readable:$d.fromWeb(e)});if(Nd(e))return an({writable:l0.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=h0(e);if(kd(i))return Dd(ir,i,{objectMode:!0,write:s,final:o,destroy:a});let c=i?.then;if(typeof c=="function"){let f,h=Fd(c,i,d=>{if(d!=null)throw new Ld("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(m){Zs.nextTick(d,m)}})},destroy:a})}throw new Ld("Iterable, AsyncIterable or AsyncFunction",r,i)}if(c0(e))return t(e.arrayBuffer());if(kd(e))return Dd(ir,e,{objectMode:!0,writable:!1});if(Md(e?.readable)&&Nd(e?.writable))return ir.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?Cd(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?Bd(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 Fd(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}=Ud(),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 Wd(void 0,{cause:i.reason});({promise:e,resolve:r}=Ud()),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"?$d.wrap(t.readable):t.readable,r=t.writable,n=!!n0(e),i=!!i0(r),s,o,a,c,f;function h(d){let m=c;c=null,m?m(d):d&&f.destroy(d)}return f=new ir({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(qd(r,d=>{i=!1,d&&un(e,d),h(d)}),f._write=function(d,m,g){r.write(d,m)?g():s=g},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&&(qd(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,m){!d&&c!==null&&(d=new Wd),a=null,s=null,o=null,c===null?m(d):(c=m,un(r,d),un(e,d))},f}});var St=j((PC,Kd)=>{"use strict";A();x();I();var{ObjectDefineProperties:d0,ObjectGetOwnPropertyDescriptor:Dt,ObjectKeys:p0,ObjectSetPrototypeOf:Gd}=Ee();Kd.exports=ct;var ra=Nn(),tt=ro();Gd(ct.prototype,ra.prototype);Gd(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 zd(){return ea===void 0&&(ea={}),ea}ct.fromWeb=function(t,e){return zd().newStreamDuplexFromReadableWritablePair(t,e)};ct.toWeb=function(t){return zd().newReadableWritablePairFromDuplex(t)};var ta;ct.from=function(t){return ta||(ta=Vd()),ta(t,"body")}});var oa=j((UC,Yd)=>{"use strict";A();x();I();var{ObjectSetPrototypeOf:Qd,Symbol:y0}=Ee();Yd.exports=jt;var{ERR_METHOD_NOT_IMPLEMENTED:g0}=De().codes,ia=St(),{getHighWaterMark:b0}=Cn();Qd(jt.prototype,ia.prototype);Qd(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=j((KC,Xd)=>{"use strict";A();x();I();var{ObjectSetPrototypeOf:Jd}=Ee();Xd.exports=ln;var sa=oa();Jd(ln.prototype,sa.prototype);Jd(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=j((iB,np)=>{A();x();I();var jn=tr(),{ArrayIsArray:m0,Promise:_0,SymbolAsyncIterator:v0,SymbolDispose:S0}=Ee(),oo=Ut(),{once:E0}=$e(),A0=Ar(),Zd=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:ep,isTransformStream:cn,isWebStream:C0,isReadableStream:ca,isReadableFinished:B0}=mt(),M0=globalThis.AbortController||Yr().AbortController,fa,ha,da;function tp(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 rp(t,E0(N0(t)))}function rp(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=[],m=0;function g(R){P(R,--m===0)}function P(R,T){var y;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!T)){for(;d.length;)d.shift()(f);(y=c)===null||y===void 0||y[S0](),n.abort(),T&&(f||o.forEach(O=>O()),jn.nextTick(e,f,h))}}let S;for(let R=0;R<t.length;R++){let T=t[R],y=R<t.length-1,O=R>0,v=y||r?.end!==!1,M=R===t.length-1;if(ep(T)){let F=function(U){U&&U.name!=="AbortError"&&U.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(U)};var _=F;if(v){let{destroy:U,cleanup:Q}=tp(T,y,O);d.push(U),la(T)&&M&&o.push(Q)}T.on("error",F),la(T)&&M&&o.push(()=>{T.removeListener("error",F)})}if(R===0)if(typeof T=="function"){if(S=T({signal:i}),!Pr(S))throw new ua("Iterable, AsyncIterable or Stream","source",S)}else Pr(T)||io(T)||cn(T)?S=T:S=Zd.from(T);else if(typeof T=="function"){if(cn(S)){var b;S=pa((b=S)===null||b===void 0?void 0:b.readable)}else S=pa(S);if(S=T(S,{signal:i}),y){if(!Pr(S,!0))throw new ua("AsyncIterable",`transform[${R-1}]`,S)}else{var w;fa||(fa=aa());let F=new fa({objectMode:!0}),U=(w=S)===null||w===void 0?void 0:w.then;if(typeof U=="function")m++,U.call(S,H=>{h=H,H!=null&&F.write(H),v&&F.end(),jn.nextTick(g)},H=>{F.destroy(H),jn.nextTick(g,H)});else if(Pr(S,!0))m++,no(S,F,g,{end:v});else if(ca(S)||cn(S)){let H=S.readable||S;m++,no(H,F,g,{end:v})}else throw new ua("AsyncIterable or Promise","destination",S);S=F;let{destroy:Q,cleanup:W}=tp(S,!1,!0);d.push(Q),M&&o.push(W)}}else if(ep(T)){if(io(S)){m+=2;let F=U0(S,T,g,{end:v});la(T)&&M&&o.push(F)}else if(cn(S)||ca(S)){let F=S.readable||S;m++,no(F,T,g,{end:v})}else if(Pr(S))m++,no(S,T,g,{end:v});else throw new ga("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=T}else if(C0(T)){if(io(S))m++,ya(pa(S),T,g,{end:v});else if(ca(S)||Pr(S))m++,ya(S,T,g,{end:v});else if(cn(S))m++,ya(S.readable,T,g,{end:v});else throw new ga("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=T}else S=Zd.from(T)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&jn.nextTick(a),S}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()};var s=o;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)}np.exports={pipelineImpl:rp,pipeline:L0}});var wa=j((pB,lp)=>{"use strict";A();x();I();var{pipeline:D0}=so(),ao=St(),{destroyer:j0}=Ar(),{isNodeStream:uo,isReadable:ip,isWritable:op,isWebStream:ba,isTransformStream:Or,isWritableStream:sp,isReadableStream:ap}=mt(),{AbortError:F0,codes:{ERR_INVALID_ARG_VALUE:up,ERR_MISSING_ARGS:W0}}=De(),$0=Ut();lp.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 g=e.length-1;e[g]=ao.from(e[g])}for(let g=0;g<e.length;++g)if(!(!uo(e[g])&&!ba(e[g]))){if(g<e.length-1&&!(ip(e[g])||ap(e[g])||Or(e[g])))throw new up(`streams[${g}]`,r[g],"must be readable");if(g>0&&!(op(e[g])||sp(e[g])||Or(e[g])))throw new up(`streams[${g}]`,r[g],"must be writable")}let n,i,s,o,a;function c(g){let P=o;o=null,P?P(g):g?a.destroy(g):!m&&!d&&a.destroy()}let f=e[0],h=D0(e,c),d=!!(op(f)||sp(f)||Or(f)),m=!!(ip(h)||ap(h)||Or(h));if(a=new ao({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(h!=null&&h.readableObjectMode),writable:d,readable:m}),d){if(uo(f))a._write=function(P,S,b){f.write(P,S)?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 S=(Or(f)?f.writable:f).getWriter();a._write=async function(b,w,_){try{await S.ready,S.write(b).catch(()=>{}),_()}catch(R){_(R)}},a._final=async function(b){try{await S.ready,S.close().catch(()=>{}),i=b}catch(w){b(w)}}}let g=Or(h)?h.readable:h;$0(g,()=>{if(i){let P=i;i=null,P()}})}if(m){if(uo(h))h.on("readable",function(){if(s){let g=s;s=null,g()}}),h.on("end",function(){a.push(null)}),a._read=function(){for(;;){let g=h.read();if(g===null){s=a._read;return}if(!a.push(g))return}};else if(ba(h)){let P=(Or(h)?h.readable:h).getReader();a._read=async function(){for(;;)try{let{value:S,done:b}=await P.read();if(!a.push(S))return;if(b){a.push(null);return}}catch{return}}}}return a._destroy=function(g,P){!g&&o!==null&&(g=new F0),s=null,n=null,i=null,o===null?P(g):(o=P,uo(h)&&j0(h,g))},a}});var mp=j((AB,va)=>{"use strict";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:cp,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:fp,Number:iS,NumberIsNaN:oS,Promise:hp,PromiseReject:dp,PromiseResolve:sS,PromisePrototypeThen:pp,Symbol:gp}=Ee(),lo=gp("kEmpty"),yp=gp("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=fp(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=fp(e.highWaterMark)),cp(r,"options.concurrency",1),cp(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,m=0;function g(){d=!0,P()}function P(){m-=1,S()}function S(){h&&!d&&m<r&&a.length<n&&(h(),h=null)}async function b(){try{for await(let w of o){if(d)return;if(s.aborted)throw new Et;try{if(w=t(w,c),w===lo)continue;w=sS(w)}catch(_){w=dp(_)}m+=1,pp(w,P,g),a.push(w),f&&(f(),f=null),!d&&(a.length>=n||m>=r)&&await new hp(_=>{h=_})}a.push(yp)}catch(w){let _=dp(w);pp(_,P,g),a.push(_)}finally{d=!0,f&&(f(),f=null)}}b();try{for(;;){for(;a.length>0;){let w=await a[0];if(w===yp)return;if(s.aborted)throw new Et;w!==lo&&(yield w),a.shift(),S()}await new hp(w=>{f=w})}}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 bp(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 bp.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 wp(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=wp(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=wp(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:bp,find:cS}});var Sa=j((MB,_p)=>{"use strict";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})})}_p.exports={finished:ES,pipeline:AS}});var Ea=j((HB,Op)=>{"use strict";A();x();I();var{Buffer:IS}=(ke(),me(qe)),{ObjectDefineProperty:Ft,ObjectKeys:Ep,ReflectApply:Ap}=Ee(),{promisify:{custom:Ip}}=$e(),{streamReturningOperators:vp,promiseReturningOperators:Sp}=mp(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:xp}}=De(),xS=wa(),{setDefaultHighWaterMark:TS,getDefaultHighWaterMark:PS}=Cn(),{pipeline:Tp}=so(),{destroyer:OS}=Ar(),Pp=Ut(),Aa=Sa(),Wn=mt(),Se=Op.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 Ep(vp)){let r=function(...n){if(new.target)throw xp();return Se.Readable.from(Ap(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})}for(let t of Ep(Sp)){let r=function(...n){if(new.target)throw xp();return Ap(e,this,n)},e=Sp[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=Tp;var{addAbortSignal:RS}=kn();Se.addAbortSignal=RS;Se.finished=Pp;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(Tp,Ip,{__proto__:null,enumerable:!0,get(){return Aa.pipeline}});Ft(Pp,Ip,{__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=j((eM,Pe)=>{"use strict";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 Rp=j((cM,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 Bp=j((_M,Cp)=>{"use strict";A();x();I();var{Buffer:ft}=(ke(),me(qe)),kp=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,kp,{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 m=this._bufs[d].length-h;if(c>m)this._bufs[d].copy(e,f,h),f+=m;else{this._bufs[d].copy(e,f,h,h+c),f+=m;break}c-=m,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[kp]};Cp.exports=we});var Mp=j((RM,fo)=>{"use strict";A();x();I();var xa=or().Duplex,BS=Rp(),$n=Bp();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 qp=j((jM,Np)=>{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}};Np.exports=Ta});var Pa=j((YM,Lp)=>{A();x();I();var K=Lp.exports,{Buffer:Ke}=(ke(),me(qe));K.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"};K.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};K.requiredHeaderFlagsErrors={};for(let t in K.requiredHeaderFlags){let e=K.requiredHeaderFlags[t];K.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+K.types[t]+" packet"}K.codes={};for(let t in K.types){let e=K.types[t];K.codes[e]=t}K.CMD_SHIFT=4;K.CMD_MASK=240;K.DUP_MASK=8;K.QOS_MASK=3;K.QOS_SHIFT=1;K.RETAIN_MASK=1;K.VARBYTEINT_MASK=127;K.VARBYTEINT_FIN_MASK=128;K.VARBYTEINT_MAX=268435455;K.SESSIONPRESENT_MASK=1;K.SESSIONPRESENT_HEADER=Ke.from([K.SESSIONPRESENT_MASK]);K.CONNACK_HEADER=Ke.from([K.codes.connack<<K.CMD_SHIFT]);K.USERNAME_MASK=128;K.PASSWORD_MASK=64;K.WILL_RETAIN_MASK=32;K.WILL_QOS_MASK=24;K.WILL_QOS_SHIFT=3;K.WILL_FLAG_MASK=4;K.CLEAN_SESSION_MASK=2;K.CONNECT_HEADER=Ke.from([K.codes.connect<<K.CMD_SHIFT]);K.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};K.propertiesCodes={};for(let t in K.properties){let e=K.properties[t];K.propertiesCodes[e]=t}K.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(K.codes[t]<<K.CMD_SHIFT|(r?K.DUP_MASK:0)|e<<K.QOS_SHIFT|n,0,!0),i})))}K.PUBLISH_HEADER=sr("publish");K.SUBSCRIBE_HEADER=sr("subscribe");K.SUBSCRIBE_OPTIONS_QOS_MASK=3;K.SUBSCRIBE_OPTIONS_NL_MASK=1;K.SUBSCRIBE_OPTIONS_NL_SHIFT=2;K.SUBSCRIBE_OPTIONS_RAP_MASK=1;K.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;K.SUBSCRIBE_OPTIONS_RH_MASK=3;K.SUBSCRIBE_OPTIONS_RH_SHIFT=4;K.SUBSCRIBE_OPTIONS_RH=[0,16,32];K.SUBSCRIBE_OPTIONS_NL=4;K.SUBSCRIBE_OPTIONS_RAP=8;K.SUBSCRIBE_OPTIONS_QOS=[0,1,2];K.UNSUBSCRIBE_HEADER=sr("unsubscribe");K.ACKS={unsuback:sr("unsuback"),puback:sr("puback"),pubcomp:sr("pubcomp"),pubrel:sr("pubrel"),pubrec:sr("pubrec")};K.SUBACK_HEADER=Ke.from([K.codes.suback<<K.CMD_SHIFT]);K.VERSION3=Ke.from([3]);K.VERSION4=Ke.from([4]);K.VERSION5=Ke.from([5]);K.VERSION131=Ke.from([131]);K.VERSION132=Ke.from([132]);K.QOS=[0,1,2].map(t=>Ke.from([t]));K.EMPTY={pingreq:Ke.from([K.codes.pingreq<<4,0]),pingresp:Ke.from([K.codes.pingresp<<4,0]),disconnect:Ke.from([K.codes.disconnect<<4,0])};K.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"};K.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};K.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"};K.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"};K.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"};K.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var Dp=j((s2,Up)=>{A();x();I();var fn=1e3,hn=fn*60,dn=hn*60,Cr=dn*24,MS=Cr*7,NS=Cr*365.25;Up.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 Fp=j((g2,jp)=>{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=Dp(),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 m=0;m<h.length;m++)d=(d<<5)-d+h.charCodeAt(m),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(h){let d,m=null,g,P;function S(...b){if(!S.enabled)return;let w=S,_=Number(new Date),R=_-(d||_);w.diff=R,w.prev=d,w.curr=_,d=_,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,v)=>{if(O==="%%")return"%";T++;let M=r.formatters[v];if(typeof M=="function"){let F=b[T];O=M.call(w,F),b.splice(T,1),T--}return O}),r.formatArgs.call(w,b),(w.log||r.log).apply(w,b)}return S.namespace=h,S.useColors=r.useColors(),S.color=r.selectColor(h),S.extend=n,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,P=r.enabled(h)),P),set:b=>{m=b}}),typeof r.init=="function"&&r.init(S),S}function n(h,d){let m=r(this.namespace+(typeof d>"u"?":":d)+h);return m.log=this.log,m}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 m of d)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}function s(h,d){let m=0,g=0,P=-1,S=0;for(;m<h.length;)if(g<d.length&&(d[g]===h[m]||d[g]==="*"))d[g]==="*"?(P=g,S=m,g++):(m++,g++);else if(P!==-1)g=P+1,S++,m=S;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===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}jp.exports=DS});var At=j((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 N<"u"&&"env"in N&&(t=N.env.DEBUG),t}function HS(){try{return localStorage}catch{}}po.exports=Fp()(Qe);var{formatters:VS}=po.exports;VS.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Hp=j((N2,$p)=>{A();x();I();var GS=Mp(),{EventEmitter:zS}=(er(),me(Zt)),Wp=qp(),pe=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 Wp,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>>pe.CMD_SHIFT;this.packet.cmd=pe.types[r];let n=e&15,i=pe.requiredHeaderFlags[r];return i!=null&&n!==i?this._emitError(new Error(pe.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&pe.RETAIN_MASK)!==0,this.packet.qos=e>>pe.QOS_SHIFT&pe.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&pe.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)&pe.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&pe.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&pe.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&pe.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&pe.WILL_QOS_MASK)>>pe.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)&pe.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&pe.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&pe.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(n>>pe.SUBSCRIBE_OPTIONS_NL_SHIFT&pe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,o=(n>>pe.SUBSCRIBE_OPTIONS_RAP_SHIFT&pe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,s=n>>pe.SUBSCRIBE_OPTIONS_RH_SHIFT&pe.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(!pe.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(!pe.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(!pe.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!pe.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(),pe.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(),!pe.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&pe.VARBYTEINT_MASK),i*=128,(a&pe.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=pe.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(pe.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(pe.propertiesTypes[o])):(i[o]=[i[o]],i[o].push(this._parseByType(pe.propertiesTypes[o]))):i[o]=this._parseByType(pe.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 Wp,this._pos=0,!0}_emitError(e){ae("_emitError",e),this.error=e,this.emit("error",e)}};$p.exports=Oa});var Kp=j((V2,zp)=>{A();x();I();var{Buffer:Hn}=(ke(),me(qe)),KS=65536,Vp={},QS=Hn.isBuffer(Hn.from([1,2]).subarray(0,1));function Gp(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++)Vp[t]=Gp(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}zp.exports={cache:Vp,generateCache:YS,generateNumber:Gp,genBufVariableByteInt:JS,generate4ByteBuffer:XS}});var Qp=j((tN,Ra)=>{"use strict";A();x();I();typeof N>"u"||!N.version||N.version.indexOf("v0.")===0||N.version.indexOf("v1.")===0&&N.version.indexOf("v1.8.")!==0?Ra.exports={nextTick:ZS}:Ra.exports=N;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 N.nextTick(t);case 2:return N.nextTick(function(){t.call(null,e)});case 3:return N.nextTick(function(){t.call(null,e,r)});case 4:return N.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 N.nextTick(function(){t.apply(null,s)})}}});var Ba=j((fN,ny)=>{A();x();I();var ue=Pa(),{Buffer:se}=(ke(),me(qe)),eE=se.allocUnsafe(0),tE=se.from([0]),Vn=Kp(),rE=Qp().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 ty(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,r);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,r);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(ty,"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,m=n.properties;a===void 0&&(a=!0);let g=0;if(!i||typeof i!="string"&&!se.isBuffer(i))return e.destroy(new Error("Invalid protocolId")),!1;if(g+=i.length+2,s!==3&&s!==4&&s!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(g+=1,(typeof f=="string"||se.isBuffer(f))&&(f||s>=4)&&(f||a))g+=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;g+=2,g+=1;let P,S;if(s===5){if(P=ar(e,m),!P)return!1;g+=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(g+=se.byteLength(o.topic)+2,g+=2,o.payload)if(o.payload.length>=0)typeof o.payload=="string"?g+=se.byteLength(o.payload):g+=o.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(S={},s===5){if(S=ar(e,o.properties),!S)return!1;g+=S.length}}let b=!1;if(h!=null)if(ey(h))b=!0,g+=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(ey(d))g+=ry(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(ue.CONNECT_HEADER),nt(e,g),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 w=0;return w|=h!=null?ue.USERNAME_MASK:0,w|=d!=null?ue.PASSWORD_MASK:0,w|=o&&o.retain?ue.WILL_RETAIN_MASK:0,w|=o&&o.qos?o.qos<<ue.WILL_QOS_SHIFT:0,w|=o?ue.WILL_FLAG_MASK:0,w|=a?ue.CLEAN_SESSION_MASK:0,e.write(se.from([w])),He(e,c),s===5&&P.write(),pn(e,f),o&&(s===5&&S.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 m=null;if(n===5){if(m=ar(e,h),!m)return!1;d+=m.length}return e.write(ue.PUBLISH_HEADER[s][i.dup?1:0][o?1:0]),nt(e,d),He(e,ry(a)),e.write(a),s>0&&He(e,f),m?.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 m=null;if(n===5&&typeof h=="object"){if(m=Gn(e,h,r,d),!m)return!1;d+=m.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])),m!==null?m.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 m=0;m<a.length;m+=1){let g=a[m].topic,P=a[m].qos;if(typeof g!="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[m].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(a[m].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let w=a[m].rh||0;if(typeof w!="number"||w>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=se.byteLength(g)+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 m of a){let g=m.topic,P=m.qos,S=+m.nl,b=+m.rap,w=m.rh,_;Br(e,g),_=ue.SUBSCRIBE_OPTIONS_QOS[P],n===5&&(_|=S?ue.SUBSCRIBE_OPTIONS_NL:0,_|=b?ue.SUBSCRIBE_OPTIONS_RAP:0,_|=w?ue.SUBSCRIBE_OPTIONS_RH[w]:0),d=e.write(se.from([_]))}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 m=0;m<a.length;m+=1){if(typeof a[m]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;f+=se.byteLength(a[m])+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 m=0;m<a.length;m++)d=Br(e,a[m]);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 g=0;g<a.length;g+=1){if(typeof a[g]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let m=null;if(n===5){if(m=Gn(e,c,r,d),!m)return!1;d+=m.length}return e.write(ue.ACKS[f][h][o][0]),nt(e,d),He(e,s),m!==null&&m.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 Yp={};function nt(t,e){if(e>ue.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Yp[e];return r||(r=ka(e),e<16384&&(Yp[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 Jp(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(){Zp(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((m,g)=>(m+=3+se.byteLength(h.toString())+2+se.byteLength(g.toString()),m),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(){Zp(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 Xp(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]])),Jp(t,i.toString(),o.toString())}):(t.write(se.from([ue.properties[e]])),Jp(t,i.toString(),s.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Zp(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++)Xp(t,n,i[s]);else Xp(t,n,i)}}function ry(t){return t?t instanceof se?t.length:se.byteLength(t):0}function ey(t){return typeof t=="string"||t instanceof se}ny.exports=ty});var sy=j((vN,oy)=>{A();x();I();var _E=Ba(),{EventEmitter:vE}=(er(),me(Zt)),{Buffer:iy}=(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]=iy.byteLength(n[s]),e+=r[s];let o=iy.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)}};oy.exports=SE});var ay=j(bo=>{A();x();I();bo.parser=Hp().parser;bo.generate=sy();bo.writeToStream=Ba()});var ly=j((FN,uy)=>{"use strict";A();x();I();uy.exports=EE;function yn(t){return t instanceof D?D.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],m=o[d];typeof m!="object"||m===null?f[d]=m:m.constructor!==Object&&(r=e.get(m.constructor))?f[d]=r(m,a):ArrayBuffer.isView(m)?f[d]=yn(m):f[d]=a(m)}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 m=0;m<h.length;m++){let g=h[m],P=c[g];if(typeof P!="object"||P===null)d[g]=P;else if(P.constructor!==Object&&(i=n.get(P.constructor)))d[g]=i(P,f);else if(ArrayBuffer.isView(P))d[g]=yn(P);else{let S=e.indexOf(P);S!==-1?d[g]=r[S]:d[g]=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 m=e.indexOf(d);m!==-1?f[h]=r[m]: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 m=e.indexOf(d);m!==-1?f[h]=r[m]:f[h]=a(d)}}return e.pop(),r.pop(),f}}});var fy=j((JN,cy)=>{"use strict";A();x();I();cy.exports=ly()()});var Na=j(wo=>{"use strict";A();x();I();Object.defineProperty(wo,"__esModule",{value:!0});wo.validateTopic=hy;wo.validateTopics=IE;function hy(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(!hy(t[e]))return t[e];return null}});var Ua=j(La=>{"use strict";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 py=j(Da=>{"use strict";A();x();I();Object.defineProperty(Da,"__esModule",{value:!0});var dy=[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(dy.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(dy.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 yy=j((Lq,RE)=>{RE.exports={version:"5.15.2"}});var Mr=j(ht=>{"use strict";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 N?.nextTick=="function"?N.nextTick:t=>{setTimeout(t,0)};ht.MQTTJS_VERSION=yy().version});var zn=j(ur=>{"use strict";A();x();I();Object.defineProperty(ur,"__esModule",{value:!0});ur.ReasonCodes=void 0;var gy=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 gy.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 gy.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 wy=j(Wa=>{"use strict";A();x();I();Object.defineProperty(Wa,"__esModule",{value:!0});var by=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 by.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 by.ErrorWithReasonCode(`Connection refused: ${BE.ReasonCodes[i]}`,i);t.emit("error",a)}})};Wa.default=ME});var Ey=j(_o=>{"use strict";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,_y=new Set,$a=typeof N=="object"&&N?N:{},vy=(t,e,r,n)=>{typeof $a.emitWarning=="function"?$a.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},mo=globalThis.AbortController,my=globalThis.AbortSignal;if(typeof mo>"u"){my=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},mo=class{constructor(){e()}signal=new my;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,vy("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=>!_y.has(t),gL=Symbol("type"),lr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Sy=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=Sy(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:m,maxSize:g=0,maxEntrySize:P=0,sizeCalculation:S,fetchMethod:b,memoMethod:w,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:y,ignoreFetchAbort:O}=e;if(r!==0&&!lr(r))throw new TypeError("max option must be a nonnegative integer");let v=r?Sy(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=g,this.maxEntrySize=P||this.#f,this.sizeCalculation=S,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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#k=w,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 v(r),this.#h=new v(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=!!m,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!y,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 M="LRU_CACHE_UNBOUNDED";NE(M)&&(_y.add(M),vy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,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 m=this.#e[d];if(r!==m){if(this.#x&&this.#t(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!o&&(this.#v&&this.#y?.(g,e,"set"),this.#c&&this.#s?.push([g,e,"set"]))}else o||(this.#v&&this.#y?.(m,e,"set"),this.#c&&this.#s?.push([m,e,"set"]));if(this.#P(d),this.#C(d,h,c),this.#e[d]=r,c){c.set="replace";let g=m&&this.#t(m)?m.__staleWhileFetching:m;g!==void 0&&(c.oldValue=g)}}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 m=this.#s,g;for(;g=m?.shift();)this.#g?.(...g)}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=(S,b=!1)=>{let{aborted:w}=o.signal,_=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(w&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!_&&!b)return d(o.signal.reason);let R=g;return this.#e[r]===g&&(S===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,S,c.options))),S},h=S=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=S),d(S)),d=S=>{let{aborted:b}=o.signal,w=b&&n.allowStaleOnFetchAbort,_=w||n.allowStaleOnFetchRejection,R=_||n.noDeleteOnFetchRejection,T=g;if(this.#e[r]===g&&(!R||T.__staleWhileFetching===void 0?this.#A(e,"fetch"):w||(this.#e[r]=T.__staleWhileFetching)),_)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw S},m=(S,b)=>{let w=this.#R?.(e,s,c);w&&w instanceof Promise&&w.then(_=>S(_===void 0?void 0:_),b),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=_=>f(_,!0)))})};n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(f,h),P=Object.assign(g,{__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:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:w,signal:_}=r;if(!this.#x)return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let R={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:f,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:P,ignoreFetchAbort:g,status:w,signal:_},T=this.#n.get(e);if(T===void 0){w&&(w.fetch="miss");let y=this.#M(e,T,R,S);return y.__returned=y}else{let y=this.#e[T];if(this.#t(y)){let U=n&&y.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",U&&(w.returnedStale=!0)),U?y.__staleWhileFetching:y.__returned=y}let O=this.#p(T);if(!b&&!O)return w&&(w.fetch="hit"),this.#O(T),i&&this.#T(T),w&&this.#I(w,T),y;let v=this.#M(e,T,R,S),F=v.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=O?"stale":"refresh",F&&O&&(w.returnedStale=!0)),F?v.__staleWhileFetching:v.__returned=v}}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=j(cr=>{"use strict";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 Ay=j(So=>{"use strict";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 Iy=j(Eo=>{"use strict";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 xy=j(Ao=>{"use strict";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=j(Io=>{"use strict";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=j(Xa=>{"use strict";A();x();I();Object.defineProperty(Xa,"t",{value:!0});Xa.throwIteratorAccessError=HE;function HE(){throw new RangeError("Iterator access denied!")}});var eu=j(Po=>{"use strict";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 Ty=j(Oo=>{"use strict";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 Py=j(Ro=>{"use strict";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 Oy=j(ko=>{"use strict";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 Ry=j(wn=>{"use strict";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=j(Bo=>{"use strict";A();x();I();Object.defineProperty(Bo,"t",{value:!0});Bo.default=void 0;var ky=Ry(),i1=It(),Cy=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=ky.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=ky.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(),m=this.v(d.u,e);if(m===0){d.l=r;return}else m<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,Cy.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,Cy.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=j(No=>{"use strict";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 My=j(qo=>{"use strict";A();x();I();Object.defineProperty(qo,"t",{value:!0});qo.default=void 0;var u1=By(su()),l1=By(uu()),c1=xt();function By(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 qy=j(Lo=>{"use strict";A();x();I();Object.defineProperty(Lo,"t",{value:!0});Lo.default=void 0;var h1=Ny(su()),d1=Ny(uu()),p1=xt();function Ny(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=j(fu=>{"use strict";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=j(mn=>{"use strict";A();x();I();Object.defineProperty(mn,"t",{value:!0});mn.HashContainerIterator=mn.HashContainer=void 0;var Ly=It(),du=b1(hu()),Kn=xt();function b1(t){return t&&t.t?t:{default:t}}var pu=class extends Ly.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 Ly.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 Dy=j(Uo=>{"use strict";A();x();I();Object.defineProperty(Uo,"t",{value:!0});Uo.default=void 0;var Uy=gu(),w1=xt(),Dr=class t extends Uy.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 Uy.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 Fy=j(Do=>{"use strict";A();x();I();Object.defineProperty(Do,"t",{value:!0});Do.default=void 0;var jy=gu(),_1=S1(hu()),v1=xt();function S1(t){return t&&t.t?t:{default:t}}var jr=class t extends jy.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 jy.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 Wy=j(it=>{"use strict";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(Ay()),I1=Tt(Iy()),x1=Tt(xy()),T1=Tt(Ty()),P1=Tt(Py()),O1=Tt(Oy()),R1=Tt(My()),k1=Tt(qy()),C1=Tt(Dy()),B1=Tt(Fy());function Tt(t){return t&&t.t?t:{default:t}}});var Hy=j((fj,$y)=>{"use strict";A();x();I();var M1=Wy().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)};$y.exports=Ot});var mu=j((vj,Vy)=>{A();x();I();var q1=Hy();Vy.exports.NumberAllocator=q1});var Gy=j(vu=>{"use strict";A();x();I();Object.defineProperty(vu,"__esModule",{value:!0});var L1=Ey(),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 zy=j(Qn=>{"use strict";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(Gy()),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 Ky=j(Su=>{"use strict";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 Qy=j(Yn=>{"use strict";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(py()),G1=Jn(wy()),z1=Jn(zy()),K1=Jn(zn()),Q1=Jn(Ky()),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=j(Au=>{"use strict";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 Yy=j(Tu=>{"use strict";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 Jy=j(_n=>{"use strict";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 Pu=j((Fo,Xy)=>{A();x();I();(function(t,e){typeof Fo=="object"&&typeof Xy<"u"?e(Fo):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(Fo,(function(t){"use strict";var e=function(m){return function(g){var P=m(g);return g.add(P),P}},r=function(m){return function(g,P){return m.set(g,P),P}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,o=function(m,g){return function(P){var S=g.get(P),b=S===void 0?P.size:S<s?S+1:0;if(!P.has(b))return m(P,b);if(P.size<i){for(;P.has(b);)b=Math.floor(Math.random()*s);return m(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 m(P,b)}},a=new WeakMap,c=r(a),f=o(c,a),h=e(f);t.addUniqueNumber=h,t.generateUniqueNumber=f}))});var Xn=j((r8,Wt)=>{A();x();I();function Ou(t){"@babel/helpers - typeof";return Wt.exports=Ou=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,Ou(t)}Wt.exports=Ou,Wt.exports.__esModule=!0,Wt.exports.default=Wt.exports});var eg=j((h8,Zn)=>{A();x();I();var Zy=Xn().default;function eA(t,e){if(Zy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Zy(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 tg=j((S8,ei)=>{A();x();I();var tA=Xn().default,rA=eg();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 rg=j((C8,ti)=>{A();x();I();var iA=tg();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 ng=j((W8,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 ig=j((X8,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 og=j((u6,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 ag=j((w6,oi)=>{A();x();I();var sg=og();function lA(t,e){if(t){if(typeof t=="string")return sg(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)?sg(t,e):void 0}}oi.exports=lA,oi.exports.__esModule=!0,oi.exports.default=oi.exports});var ug=j((P6,si)=>{A();x();I();function cA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- 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 lg=j((U6,ai)=>{A();x();I();var fA=ng(),hA=ig(),dA=ag(),pA=ug();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 fg=j((K6,ui)=>{A();x();I();function cg(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){cg(s,n,i,o,a,"next",c)}function a(c){cg(s,n,i,o,a,"throw",c)}o(void 0)})}}ui.exports=gA,ui.exports.__esModule=!0,ui.exports.default=ui.exports});var Ru=j((iW,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=j((pW,$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,m){Wo(o,d,function(g){return this._invoke(d,m,g)})}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=j((AW,Ht)=>{A();x();I();var Rt=ku();function hg(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,P,S,b){var w=P&&P.prototype instanceof a?P:a,_=Object.create(w.prototype);return Rt(_,"_invoke",(function(R,T,y){var O,v,M,F=0,U=y||[],Q=!1,W={p:0,n:0,v:t,a:H,f:H.bind(t,4),d:function(J,ee){return O=J,v=0,M=t,W.n=ee,o}};function H(z,J){for(v=z,M=J,e=0;!Q&&F&&!ee&&e<U.length;e++){var ee,G=U[e],V=W.p,te=G[2];z>3?(ee=te===J)&&(M=G[(v=G[4])?5:(v=3,3)],G[4]=G[5]=t):G[0]<=V&&((ee=z<2&&V<G[1])?(v=0,W.v=J,W.n=G[1]):V<te&&(ee=z<3||G[0]>J||J>te)&&(G[4]=z,G[5]=J,W.n=te,v=0))}if(ee||z>1)return o;throw Q=!0,J}return function(z,J,ee){if(F>1)throw TypeError("Generator is already running");for(Q&&J===1&&H(J,ee),v=J,M=ee;(e=v<2?t:M)||!Q;){O||(v?v<3?(v>1&&(W.n=-1),H(v,M)):W.n=M:W.v=M);try{if(F=2,O){if(v||(z="next"),e=O[z]){if(!(e=e.call(O,M)))throw TypeError("iterator result is not an object");if(!e.done)return e;M=e.value,v<2&&(v=0)}else v===1&&(e=O.return)&&e.call(O),v<2&&(M=TypeError("The iterator does not provide a '"+z+"' method"),v=1);O=t}else if((e=(Q=W.n<0)?M:R.call(T,W))!==o)break}catch(G){O=t,v=1,M=G}finally{F=1}}return{value:e,done:Q}}})(g,S,b),!0),_}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 m(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,f):(g.__proto__=f,Rt(g,i,"GeneratorFunction")),g.prototype=Object.create(d),g}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=hg=function(){return{w:s,m}},Ht.exports.__esModule=!0,Ht.exports.default=Ht.exports)()}Ht.exports=hg,Ht.exports.__esModule=!0,Ht.exports.default=Ht.exports});var Nu=j((MW,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=j((HW,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 dg=j((e4,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 pg=j((c4,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 yg=j((_4,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 bg=j((R4,Vt)=>{A();x();I();var TA=Ru(),PA=Cu(),OA=dg(),RA=qu(),kA=Nu(),CA=pg(),gg=yg();function Lu(){"use strict";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,m){return c(f.a,i[d],m)},delegateYield:function(d,m,g){return a.resultName=m,c(f.d,gg(d),g)},finish:function(d){return c(f.f,d)}},c=function(d,m,g){f.p=a.prev,f.n=a.next;try{return d(m,g)}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,m){return(n(f)?RA:OA)(s(c),f,h,d,m)},keys:CA,values:gg}},Vt.exports.__esModule=!0,Vt.exports.default=Vt.exports)()}Vt.exports=Lu,Vt.exports.__esModule=!0,Vt.exports.default=Vt.exports});var mg=j((j4,wg)=>{A();x();I();var $o=bg()();wg.exports=$o;try{regeneratorRuntime=$o}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=$o:Function("r","regeneratorRuntime = r")($o)}});var vg=j((Ho,_g)=>{A();x();I();(function(t,e){typeof Ho=="object"&&typeof _g<"u"?e(Ho,Pu(),rg(),lg(),fg(),mg()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.brokerFactory={},t.fastUniqueNumbers,t._defineProperty,t._slicedToArray,t._asyncToGenerator,t._regeneratorRuntime))})(Ho,(function(t,e,r,n,i,s){"use strict";function o(S,b){var w=Object.keys(S);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(S);b&&(_=_.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),w.push.apply(w,_)}return w}function a(S){for(var b=1;b<arguments.length;b++){var w=arguments[b]!=null?arguments[b]:{};b%2?o(Object(w),!0).forEach(function(_){r(S,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(w)):o(Object(w)).forEach(function(_){Object.defineProperty(S,_,Object.getOwnPropertyDescriptor(w,_))})}return S}var c=function(b,w,_,R){return function(T){var y=w(T);return function(O){var v=b(O);O.addEventListener("message",function(ee){var G=ee.data,V=G.id;if(V!==null&&v.has(V)){var te=v.get(V),Y=te.reject,X=te.resolve;v.delete(V),G.error===void 0?X(G.result):Y(new Error(G.error.message))}}),R(O)&&O.start();for(var M=function(G){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Y,X){var ce=_(v);v.set(ce,{reject:X,resolve:Y}),V===null?O.postMessage({id:ce,method:G},te):O.postMessage({id:ce,method:G,params:V},te)})},F=function(G,V){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];O.postMessage({id:null,method:G,params:V},te)},U={},Q=0,W=Object.entries(y);Q<W.length;Q++){var H=n(W[Q],2),z=H[0],J=H[1];U=a(a({},U),{},r({},z,J({call:M,notify:F})))}return a({},U)}}},f=function(b){return function(w){if(b.has(w))return b.get(w);var _=new Map;return b.set(w,_),_}};function h(S,b){var w=Object.keys(S);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(S);b&&(_=_.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),w.push.apply(w,_)}return w}function d(S){for(var b=1;b<arguments.length;b++){var w=arguments[b]!=null?arguments[b]:{};b%2?h(Object(w),!0).forEach(function(_){r(S,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(w)):h(Object(w)).forEach(function(_){Object.defineProperty(S,_,Object.getOwnPropertyDescriptor(w,_))})}return S}var m=function(b){return function(w){return d(d({},w),{},{connect:function(R){var T=R.call;return i(s.mark(function y(){var O,v,M,F;return s.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return O=new MessageChannel,v=O.port1,M=O.port2,U.next=1,T("connect",{port:v},[v]);case 1:return F=U.sent,b.set(M,F),U.abrupt("return",M);case 2:case"end":return U.stop()}},y)}))},disconnect:function(R){var T=R.call;return(function(){var y=i(s.mark(function O(v){var M;return s.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(M=b.get(v),M!==void 0){F.next=1;break}throw new Error("The given port is not connected.");case 1:return F.next=2,T("disconnect",{portId:M});case 2:case"end":return F.stop()}},O)}));return function(O){return y.apply(this,arguments)}})()},isSupported:function(R){var T=R.call;return function(){return T("isSupported")}}})}},g=function(b){return typeof b.start=="function"},P=c(f(new WeakMap),m(new WeakMap),e.generateUniqueNumber,g);t.createBroker=P}))});var Eg=j((Vo,Sg)=>{A();x();I();(function(t,e){typeof Vo=="object"&&typeof Sg<"u"?e(Vo,vg(),Pu(),Xn()):typeof define=="function"&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t.brokerFactory,t.fastUniqueNumbers,t._typeof))})(Vo,(function(t,e,r,n){"use strict";var i=function(w){return function(_){return function(R){n(w.get(R))==="symbol"&&(w.set(R,null),_(R).then(function(){w.delete(R)}))}}},s=function(w){return function(_){return function(R){n(w.get(R))==="symbol"&&(w.set(R,null),_(R).then(function(){w.delete(R)}))}}},o=function(w,_){return function(R){return function(T){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),M=2;M<O;M++)v[M-2]=arguments[M];var F=Symbol(),U=w(_);_.set(U,F);var Q=function(){return R(y,U).then(function(){var H=_.get(U);if(H===void 0)throw new Error("The timer is in an undefined state.");H===F&&(T.apply(void 0,v),_.get(U)===F&&Q())})};return Q(),U}}},a=function(w,_){return function(R){return function(T){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),M=2;M<O;M++)v[M-2]=arguments[M];var F=Symbol(),U=w(_);return _.set(U,F),R(y,U).then(function(){var Q=_.get(U);if(Q===void 0)throw new Error("The timer is in an undefined state.");Q===F&&(_.delete(U),T.apply(void 0,v))}),U}}},c=new Map([[0,null]]),f=new Map([[0,null]]),h=i(c),d=s(f),m=o(r.generateUniqueNumber,c),g=a(r.generateUniqueNumber,f),P=e.createBroker({clearInterval:function(w){var _=w.call;return h(function(R){return _("clear",{timerId:R,timerType:"interval"})})},clearTimeout:function(w){var _=w.call;return d(function(R){return _("clear",{timerId:R,timerType:"timeout"})})},setInterval:function(w){var _=w.call;return m(function(R,T){return _("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:T,timerType:"interval"})})},setTimeout:function(w){var _=w.call;return g(function(R,T){return _("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:T,timerType:"timeout"})})}}),S=function(w){var _=new Worker(w);return P(_)};t.load=S,t.wrap=P}))});var Ig=j((Go,Ag)=>{A();x();I();(function(t,e){typeof Go=="object"&&typeof Ag<"u"?e(Go,Eg()):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){"use strict";var r=function(h,d){var m=null;return function(){if(m!==null)return m;var g=new Blob([d],{type:"application/javascript; charset=utf-8"}),P=URL.createObjectURL(g);return m=h(P),setTimeout(function(){return URL.revokeObjectURL(P)}),m}},n=`(()=>{var e={389(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)},623(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))},472(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))},172(e){e.exports=function(e,t){this.v=e,this.k=t},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},987(e){e.exports=function(e){if(Array.isArray(e))return e},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},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},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},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},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},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},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},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){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(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},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},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},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},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},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},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},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},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)}}},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=j(Fr=>{"use strict";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&&N?.versions?!Object.prototype.hasOwnProperty.call(N.versions,"electron"):typeof window.document<"u":!1,xg=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),Tg=()=>typeof navigator<"u"&&navigator.product==="ReactNative",MA=BA()||xg()||Tg();Fr.isWebWorker=xg();Fr.isReactNativeBrowser=Tg();Fr.default=MA});var kg=j(Gt=>{"use strict";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 Pg=Ig(),Uu=LA(yi()),Og={set:Pg.setInterval,clear:Pg.clearInterval},Rg={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},UA=t=>{switch(t){case"native":return Rg;case"worker":return Og;case"auto":default:return Uu.default&&!Uu.isWebWorker&&!Uu.isReactNativeBrowser?Og:Rg}};Gt.default=UA});var ju=j(gi=>{"use strict";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(kg()),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=j(yt=>{"use strict";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}),qg=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(ay()),$A=or(),Cg=fr(fy()),HA=fr(At()),Bg=qg(Na()),vn=fr(Ua()),VA=fr(Qy()),GA=fr(Iu()),zA=fr(Yy()),bi=Mr(),KA=Jy(),QA=fr(ju()),Mg=qg(yi()),Wu=globalThis.setImmediate||((...t)=>{let e=t.shift();(0,bi.nextTick)(()=>{e(...t)})}),Ng={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 Ng)typeof this.options[n]>"u"?this.options[n]=Ng[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),Mg.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",Mg.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 m=()=>{let g=0;if((a===1||a===2)&&(g=this._nextId(),g===null))return this.log("No messageId left"),!1;let P={cmd:"publish",topic:e,payload:r,qos:a,retain:c,messageId:g,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||!m())&&this._storeProcessingQueue.push({invoke:m,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=Bg.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,S)=>{if(S=S||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,P)||this._resubscribeTopics[P].qos<S.qos||s){let b={topic:P,qos:S.qos};i===5&&(b.nl=S.nl,b.rap=S.rap,b.rh=S.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 m=(P,S)=>{let b={cmd:"subscribe",subscriptions:P,messageId:S};if(f&&(b.properties=f),this.options.resubscribe){this.log("subscribe :: resubscribe true");let _=[];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,_.push(R.topic)}}),this.messageIdToTopic[b.messageId]=_}let w=new Promise((_,R)=>{this.outgoing[b.messageId]={volatile:!0,cb(T,y){if(!T){let{granted:O}=y;for(let v=0;v<O.length;v+=1)P[v].qos=O[v]}T?R(new bi.ErrorWithSubackPacket(T.message,y)):_(y)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(b),w},g=()=>{let P=this.options.subscribeBatchSize??h.length,S=[];for(let b=0;b<h.length;b+=P){let w=h.slice(b,b+P),_=this._nextId();if(_===null)return this.log("No messageId left"),!1;S.push(m(w,_))}return Promise.all(S).then(b=>{n(null,h,b.at(-1))}).catch(b=>{n(b,h,b.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,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=Bg.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,Cg.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,Cg.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 Lg=j(Vu=>{"use strict";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(Ug)return Gu;Ug=!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,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=e-r,P=Math.floor,S=String.fromCharCode;function b(H){throw new RangeError(m[H])}function w(H,z){let J=[],ee=H.length;for(;ee--;)J[ee]=z(H[ee]);return J}function _(H,z){let J=H.split("@"),ee="";J.length>1&&(ee=J[0]+"@",H=J[1]),H=H.replace(d,".");let G=H.split("."),V=w(G,z).join(".");return ee+V}function R(H){let z=[],J=0,ee=H.length;for(;J<ee;){let G=H.charCodeAt(J++);if(G>=55296&&G<=56319&&J<ee){let V=H.charCodeAt(J++);(V&64512)==56320?z.push(((G&1023)<<10)+(V&1023)+65536):(z.push(G),J--)}else z.push(G)}return z}let T=H=>String.fromCodePoint(...H),y=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,z){return H+22+75*(H<26)-((z!=0)<<5)},v=function(H,z,J){let ee=0;for(H=J?P(H/s):H>>1,H+=P(H/z);H>g*n>>1;ee+=e)H=P(H/g);return P(ee+(g+1)*H/(H+i))},M=function(H){let z=[],J=H.length,ee=0,G=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"),z.push(H.charCodeAt(Y));for(let Y=te>0?te+1:0;Y<J;){let X=ee;for(let Z=1,ne=e;;ne+=e){Y>=J&&b("invalid-input");let he=y(H.charCodeAt(Y++));he>=e&&b("invalid-input"),he>P((t-ee)/Z)&&b("overflow"),ee+=he*Z;let be=ne<=V?r:ne>=V+n?n:ne-V;if(he<be)break;let ye=e-be;Z>P(t/ye)&&b("overflow"),Z*=ye}let ce=z.length+1;V=v(ee-X,ce,X==0),P(ee/ce)>t-G&&b("overflow"),G+=P(ee/ce),ee%=ce,z.splice(ee++,0,G)}return String.fromCodePoint(...z)},F=function(H){let z=[];H=R(H);let J=H.length,ee=a,G=0,V=o;for(let X of H)X<128&&z.push(S(X));let te=z.length,Y=te;for(te&&z.push(c);Y<J;){let X=t;for(let Z of H)Z>=ee&&Z<X&&(X=Z);let ce=Y+1;X-ee>P((t-G)/ce)&&b("overflow"),G+=(X-ee)*ce,ee=X;for(let Z of H)if(Z<ee&&++G>t&&b("overflow"),Z===ee){let ne=G;for(let he=e;;he+=e){let be=he<=V?r:he>=V+n?n:he-V;if(ne<be)break;let ye=ne-be,Ae=e-be;z.push(S(O(be+ye%Ae,0))),ne=P(ye/Ae)}z.push(S(O(ne,0))),V=v(G,ce,Y===te),G=0,++Y}++G,++ee}return z.join("")};return Gu={version:"2.3.1",ucs2:{decode:R,encode:T},decode:M,encode:F,toASCII:function(H){return _(H,function(z){return h.test(z)?"xn--"+F(z):z})},toUnicode:function(H){return _(H,function(z){return f.test(z)?M(z.slice(4).toLowerCase()):z})}},Gu}var Gu,Ug,hr,m5,_5,v5,S5,E5,A5,Dg=ze(()=>{A();x();I();Gu={},Ug=!1;hr=JA(),m5=hr.decode,_5=hr.encode,v5=hr.toASCII,S5=hr.toUnicode,E5=hr.ucs2,A5=hr.version});function XA(){return jg||(jg=!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 Fg||(Fg=!0,Ku=Error),Ku}function eI(){return Wg||(Wg=!0,Qu=EvalError),Qu}function tI(){return $g||($g=!0,Yu=RangeError),Yu}function rI(){return Hg||(Hg=!0,Ju=ReferenceError),Ju}function ab(){return Vg||(Vg=!0,Xu=SyntaxError),Xu}function Sn(){return Gg||(Gg=!0,Zu=TypeError),Zu}function nI(){return zg||(zg=!0,el=URIError),el}function iI(){if(Kg)return tl;Kg=!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(Qg)return rl;Qg=!0;var t={__proto__:null,foo:{}},e=Object;return rl=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},rl}function sI(){if(Yg)return nl;Yg=!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 m=0;m<f.length;m+=1)h[m+c.length]=f[m];return h},s=function(c,f){for(var h=[],d=f,m=0;d<c.length;d+=1,m+=1)h[m]=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,m=function(){if(this instanceof d){var w=f.apply(this,i(h,arguments));return Object(w)===w?w:this}return f.apply(c,i(h,arguments))},g=r(0,f.length-h.length),P=[],S=0;S<g;S++)P[S]="$"+S;if(d=Function("binder","return function ("+o(P,",")+"){ return binder.apply(this,arguments); }")(m),f.prototype){var b=function(){};b.prototype=f.prototype,d.prototype=new b,b.prototype=null}return d},nl}function dl(){if(Jg)return il;Jg=!0;var t=sI();return il=Function.prototype.bind||t,il}function aI(){if(Xg)return ol;Xg=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=dl();return ol=r.call(t,e),ol}function Wr(){if(Zg)return sl;Zg=!0;var t,e=ZA(),r=eI(),n=tI(),i=rI(),s=ab(),o=Sn(),a=nI(),c=Function,f=function(G){try{return c('"use strict"; return ('+G+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var d=function(){throw new o},m=h?(function(){try{return arguments.callee,d}catch{try{return h(arguments,"callee").get}catch{return d}}})():d,g=iI()(),P=oI()(),S=Object.getPrototypeOf||(P?function(G){return G.__proto__}:null),b={},w=typeof Uint8Array>"u"||!S?t:S(Uint8Array),_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":g&&S?S([][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%":g&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!S?t:S(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"||!g||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&S?S(""[Symbol.iterator]()):t,"%Symbol%":g?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":w,"%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(S)try{null.error}catch(G){var R=S(S(G));_["%Error.prototype%"]=R}var T=function G(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=G("%AsyncGeneratorFunction%");Y&&(te=Y.prototype)}else if(V==="%AsyncIteratorPrototype%"){var X=G("%AsyncGenerator%");X&&S&&(te=S(X.prototype))}return _[V]=te,te},y={__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(),v=aI(),M=O.call(Function.call,Array.prototype.concat),F=O.call(Function.apply,Array.prototype.splice),U=O.call(Function.call,String.prototype.replace),Q=O.call(Function.call,String.prototype.slice),W=O.call(Function.call,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,J=function(V){var te=Q(V,0,1),Y=Q(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 X=[];return U(V,H,function(ce,Z,ne,he){X[X.length]=ne?U(he,z,"$1"):Z||ce}),X},ee=function(V,te){var Y=V,X;if(v(y,Y)&&(X=y[Y],Y="%"+X[0]+"%"),v(_,Y)){var ce=_[Y];if(ce===b&&(ce=T(Y)),typeof ce>"u"&&!te)throw new o("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:X,name:Y,value:ce}}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=J(V),X=Y.length>0?Y[0]:"",ce=ee("%"+X+"%",te),Z=ce.name,ne=ce.value,he=!1,be=ce.alias;be&&(X=be[0],F(Y,M([0,1],be)));for(var ye=1,Ae=!0;ye<Y.length;ye+=1){var _e=Y[ye],ve=Q(_e,0,1),Oe=Q(_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)&&(he=!0),X+="."+_e,Z="%"+X+"%",v(_,Z))ne=_[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=v(ne,_e),ne=ne[_e];Ae&&!he&&(_[Z]=ne)}}return ne},sl}function pl(){if(eb)return al;eb=!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 ub(){if(tb)return ul;tb=!0;var t=Wr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return ul=e,ul}function uI(){if(rb)return ll;rb=!0;var t=pl(),e=ab(),r=Sn(),n=ub();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,m=!!n&&n(s,o);if(t)t(s,o,{configurable:h===null&&m?m.configurable:!h,enumerable:c===null&&m?m.enumerable:!c,value:a,writable:f===null&&m?m.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(nb)return cl;nb=!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(ib)return fl;ib=!0;var t=Wr(),e=uI(),r=lI()(),n=ub(),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 m=n(a,"length");m&&!m.configurable&&(h=!1),m&&!m.writable&&(d=!1)}return(h||d||!f)&&(r?e(a,"length",c,!0,!0):e(a,"length",c)),a},fl}function fI(){if(ob)return wi;ob=!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 m=o(t,s,arguments);return r(m,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 lb(){if(sb)return hl;sb=!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,jg,Ku,Fg,Qu,Wg,Yu,$g,Ju,Hg,Xu,Vg,Zu,Gg,el,zg,tl,Kg,rl,Qg,nl,Yg,il,Jg,ol,Xg,sl,Zg,al,eb,ul,tb,ll,rb,cl,nb,fl,ib,wi,ob,hl,sb,cb=ze(()=>{A();x();I();zu={},jg=!1;Ku={},Fg=!1;Qu={},Wg=!1;Yu={},$g=!1;Ju={},Hg=!1;Xu={},Vg=!1;Zu={},Gg=!1;el={},zg=!1;tl={},Kg=!1;rl={},Qg=!1;nl={},Yg=!1;il={},Jg=!1;ol={},Xg=!1;sl={},Zg=!1;al={},eb=!1;ul={},tb=!1;ll={},rb=!1;cl={},nb=!1;fl={},ib=!1;wi={},ob=!1;hl={},sb=!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&&fb())}function fb(){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 hb(t,e)),zt.length===1&&!En&&setTimeout(fb,0)}function hb(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;hb.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(db)return Sl;db=!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,m=0;m<=s.length;++m){if(m<s.length)d=s.charCodeAt(m);else{if(d===47)break;d=47}if(d===47){if(!(f===m-1||h===1))if(f!==m-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 g=a.lastIndexOf("/");if(g!==a.length-1){g===-1?(a="",c=0):(a=a.slice(0,g),c=a.length-1-a.lastIndexOf("/")),f=m,h=0;continue}}else if(a.length===2||a.length===1){a="",c=0,f=m,h=0;continue}}o&&(a.length>0?a+="/..":a="..",c=2)}else a.length>0?a+="/"+s.slice(f+1,m):a=s.slice(f+1,m),c=m-f-1;f=m,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 m=a.length,g=m-d,P=h<g?h:g,S=-1,b=0;b<=P;++b){if(b===P){if(g>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?S=b:b===0&&(S=0));break}var w=o.charCodeAt(c+b),_=a.charCodeAt(d+b);if(w!==_)break;w===47&&(S=b)}var R="";for(b=c+S+1;b<=f;++b)(b===f||o.charCodeAt(b)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+a.slice(d+S):(d+=S,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 m=a.length-1,g=-1;for(d=o.length-1;d>=0;--d){var P=o.charCodeAt(d);if(P===47){if(!h){c=d+1;break}}else g===-1&&(h=!1,g=d+1),m>=0&&(P===a.charCodeAt(m)?--m===-1&&(f=d):(m=-1,f=g))}return c===f?f=g: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,m=o.length-1;m>=0;--m){var g=o.charCodeAt(m);if(g===47){if(!h){c=m+1;break}continue}f===-1&&(h=!1,f=m+1),g===46?a===-1?a=m: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,m=0,g=-1,P=!0,S=o.length-1,b=0;S>=h;--S){if(c=o.charCodeAt(S),c===47){if(!P){m=S+1;break}continue}g===-1&&(P=!1,g=S+1),c===46?d===-1?d=S:b!==1&&(b=1):d!==-1&&(b=-1)}return d===-1||g===-1||b===0||b===1&&d===g-1&&d===m+1?g!==-1&&(m===0&&f?a.base=a.name=o.slice(1,g):a.base=a.name=o.slice(m,g)):(m===0&&f?(a.name=o.slice(1,d),a.base=o.slice(1,g)):(a.name=o.slice(m,d),a.base=o.slice(m,g)),a.ext=o.slice(d,g)),m>0?a.dir=o.slice(0,m-1):f&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Sl=i,Sl}var Sl,db,El,pb=ze(()=>{A();x();I();vl();Sl={},db=!1;El=xx()});var xb={};Kr(xb,{URL:()=>jx,Url:()=>Nx,default:()=>Ge,fileURLToPath:()=>Ab,format:()=>qx,parse:()=>Dx,pathToFileURL:()=>Ib,resolve:()=>Lx,resolveObject:()=>Ux});function Px(){if(yb)return Al;yb=!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,m=typeof WeakRef=="function"&&WeakRef.prototype,g=m?WeakRef.prototype.deref:null,P=Boolean.prototype.valueOf,S=Object.prototype.toString,b=Function.prototype.toString,w=String.prototype.match,_=String.prototype.slice,R=String.prototype.replace,T=String.prototype.toUpperCase,y=String.prototype.toLowerCase,O=RegExp.prototype.test,v=Array.prototype.concat,M=Array.prototype.join,F=Array.prototype.slice,U=Math.floor,Q=typeof BigInt=="function"?BigInt.prototype.valueOf:null,W=Object.getOwnPropertySymbols,H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,z=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===z||!0)?Symbol.toStringTag:null,ee=Object.prototype.propertyIsEnumerable,G=(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?-U(-k):U(k);if(ie!==k){var oe=String(ie),fe=_.call(B,oe.length+1);return R.call(oe,re,"$&_")+"."+R.call(R.call(fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(B,re,"$&_")}var te=Tx,Y=te.custom,X=Oe(Y)?Y:null;Al=function k(B,re,ie,oe){var fe=re||{};if(Re(fe,"quoteStyle")&&fe.quoteStyle!=="single"&&fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(fe,"maxStringLength")&&(typeof fe.maxStringLength=="number"?fe.maxStringLength<0&&fe.maxStringLength!==1/0:fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Qt=Re(fe,"customInspect")?fe.customInspect:!0;if(typeof Qt!="boolean"&&Qt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(fe,"indent")&&fe.indent!==null&&fe.indent!==" "&&!(parseInt(fe.indent,10)===fe.indent&&fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(fe,"numericSeparator")&&typeof fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var br=fe.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,fe);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 fe.depth>"u"?5:fe.depth;if(typeof ie>"u"&&(ie=0),ie>=es&&es>0&&typeof B=="object")return ne(B)?"[Array]":"[Object]";var Gr=C(fe,ie);if(typeof oe>"u")oe=[];else if(Bt(oe,B)>=0)return"[Circular]";function ut(zr,Ti,Qb){if(Ti&&(oe=F.call(oe),oe.push(Ti)),Qb){var sc={depth:fe.depth};return Re(fe,"quoteStyle")&&(sc.quoteStyle=fe.quoteStyle),k(zr,sc,ie+1,oe)}return k(zr,fe,ie+1,oe)}if(typeof B=="function"&&!be(B)){var Zl=Ct(B),ec=$(B,ut);return"[Function"+(Zl?": "+Zl:" (anonymous)")+"]"+(ec.length>0?" { "+M.call(ec,", ")+" }":"")}if(Oe(B)){var tc=z?R.call(String(B),/^(Symbol\(.*\))_[^)]*$/,"$1"):H.call(B);return typeof B=="object"&&!z?p(tc):tc}if(Xo(B)){for(var Pn="<"+y.call(String(B.nodeName)),ts=B.attributes||[],xi=0;xi<ts.length;xi++)Pn+=" "+ts[xi].name+"="+ce(Z(ts[xi].value),"double",fe);return Pn+=">",B.childNodes&&B.childNodes.length&&(Pn+="..."),Pn+="</"+y.call(String(B.nodeName))+">",Pn}if(ne(B)){if(B.length===0)return"[]";var rs=$(B,ut);return Gr&&!E(rs)?"["+q(rs,Gr)+"]":"[ "+M.call(rs,", ")+" ]"}if(ye(B)){var ns=$(B,ut);return!("cause"in Error.prototype)&&"cause"in B&&!ee.call(B,"cause")?"{ ["+String(B)+"] "+M.call(v.call("[cause]: "+ut(B.cause),ns),", ")+" }":ns.length===0?"["+String(B)+"]":"{ ["+String(B)+"] "+M.call(ns,", ")+" }"}if(typeof B=="object"&&Qt){if(X&&typeof B[X]=="function"&&te)return te(B,{depth:es-ie});if(Qt!=="symbol"&&typeof B.inspect=="function")return B.inspect()}if(xn(B)){var rc=[];return n&&n.call(B,function(zr,Ti){rc.push(ut(Ti,B,!0)+" => "+ut(zr,B))}),l("Map",r.call(B),rc,Gr)}if(Ze(B)){var nc=[];return a&&a.call(B,function(zr){nc.push(ut(zr,B))}),l("Set",o.call(B),nc,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(Q.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(!he(B)&&!be(B)){var is=$(B,ut),ic=G?G(B)===Object.prototype:B instanceof Object||B.constructor===Object,os=B instanceof Object?"":"null prototype",oc=!ic&&J&&Object(B)===B&&J in B?_.call(Ne(B),8,-1):os?"Object":"",Kb=ic||typeof B.constructor!="function"?"":B.constructor.name?B.constructor.name+" ":"",ss=Kb+(oc||os?"["+M.call(v.call([],oc||[],os||[]),": ")+"] ":"");return is.length===0?ss+"{}":Gr?ss+"{"+q(is,Gr)+"}":ss+"{ "+M.call(is,", ")+" }"}return String(B)};function ce(k,B,re){var ie=(re.quoteStyle||B)==="double"?'"':"'";return ie+k+ie}function Z(k){return R.call(String(k),/"/g,"&quot;")}function ne(k){return Ne(k)==="[object Array]"&&(!J||!(typeof k=="object"&&J in k))}function he(k){return Ne(k)==="[object Date]"&&(!J||!(typeof k=="object"&&J in k))}function be(k){return Ne(k)==="[object RegExp]"&&(!J||!(typeof k=="object"&&J in k))}function ye(k){return Ne(k)==="[object Error]"&&(!J||!(typeof k=="object"&&J in k))}function Ae(k){return Ne(k)==="[object String]"&&(!J||!(typeof k=="object"&&J in k))}function _e(k){return Ne(k)==="[object Number]"&&(!J||!(typeof k=="object"&&J in k))}function ve(k){return Ne(k)==="[object Boolean]"&&(!J||!(typeof k=="object"&&J in k))}function Oe(k){if(z)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"||!Q)return!1;try{return Q.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 S.call(k)}function Ct(k){if(k.name)return k.name;var B=w.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(!g||!k||typeof k!="object")return!1;try{return g.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(_.call(k,0,B.maxStringLength),B)+ie}var oe=R.call(R.call(k,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Zo);return ce(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?q(re,ie):M.call(re,", ");return k+" ("+B+") {"+oe+"}"}function E(k){for(var B=0;B<k.length;B++)if(Bt(k[B],`
4
- `)>=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=M.call(Array(k.indent+1)," ");else return null;return{base:re,prev:M.call(Array(B+1),re)}}function q(k,B){if(k.length===0)return"";var re=`
5
- `+B.prev+B.base;return re+M.call(k,","+re)+`
6
- `+B.prev}function $(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 fe=typeof W=="function"?W(k):[],Qt;if(z){Qt={};for(var br=0;br<fe.length;br++)Qt["$"+fe[br]]=fe[br]}for(var Ye in k)Re(k,Ye)&&(re&&String(Number(Ye))===Ye&&Ye<k.length||z&&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<fe.length;Yt++)ee.call(k,fe[Yt])&&ie.push("["+B(fe[Yt])+"]: "+B(k[fe[Yt]],k));return ie}return Al}function Ox(){if(gb)return xl;gb=!0;var t=Wr(),e=lb(),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),m=function(b,w){for(var _=b,R;(R=_.next)!==null;_=R)if(R.key===w)return _.next=R.next,R.next=b.next,b.next=R,R},g=function(b,w){var _=m(b,w);return _&&_.value},P=function(b,w,_){var R=m(b,w);R?R.value=_:b.next={key:w,next:b.next,value:_}},S=function(b,w){return!!m(b,w)};return xl=function(){var w,_,R,T={assert:function(y){if(!T.has(y))throw new n("Side channel does not contain "+r(y))},get:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(w)return o(w,y)}else if(s){if(_)return f(_,y)}else if(R)return g(R,y)},has:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(w)return c(w,y)}else if(s){if(_)return d(_,y)}else if(R)return S(R,y);return!1},set:function(y,O){i&&y&&(typeof y=="object"||typeof y=="function")?(w||(w=new i),a(w,y,O)):s?(_||(_=new s),h(_,y,O)):(R||(R={key:{},next:null}),P(R,y,O))}};return T},xl}function Bl(){if(bb)return Tl;bb=!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 Eb(){if(wb)return Pl;wb=!0;var t=Bl(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=(function(){for(var b=[],w=0;w<256;++w)b.push("%"+((w<16?"0":"")+w.toString(16)).toUpperCase());return b})(),i=function(w){for(;w.length>1;){var _=w.pop(),R=_.obj[_.prop];if(r(R)){for(var T=[],y=0;y<R.length;++y)typeof R[y]<"u"&&T.push(R[y]);_.obj[_.prop]=T}}},s=function(w,_){for(var R=_&&_.plainObjects?Object.create(null):{},T=0;T<w.length;++T)typeof w[T]<"u"&&(R[T]=w[T]);return R},o=function b(w,_,R){if(!_)return w;if(typeof _!="object"){if(r(w))w.push(_);else if(w&&typeof w=="object")(R&&(R.plainObjects||R.allowPrototypes)||!e.call(Object.prototype,_))&&(w[_]=!0);else return[w,_];return w}if(!w||typeof w!="object")return[w].concat(_);var T=w;return r(w)&&!r(_)&&(T=s(w,R)),r(w)&&r(_)?(_.forEach(function(y,O){if(e.call(w,O)){var v=w[O];v&&typeof v=="object"&&y&&typeof y=="object"?w[O]=b(v,y,R):w.push(y)}else w[O]=y}),w):Object.keys(_).reduce(function(y,O){var v=_[O];return e.call(y,O)?y[O]=b(y[O],v,R):y[O]=v,y},T)},a=function(w,_){return Object.keys(_).reduce(function(R,T){return R[T]=_[T],R},w)},c=function(b,w,_){var R=b.replace(/\+/g," ");if(_==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},f=1024,h=function(w,_,R,T,y){if(w.length===0)return w;var O=w;if(typeof w=="symbol"?O=Symbol.prototype.toString.call(w):typeof w!="string"&&(O=String(w)),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 v="",M=0;M<O.length;M+=f){for(var F=O.length>=f?O.slice(M,M+f):O,U=[],Q=0;Q<F.length;++Q){var W=F.charCodeAt(Q);if(W===45||W===46||W===95||W===126||W>=48&&W<=57||W>=65&&W<=90||W>=97&&W<=122||y===t.RFC1738&&(W===40||W===41)){U[U.length]=F.charAt(Q);continue}if(W<128){U[U.length]=n[W];continue}if(W<2048){U[U.length]=n[192|W>>6]+n[128|W&63];continue}if(W<55296||W>=57344){U[U.length]=n[224|W>>12]+n[128|W>>6&63]+n[128|W&63];continue}Q+=1,W=65536+((W&1023)<<10|F.charCodeAt(Q)&1023),U[U.length]=n[240|W>>18]+n[128|W>>12&63]+n[128|W>>6&63]+n[128|W&63]}v+=U.join("")}return v},d=function(w){for(var _=[{obj:{o:w},prop:"o"}],R=[],T=0;T<_.length;++T)for(var y=_[T],O=y.obj[y.prop],v=Object.keys(O),M=0;M<v.length;++M){var F=v[M],U=O[F];typeof U=="object"&&U!==null&&R.indexOf(U)===-1&&(_.push({obj:O,prop:F}),R.push(U))}return i(_),w},m=function(w){return Object.prototype.toString.call(w)==="[object RegExp]"},g=function(w){return!w||typeof w!="object"?!1:!!(w.constructor&&w.constructor.isBuffer&&w.constructor.isBuffer(w))},P=function(w,_){return[].concat(w,_)},S=function(w,_){if(r(w)){for(var R=[],T=0;T<w.length;T+=1)R.push(_(w[T]));return R}return _(w)};return Pl={arrayToObject:s,assign:a,combine:P,compact:d,decode:c,encode:h,isBuffer:g,isRegExp:m,maybeMap:S,merge:o},Pl}function Rx(){if(mb)return Ol;mb=!0;var t=Ox(),e=Eb(),r=Bl(),n=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,w){return b+"["+w+"]"},repeat:function(b){return b}},s=Array.isArray,o=Array.prototype.push,a=function(S,b){o.apply(S,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"},m={},g=function S(b,w,_,R,T,y,O,v,M,F,U,Q,W,H,z,J,ee,G){for(var V=b,te=G,Y=0,X=!1;(te=te.get(m))!==void 0&&!X;){var ce=te.get(b);if(Y+=1,typeof ce<"u"){if(ce===Y)throw new RangeError("Cyclic object value");X=!0}typeof te.get(m)>"u"&&(Y=0)}if(typeof F=="function"?V=F(w,V):V instanceof Date?V=W(V):_==="comma"&&s(V)&&(V=e.maybeMap(V,function(Ne){return Ne instanceof Date?W(Ne):Ne})),V===null){if(y)return M&&!J?M(w,h.encoder,ee,"key",H):w;V=""}if(d(V)||e.isBuffer(V)){if(M){var Z=J?w:M(w,h.encoder,ee,"key",H);return[z(Z)+"="+z(M(V,h.encoder,ee,"value",H))]}return[z(w)+"="+z(String(V))]}var ne=[];if(typeof V>"u")return ne;var he;if(_==="comma"&&s(V))J&&M&&(V=e.maybeMap(V,M)),he=[{value:V.length>0?V.join(",")||null:void 0}];else if(s(F))he=F;else{var be=Object.keys(V);he=U?be.sort(U):be}var ye=v?w.replace(/\./g,"%2E"):w,Ae=R&&s(V)&&V.length===1?ye+"[]":ye;if(T&&s(V)&&V.length===0)return Ae+"[]";for(var _e=0;_e<he.length;++_e){var ve=he[_e],Oe=typeof ve=="object"&&typeof ve.value<"u"?ve.value:V[ve];if(!(O&&Oe===null)){var xe=Q&&v?ve.replace(/\./g,"%2E"):ve,st=s(V)?typeof _=="function"?_(Ae,xe):Ae:Ae+(Q?"."+xe:"["+xe+"]");G.set(b,Y);var Re=t();Re.set(m,G),a(ne,S(Oe,st,_,R,T,y,O,v,_==="comma"&&J&&s(V)?null:M,F,U,Q,W,H,z,J,ee,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 w=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 _=r.default;if(typeof b.format<"u"){if(!n.call(r.formatters,b.format))throw new TypeError("Unknown format option provided.");_=b.format}var R=r.formatters[_],T=h.filter;(typeof b.filter=="function"||s(b.filter))&&(T=b.filter);var y;if(b.arrayFormat in i?y=b.arrayFormat:"indices"in b?y=b.indices?"indices":"repeat":y=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:y,charset:w,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:_,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(S,b){var w=S,_=P(b),R,T;typeof _.filter=="function"?(T=_.filter,w=T("",w)):s(_.filter)&&(T=_.filter,R=T);var y=[];if(typeof w!="object"||w===null)return"";var O=i[_.arrayFormat],v=O==="comma"&&_.commaRoundTrip;R||(R=Object.keys(w)),_.sort&&R.sort(_.sort);for(var M=t(),F=0;F<R.length;++F){var U=R[F];_.skipNulls&&w[U]===null||a(y,g(w[U],U,O,v,_.allowEmptyArrays,_.strictNullHandling,_.skipNulls,_.encodeDotInKeys,_.encode?_.encoder:null,_.filter,_.sort,_.allowDots,_.serializeDate,_.format,_.formatter,_.encodeValuesOnly,_.charset,M))}var Q=y.join(_.delimiter),W=_.addQueryPrefix===!0?"?":"";return _.charsetSentinel&&(_.charset==="iso-8859-1"?W+="utf8=%26%2310003%3B&":W+="utf8=%E2%9C%93&"),Q.length>0?W+Q:""},Ol}function kx(){if(_b)return Rl;_b=!0;var t=Eb(),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(m){return m.replace(/&#(\d+);/g,function(g,P){return String.fromCharCode(parseInt(P,10))})},s=function(m,g){return m&&typeof m=="string"&&g.comma&&m.indexOf(",")>-1?m.split(","):m},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(g,P){var S={__proto__:null},b=P.ignoreQueryPrefix?g.replace(/^\?/,""):g;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=P.parameterLimit===1/0?void 0:P.parameterLimit,_=b.split(P.delimiter,w),R=-1,T,y=P.charset;if(P.charsetSentinel)for(T=0;T<_.length;++T)_[T].indexOf("utf8=")===0&&(_[T]===a?y="utf-8":_[T]===o&&(y="iso-8859-1"),R=T,T=_.length);for(T=0;T<_.length;++T)if(T!==R){var O=_[T],v=O.indexOf("]="),M=v===-1?O.indexOf("="):v+1,F,U;M===-1?(F=P.decoder(O,n.decoder,y,"key"),U=P.strictNullHandling?null:""):(F=P.decoder(O.slice(0,M),n.decoder,y,"key"),U=t.maybeMap(s(O.slice(M+1),P),function(W){return P.decoder(W,n.decoder,y,"value")})),U&&P.interpretNumericEntities&&y==="iso-8859-1"&&(U=i(U)),O.indexOf("[]=")>-1&&(U=r(U)?[U]:U);var Q=e.call(S,F);Q&&P.duplicates==="combine"?S[F]=t.combine(S[F],U):(!Q||P.duplicates==="last")&&(S[F]=U)}return S},f=function(m,g,P,S){for(var b=S?g:s(g,P),w=m.length-1;w>=0;--w){var _,R=m[w];if(R==="[]"&&P.parseArrays)_=P.allowEmptyArrays&&(b===""||P.strictNullHandling&&b===null)?[]:[].concat(b);else{_=P.plainObjects?Object.create(null):{};var T=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,y=P.decodeDotInKeys?T.replace(/%2E/g,"."):T,O=parseInt(y,10);!P.parseArrays&&y===""?_={0:b}:!isNaN(O)&&R!==y&&String(O)===y&&O>=0&&P.parseArrays&&O<=P.arrayLimit?(_=[],_[O]=b):y!=="__proto__"&&(_[y]=b)}b=_}return b},h=function(g,P,S,b){if(g){var w=S.allowDots?g.replace(/\.([^.[]+)/g,"[$1]"):g,_=/(\[[^[\]]*])/,R=/(\[[^[\]]*])/g,T=S.depth>0&&_.exec(w),y=T?w.slice(0,T.index):w,O=[];if(y){if(!S.plainObjects&&e.call(Object.prototype,y)&&!S.allowPrototypes)return;O.push(y)}for(var v=0;S.depth>0&&(T=R.exec(w))!==null&&v<S.depth;){if(v+=1,!S.plainObjects&&e.call(Object.prototype,T[1].slice(1,-1))&&!S.allowPrototypes)return;O.push(T[1])}if(T){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");O.push("["+w.slice(T.index)+"]")}return f(O,P,S,b)}},d=function(g){if(!g)return n;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.decodeDotInKeys<"u"&&typeof g.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(g.decoder!==null&&typeof g.decoder<"u"&&typeof g.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=typeof g.charset>"u"?n.charset:g.charset,S=typeof g.duplicates>"u"?n.duplicates:g.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof g.allowDots>"u"?g.decodeDotInKeys===!0?!0:n.allowDots:!!g.allowDots;return{allowDots:b,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof g.allowPrototypes=="boolean"?g.allowPrototypes:n.allowPrototypes,allowSparse:typeof g.allowSparse=="boolean"?g.allowSparse:n.allowSparse,arrayLimit:typeof g.arrayLimit=="number"?g.arrayLimit:n.arrayLimit,charset:P,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:n.charsetSentinel,comma:typeof g.comma=="boolean"?g.comma:n.comma,decodeDotInKeys:typeof g.decodeDotInKeys=="boolean"?g.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof g.decoder=="function"?g.decoder:n.decoder,delimiter:typeof g.delimiter=="string"||t.isRegExp(g.delimiter)?g.delimiter:n.delimiter,depth:typeof g.depth=="number"||g.depth===!1?+g.depth:n.depth,duplicates:S,ignoreQueryPrefix:g.ignoreQueryPrefix===!0,interpretNumericEntities:typeof g.interpretNumericEntities=="boolean"?g.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof g.parameterLimit=="number"?g.parameterLimit:n.parameterLimit,parseArrays:g.parseArrays!==!1,plainObjects:typeof g.plainObjects=="boolean"?g.plainObjects:n.plainObjects,strictDepth:typeof g.strictDepth=="boolean"?!!g.strictDepth:n.strictDepth,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:n.strictNullHandling}};return Rl=function(m,g){var P=d(g);if(m===""||m===null||typeof m>"u")return P.plainObjects?Object.create(null):{};for(var S=typeof m=="string"?c(m,P):m,b=P.plainObjects?Object.create(null):{},w=Object.keys(S),_=0;_<w.length;++_){var R=w[_],T=h(R,S[R],P,typeof m=="string");b=t.merge(b,T,P)}return P.allowSparse===!0?b:t.compact(b)},Rl}function Cx(){if(vb)return kl;vb=!0;var t=Rx(),e=kx(),r=Bl();return kl={formats:r,parse:e,stringify:t},kl}function Bx(){if(Sb)return Hr;Sb=!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",`
7
- `," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),f=["/","?","#"],h=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=Cx();function w(y,O,v){if(y&&typeof y=="object"&&y instanceof e)return y;var M=new e;return M.parse(y,O,v),M}e.prototype.parse=function(y,O,v){if(typeof y!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof y);var M=y.indexOf("?"),F=M!==-1&&M<y.indexOf("#")?"?":"#",U=y.split(F),Q=/\\/g;U[0]=U[0].replace(Q,"/"),y=U.join(F);var W=y;if(W=W.trim(),!v&&y.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 z=r.exec(W);if(z){z=z[0];var J=z.toLowerCase();this.protocol=J,W=W.substr(z.length)}if(v||z||W.match(/^\/\/[^@/]+@[^@/]+/)){var ee=W.substr(0,2)==="//";ee&&!(z&&P[z])&&(W=W.substr(2),this.slashes=!0)}if(!P[z]&&(ee||z&&!S[z])){for(var G=-1,V=0;V<f.length;V++){var te=W.indexOf(f[V]);te!==-1&&(G===-1||te<G)&&(G=te)}var Y,X;G===-1?X=W.lastIndexOf("@"):X=W.lastIndexOf("@",G),X!==-1&&(Y=W.slice(0,X),W=W.slice(X+1),this.auth=decodeURIComponent(Y)),G=-1;for(var V=0;V<c.length;V++){var te=W.indexOf(c[V]);te!==-1&&(G===-1||te<G)&&(G=te)}G===-1&&(G=W.length),this.host=W.slice(0,G),W=W.slice(G),this.parseHost(),this.hostname=this.hostname||"";var ce=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ce)for(var Z=this.hostname.split(/\./),V=0,ne=Z.length;V<ne;V++){var he=Z[V];if(he&&!he.match(d)){for(var be="",ye=0,Ae=he.length;ye<Ae;ye++)he.charCodeAt(ye)>127?be+="x":be+=he[ye];if(!be.match(d)){var _e=Z.slice(0,V),ve=Z.slice(V+1),Oe=he.match(m);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(),ce||(this.hostname=t.toASCII(this.hostname));var xe=this.port?":"+this.port:"",st=this.hostname||"";this.host=st+xe,this.href+=this.host,ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),W[0]!=="/"&&(W="/"+W))}if(!g[J])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),S[J]&&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 _(y){return typeof y=="string"&&(y=w(y)),y instanceof e?y.format():e.prototype.format.call(y)}e.prototype.format=function(){var y=this.auth||"";y&&(y=encodeURIComponent(y),y=y.replace(/%3A/i,":"),y+="@");var O=this.protocol||"",v=this.pathname||"",M=this.hash||"",F=!1,U="";this.host?F=y+this.host:this.hostname&&(F=y+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(U=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var Q=this.search||U&&"?"+U||"";return O&&O.substr(-1)!==":"&&(O+=":"),this.slashes||(!O||S[O])&&F!==!1?(F="//"+(F||""),v&&v.charAt(0)!=="/"&&(v="/"+v)):F||(F=""),M&&M.charAt(0)!=="#"&&(M="#"+M),Q&&Q.charAt(0)!=="?"&&(Q="?"+Q),v=v.replace(/[?#]/g,function(W){return encodeURIComponent(W)}),Q=Q.replace("#","%23"),O+F+v+Q+M};function R(y,O){return w(y,!1,!0).resolve(O)}e.prototype.resolve=function(y){return this.resolveObject(w(y,!1,!0)).format()};function T(y,O){return y?w(y,!1,!0).resolveObject(O):O}return e.prototype.resolveObject=function(y){if(typeof y=="string"){var O=new e;O.parse(y,!1,!0),y=O}for(var v=new e,M=Object.keys(this),F=0;F<M.length;F++){var U=M[F];v[U]=this[U]}if(v.hash=y.hash,y.href==="")return v.href=v.format(),v;if(y.slashes&&!y.protocol){for(var Q=Object.keys(y),W=0;W<Q.length;W++){var H=Q[W];H!=="protocol"&&(v[H]=y[H])}return S[v.protocol]&&v.hostname&&!v.pathname&&(v.pathname="/",v.path=v.pathname),v.href=v.format(),v}if(y.protocol&&y.protocol!==v.protocol){if(!S[y.protocol]){for(var z=Object.keys(y),J=0;J<z.length;J++){var ee=z[J];v[ee]=y[ee]}return v.href=v.format(),v}if(v.protocol=y.protocol,!y.host&&!P[y.protocol]){for(var ne=(y.pathname||"").split("/");ne.length&&!(y.host=ne.shift()););y.host||(y.host=""),y.hostname||(y.hostname=""),ne[0]!==""&&ne.unshift(""),ne.length<2&&ne.unshift(""),v.pathname=ne.join("/")}else v.pathname=y.pathname;if(v.search=y.search,v.query=y.query,v.host=y.host||"",v.auth=y.auth,v.hostname=y.hostname||y.host,v.port=y.port,v.pathname||v.search){var G=v.pathname||"",V=v.search||"";v.path=G+V}return v.slashes=v.slashes||y.slashes,v.href=v.format(),v}var te=v.pathname&&v.pathname.charAt(0)==="/",Y=y.host||y.pathname&&y.pathname.charAt(0)==="/",X=Y||te||v.host&&y.pathname,ce=X,Z=v.pathname&&v.pathname.split("/")||[],ne=y.pathname&&y.pathname.split("/")||[],he=v.protocol&&!S[v.protocol];if(he&&(v.hostname="",v.port=null,v.host&&(Z[0]===""?Z[0]=v.host:Z.unshift(v.host)),v.host="",y.protocol&&(y.hostname=null,y.port=null,y.host&&(ne[0]===""?ne[0]=y.host:ne.unshift(y.host)),y.host=null),X=X&&(ne[0]===""||Z[0]==="")),Y)v.host=y.host||y.host===""?y.host:v.host,v.hostname=y.hostname||y.hostname===""?y.hostname:v.hostname,v.search=y.search,v.query=y.query,Z=ne;else if(ne.length)Z||(Z=[]),Z.pop(),Z=Z.concat(ne),v.search=y.search,v.query=y.query;else if(y.search!=null){if(he){v.host=Z.shift(),v.hostname=v.host;var be=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;be&&(v.auth=be.shift(),v.hostname=be.shift(),v.host=v.hostname)}return v.search=y.search,v.query=y.query,(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.href=v.format(),v}if(!Z.length)return v.pathname=null,v.search?v.path="/"+v.search:v.path=null,v.href=v.format(),v;for(var ye=Z.slice(-1)[0],Ae=(v.host||y.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(!X&&!ce)for(;_e--;_e)Z.unshift("..");X&&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(he){v.hostname=Oe?"":Z.length?Z.shift():"",v.host=v.hostname;var be=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;be&&(v.auth=be.shift(),v.hostname=be.shift(),v.host=v.hostname)}return X=X||v.host&&Z.length,X&&!Oe&&Z.unshift(""),Z.length>0?v.pathname=Z.join("/"):(v.pathname=null,v.path=null),(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.auth=y.auth||v.auth,v.slashes=v.slashes||y.slashes,v.href=v.format(),v},e.prototype.parseHost=function(){var y=this.host,O=n.exec(y);O&&(O=O[0],O!==":"&&(this.port=O.substr(1)),y=y.substr(0,y.length-O.length)),y&&(this.hostname=y)},Hr.parse=w,Hr.resolve=R,Hr.resolveObject=T,Hr.format=_,Hr.Url=e,Hr}function Ab(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 Ib(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(`
8
- `)&&(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,yb,Il,xl,gb,Tl,bb,Pl,wb,Ol,mb,Rl,_b,kl,vb,Hr,Sb,Ge,Mx,Nx,qx,Lx,Ux,Dx,jx,Fx,Wx,$x,Hx,Cl,Vx,Gx,zx,Kx,Qx,Yx,Tb=ze(()=>{A();x();I();Dg();cb();pb();vl();Tx=Object.freeze(Object.create(null)),Al={},yb=!1,Il=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;xl={},gb=!1;Tl={},bb=!1;Pl={},wb=!1;Ol={},mb=!1;Rl={},_b=!1;kl={},vb=!1;Hr={},Sb=!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=Ib;Ge.fileURLToPath=Ab;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 Ob=j((I9,Pb)=>{"use strict";A();x();I();Pb.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var Qo=j(mi=>{"use strict";A();x();I();Object.defineProperty(mi,"__esModule",{value:!0});mi.BufferedDuplex=void 0;mi.writev=kb;var Zx=or(),Rb=(ke(),me(qe));function kb(t,e){let r=new Array(t.length);for(let n=0;n<t.length;n++)typeof t[n].chunk=="string"?r[n]=Rb.Buffer.from(t[n].chunk,"utf8"):r[n]=t[n].chunk;this._write(Rb.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=kb.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=j(gr=>{"use strict";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)),Cb=ql(Ob()),eT=ql(At()),tT=or(),rT=ql(yi()),Nl=Qo(),yr=(0,eT.default)("mqttjs:ws"),nT=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function Bb(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 Mb(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=Mb(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 Cb.default(e,[n],r.wsOptions),i}function sT(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",n=Bb(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=Mb(e);r.hostname=r.hostname||r.host||"localhost";let n=Bb(r,t),i=oT(t,n,r),s=Cb.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,S,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",m),a.addEventListener("error",g),a.addEventListener("message",P)):(a.onclose=m,a.onerror=g,a.onmessage=P);function h(w,_,R){let T=new tT.Transform({objectMode:w.objectMode});return T._write=_,T._flush=R,T}function d(){yr("WebSocket onOpen"),r instanceof Nl.BufferedDuplex&&r.socketReady()}function m(w){yr("WebSocket onClose",w),r.end(),r.destroy()}function g(w){yr("WebSocket onError",w);let _=new Error("WebSocket error");_.event=w,r.destroy(_)}async function P(w){if(!c||!c.readable||!c.writable)return;let{data:_}=w;_ instanceof ArrayBuffer?_=Yo.Buffer.from(_):_ instanceof Blob?_=Yo.Buffer.from(await new Response(_).arrayBuffer()):_=Yo.Buffer.from(_,"utf8"),c.push(_)}function S(w,_,R){if(a.bufferedAmount>i){setTimeout(S,s,w,_,R);return}o&&typeof w=="string"&&(w=Yo.Buffer.from(w,"utf8"));try{a.send(w)}catch(T){return R(T)}R()}function b(w){a.close(),w()}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=j((cH,Nb)=>{A();x();I();Nb.exports={}});var Fl=j(vi=>{"use strict";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 qb={};Kr(qb,{default:()=>yT});var yT,Lb=ze(()=>{A();x();I();yT={}});var $l=j(Si=>{"use strict";A();x();I();var Wl=Si&&Si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Si,"__esModule",{value:!0});var Ub=(Lb(),me(qb)),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,Ub.connect)({...i,socket:s})}return(0,Ub.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.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=j(Vl=>{"use strict";A();x();I();Object.defineProperty(Vl,"__esModule",{value:!0});var Db=(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=Db.Buffer.from(e):e=Db.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=j(Kl=>{"use strict";A();x();I();Object.defineProperty(Kl,"__esModule",{value:!0});var zl=(ke(),me(qe)),OT=or(),RT=Qo(),Kt,Ei,An,jb=!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(){jb||(jb=!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=j(In=>{"use strict";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=FT;var qT=Jo(At()),LT=Jo((Tb(),me(xb))),UT=Jo(zo()),Yl=Jo(yi());typeof N?.nextTick!="function"&&(N.nextTick=setImmediate);var Fb=(0,qT.default)("mqttjs"),Me=null;function DT(){return typeof location<"u"?location.protocol==="https:"?"wss":"ws":typeof document<"u"&&new URL(document.URL).protocol==="https:"?"wss":"ws"}function jT(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={},o=!i.protocol&&!i.hostname&&i.path?.startsWith("/")&&(Yl.default||e.forceNativeWebSocket);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&&!o)throw new Error("Missing protocol");e.protocol=(e.protocol||DT()).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,jT(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),Yl.default||e.unixSocket?e.socksProxy=void 0:e.socksProxy===void 0&&typeof N<"u"&&(e.socksProxy=N.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={},!Yl.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 FT(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 Xl=j(ge=>{"use strict";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]})),WT=ge&&ge.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$T=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 WT(r,e),r}})(),Jl=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 HT=Ai(Iu());ge.DefaultMessageIdProvider=HT.default;var VT=Ai(Lg());ge.UniqueMessageIdProvider=VT.default;var GT=Ai(Ua());ge.Store=GT.default;var Gb=$T($b());ge.connect=Gb.default;Object.defineProperty(ge,"connectAsync",{enumerable:!0,get:function(){return Gb.connectAsync}});var zT=Ai(ju());ge.KeepaliveManager=zT.default;ge.Client=Vb.default;Jl(zo(),ge);Jl(Mr(),ge);Jl(Na(),ge);var KT=zn();Object.defineProperty(ge,"ReasonCodes",{enumerable:!0,get:function(){return KT.ReasonCodes}})});var ZT=j(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]})),QT=ot&&ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YT=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 QT(r,e),r}})(),JT=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 XT=YT(Xl());ot.default=XT;JT(Xl(),ot)});export default ZT();
1
+ var Ro=Object.defineProperty;var xy=Object.getOwnPropertyDescriptor;var Ty=Object.getOwnPropertyNames;var Py=Object.prototype.hasOwnProperty;var ze=(t,e)=>()=>(t&&(e=t(t=0)),e);var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Mr=(t,e)=>{for(var r in e)Ro(t,r,{get:e[r],enumerable:!0})},Oy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ty(e))!Py.call(t,i)&&i!==r&&Ro(t,i,{get:()=>e[i],enumerable:!(n=xy(e,i))||n.enumerable});return t};var _e=t=>Oy(Ro({},"__esModule",{value:!0}),t);var x=ze(()=>{});var q={};Mr(q,{_debugEnd:()=>zl,_debugProcess:()=>Hl,_events:()=>uc,_eventsCount:()=>lc,_exiting:()=>xl,_fatalExceptions:()=>jl,_getActiveHandles:()=>Rl,_getActiveRequests:()=>Ol,_kill:()=>Cl,_linkedBinding:()=>Al,_maxListeners:()=>ac,_preload_modules:()=>ic,_rawDebug:()=>Sl,_startProfilerIdleNotifier:()=>Gl,_stopProfilerIdleNotifier:()=>Ql,_tickCallback:()=>Vl,abort:()=>Xl,addListener:()=>cc,allowedNodeEnvironmentFlags:()=>Dl,arch:()=>ul,argv:()=>fl,argv0:()=>nc,assert:()=>Ul,binding:()=>yl,browser:()=>vl,chdir:()=>_l,config:()=>Tl,cpuUsage:()=>pi,cwd:()=>ml,debugPort:()=>rc,default:()=>_c,dlopen:()=>Pl,domain:()=>Il,emit:()=>gc,emitWarning:()=>gl,env:()=>cl,execArgv:()=>dl,execPath:()=>tc,exit:()=>Ll,features:()=>Fl,hasUncaughtExceptionCaptureCallback:()=>Wl,hrtime:()=>hi,kill:()=>Nl,listeners:()=>mc,memoryUsage:()=>Bl,moduleLoadList:()=>El,nextTick:()=>ol,off:()=>dc,on:()=>It,once:()=>fc,openStdin:()=>ql,pid:()=>Zl,platform:()=>ll,ppid:()=>ec,prependListener:()=>yc,prependOnceListener:()=>bc,reallyExit:()=>kl,release:()=>wl,removeAllListeners:()=>pc,removeListener:()=>hc,resourceUsage:()=>Ml,setSourceMapsEnabled:()=>oc,setUncaughtExceptionCaptureCallback:()=>$l,stderr:()=>Yl,stdin:()=>Jl,stdout:()=>Kl,title:()=>al,umask:()=>bl,uptime:()=>sc,version:()=>hl,versions:()=>pl});function Mo(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Ry(){!Br||!lr||(Br=!1,lr.length?At=lr.concat(At):di=-1,At.length&&il())}function il(){if(!Br){var t=setTimeout(Ry,0);Br=!0;for(var e=At.length;e;){for(lr=At,At=[];++di<e;)lr&&lr[di].run();di=-1,e=At.length}lr=null,Br=!1,clearTimeout(t)}}function ol(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];At.push(new sl(t,e)),At.length===1&&!Br&&setTimeout(il,0)}function sl(t,e){this.fun=t,this.array=e}function De(){}function Al(t){Mo("_linkedBinding")}function Pl(t){Mo("dlopen")}function Ol(){return[]}function Rl(){return[]}function Ul(t,e){if(!t)throw new Error(e||"assertion error")}function Wl(){return!1}function sc(){return $t.now()/1e3}function hi(t){var e=Math.floor((Date.now()-$t.now())*.001),r=$t.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+=Co)),[n,i]}function It(){return _c}function mc(t){return[]}var At,Br,lr,di,al,ul,ll,cl,fl,dl,hl,pl,gl,yl,bl,ml,_l,wl,vl,Sl,El,Il,xl,Tl,kl,Cl,pi,Ml,Bl,Nl,Ll,ql,Dl,Fl,jl,$l,Vl,Hl,zl,Gl,Ql,Kl,Yl,Jl,Xl,Zl,ec,tc,rc,nc,ic,oc,$t,ko,Co,ac,uc,lc,cc,fc,dc,hc,pc,gc,yc,bc,_c,wc=ze(()=>{x();P();T();At=[],Br=!1,di=-1;sl.prototype.run=function(){this.fun.apply(null,this.array)};al="browser",ul="x64",ll="browser",cl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},fl=["/usr/bin/node"],dl=[],hl="v16.8.0",pl={},gl=function(t,e){console.warn((e?e+": ":"")+t)},yl=function(t){Mo("binding")},bl=function(t){return 0},ml=function(){return"/"},_l=function(t){},wl={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};vl=!0,Sl=De,El=[];Il={},xl=!1,Tl={};kl=De,Cl=De,pi=function(){return{}},Ml=pi,Bl=pi,Nl=De,Ll=De,ql=De,Dl={};Fl={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},jl=De,$l=De;Vl=De,Hl=De,zl=De,Gl=De,Ql=De,Kl=void 0,Yl=void 0,Jl=void 0,Xl=De,Zl=2,ec=1,tc="/bin/usr/node",rc=9229,nc="node",ic=[],oc=De,$t={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};$t.now===void 0&&(ko=Date.now(),$t.timing&&$t.timing.navigationStart&&(ko=$t.timing.navigationStart),$t.now=()=>Date.now()-ko);Co=1e9;hi.bigint=function(t){var e=hi(t);return typeof BigInt>"u"?e[0]*Co+e[1]:BigInt(e[0]*Co)+BigInt(e[1])};ac=10,uc={},lc=0;cc=It,fc=It,dc=It,hc=It,pc=It,gc=De,yc=It,bc=It;_c={version:hl,versions:pl,arch:ul,platform:ll,browser:vl,release:wl,_rawDebug:Sl,moduleLoadList:El,binding:yl,_linkedBinding:Al,_events:uc,_eventsCount:lc,_maxListeners:ac,on:It,addListener:cc,once:fc,off:dc,removeListener:hc,removeAllListeners:pc,emit:gc,prependListener:yc,prependOnceListener:bc,listeners:mc,domain:Il,_exiting:xl,config:Tl,dlopen:Pl,uptime:sc,_getActiveRequests:Ol,_getActiveHandles:Rl,reallyExit:kl,_kill:Cl,cpuUsage:pi,resourceUsage:Ml,memoryUsage:Bl,kill:Nl,exit:Ll,openStdin:ql,allowedNodeEnvironmentFlags:Dl,assert:Ul,features:Fl,_fatalExceptions:jl,setUncaughtExceptionCaptureCallback:$l,hasUncaughtExceptionCaptureCallback:Wl,emitWarning:gl,nextTick:ol,_tickCallback:Vl,_debugProcess:Hl,_debugEnd:zl,_startProfilerIdleNotifier:Gl,_stopProfilerIdleNotifier:Ql,stdout:Kl,stdin:Jl,stderr:Yl,abort:Xl,umask:bl,chdir:_l,cwd:ml,env:cl,title:al,argv:fl,execArgv:dl,pid:Zl,ppid:ec,execPath:tc,debugPort:rc,hrtime:hi,argv0:nc,_preload_modules:ic,setSourceMapsEnabled:oc}});var T=ze(()=>{wc()});function ky(){if(vc)return hn;vc=!0,hn.byteLength=u,hn.toByteArray=f,hn.fromByteArray=_;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 I=y.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=y.indexOf("=");S===-1&&(S=I);var b=S===I?0:4-S%4;return[S,b]}function u(y){var I=o(y),S=I[0],b=I[1];return(S+b)*3/4-b}function c(y,I,S){return(I+S)*3/4-S}function f(y){var I,S=o(y),b=S[0],m=S[1],w=new r(c(y,b,m)),R=0,A=m>0?b-4:b,g;for(g=0;g<A;g+=4)I=e[y.charCodeAt(g)]<<18|e[y.charCodeAt(g+1)]<<12|e[y.charCodeAt(g+2)]<<6|e[y.charCodeAt(g+3)],w[R++]=I>>16&255,w[R++]=I>>8&255,w[R++]=I&255;return m===2&&(I=e[y.charCodeAt(g)]<<2|e[y.charCodeAt(g+1)]>>4,w[R++]=I&255),m===1&&(I=e[y.charCodeAt(g)]<<10|e[y.charCodeAt(g+1)]<<4|e[y.charCodeAt(g+2)]>>2,w[R++]=I>>8&255,w[R++]=I&255),w}function d(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function h(y,I,S){for(var b,m=[],w=I;w<S;w+=3)b=(y[w]<<16&16711680)+(y[w+1]<<8&65280)+(y[w+2]&255),m.push(d(b));return m.join("")}function _(y){for(var I,S=y.length,b=S%3,m=[],w=16383,R=0,A=S-b;R<A;R+=w)m.push(h(y,R,R+w>A?A:R+w));return b===1?(I=y[S-1],m.push(t[I>>2]+t[I<<4&63]+"==")):b===2&&(I=(y[S-2]<<8)+y[S-1],m.push(t[I>>10]+t[I>>4&63]+t[I<<2&63]+"=")),m.join("")}return hn}function Cy(){if(Sc)return gi;Sc=!0;return gi.read=function(t,e,r,n,i){var s,o,u=i*8-n-1,c=(1<<u)-1,f=c>>1,d=-7,h=r?i-1:0,_=r?-1:1,y=t[e+h];for(h+=_,s=y&(1<<-d)-1,y>>=-d,d+=u;d>0;s=s*256+t[e+h],h+=_,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=_,d-=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)},gi.write=function(t,e,r,n,i,s){var o,u,c,f=s*8-i-1,d=(1<<f)-1,h=d>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,I=n?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=_/c:e+=_*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(u=0,o=d):o+h>=1?(u=(e*c-1)*Math.pow(2,i),o=o+h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=u&255,y+=I,u/=256,i-=8);for(o=o<<i|u,f+=i;f>0;t[r+y]=o&255,y+=I,o/=256,f-=8);t[r+y-I]|=S*128},gi}function Ac(){if(Ec)return cr;Ec=!0;let t=ky(),e=Cy(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;cr.Buffer=o,cr.SlowBuffer=m,cr.INSPECT_MAX_BYTES=50;let n=2147483647;cr.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),a={foo:function(){return 42}};return Object.setPrototypeOf(a,Uint8Array.prototype),Object.setPrototypeOf(p,a),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 a=new Uint8Array(p);return Object.setPrototypeOf(a,o.prototype),a}function o(p,a,l){if(typeof p=="number"){if(typeof a=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(p)}return u(p,a,l)}o.poolSize=8192;function u(p,a,l){if(typeof p=="string")return h(p,a);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(Xe(p,ArrayBuffer)||p&&Xe(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xe(p,SharedArrayBuffer)||p&&Xe(p.buffer,SharedArrayBuffer)))return I(p,a,l);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let E=p.valueOf&&p.valueOf();if(E!=null&&E!==p)return o.from(E,a,l);let C=S(p);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return o.from(p[Symbol.toPrimitive]("string"),a,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,a,l){return u(p,a,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,a,l){return c(p),p<=0?s(p):a!==void 0?typeof l=="string"?s(p).fill(a,l):s(p).fill(a):s(p)}o.alloc=function(p,a,l){return f(p,a,l)};function d(p){return c(p),s(p<0?0:b(p)|0)}o.allocUnsafe=function(p){return d(p)},o.allocUnsafeSlow=function(p){return d(p)};function h(p,a){if((typeof a!="string"||a==="")&&(a="utf8"),!o.isEncoding(a))throw new TypeError("Unknown encoding: "+a);let l=w(p,a)|0,E=s(l),C=E.write(p,a);return C!==l&&(E=E.slice(0,C)),E}function _(p){let a=p.length<0?0:b(p.length)|0,l=s(a);for(let E=0;E<a;E+=1)l[E]=p[E]&255;return l}function y(p){if(Xe(p,Uint8Array)){let a=new Uint8Array(p);return I(a.buffer,a.byteOffset,a.byteLength)}return _(p)}function I(p,a,l){if(a<0||p.byteLength<a)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<a+(l||0))throw new RangeError('"length" is outside of buffer bounds');let E;return a===void 0&&l===void 0?E=new Uint8Array(p):l===void 0?E=new Uint8Array(p,a):E=new Uint8Array(p,a,l),Object.setPrototypeOf(E,o.prototype),E}function S(p){if(o.isBuffer(p)){let a=b(p.length)|0,l=s(a);return l.length===0||p.copy(l,0,0,a),l}if(p.length!==void 0)return typeof p.length!="number"||fn(p.length)?s(0):_(p);if(p.type==="Buffer"&&Array.isArray(p.data))return _(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(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Xe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Xe(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;let E=a.length,C=l.length;for(let N=0,F=Math.min(E,C);N<F;++N)if(a[N]!==l[N]){E=a[N],C=l[N];break}return E<C?-1:C<E?1:0},o.isEncoding=function(a){switch(String(a).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(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);let E;if(l===void 0)for(l=0,E=0;E<a.length;++E)l+=a[E].length;let C=o.allocUnsafe(l),N=0;for(E=0;E<a.length;++E){let F=a[E];if(Xe(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 w(p,a){if(o.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Xe(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,E=arguments.length>2&&arguments[2]===!0;if(!E&&l===0)return 0;let C=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return St(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return li(p).length;default:if(C)return E?-1:St(p).length;a=(""+a).toLowerCase(),C=!0}}o.byteLength=w;function R(p,a,l){let E=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,a>>>=0,l<=a))return"";for(p||(p="utf8");;)switch(p){case"hex":return W(this,a,l);case"utf8":case"utf-8":return $(this,a,l);case"ascii":return ee(this,a,l);case"latin1":case"binary":return z(this,a,l);case"base64":return U(this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,a,l);default:if(E)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function A(p,a,l){let E=p[a];p[a]=p[l],p[l]=E}o.prototype.swap16=function(){let a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;l<a;l+=2)A(this,l,l+1);return this},o.prototype.swap32=function(){let a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let l=0;l<a;l+=4)A(this,l,l+3),A(this,l+1,l+2);return this},o.prototype.swap64=function(){let a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let l=0;l<a;l+=8)A(this,l,l+7),A(this,l+1,l+6),A(this,l+2,l+5),A(this,l+3,l+4);return this},o.prototype.toString=function(){let a=this.length;return a===0?"":arguments.length===0?$(this,0,a):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){let a="",l=cr.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,E,C,N){if(Xe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof a);if(l===void 0&&(l=0),E===void 0&&(E=a?a.length:0),C===void 0&&(C=0),N===void 0&&(N=this.length),l<0||E>a.length||C<0||N>this.length)throw new RangeError("out of range index");if(C>=N&&l>=E)return 0;if(C>=N)return-1;if(l>=E)return 1;if(l>>>=0,E>>>=0,C>>>=0,N>>>=0,this===a)return 0;let F=N-C,k=E-l,M=Math.min(F,k),re=this.slice(C,N),ie=a.slice(l,E);for(let oe=0;oe<M;++oe)if(re[oe]!==ie[oe]){F=re[oe],k=ie[oe];break}return F<k?-1:k<F?1:0};function g(p,a,l,E,C){if(p.length===0)return-1;if(typeof l=="string"?(E=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,fn(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 a=="string"&&(a=o.from(a,E)),o.isBuffer(a))return a.length===0?-1:O(p,a,l,E,C);if(typeof a=="number")return a=a&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(p,a,l):Uint8Array.prototype.lastIndexOf.call(p,a,l):O(p,[a],l,E,C);throw new TypeError("val must be string, number or Buffer")}function O(p,a,l,E,C){let N=1,F=p.length,k=a.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(p.length<2||a.length<2)return-1;N=2,F/=2,k/=2,l/=2}function M(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(M(p,re)===M(a,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(M(p,re+oe)!==M(a,oe)){ie=!1;break}if(ie)return re}return-1}o.prototype.includes=function(a,l,E){return this.indexOf(a,l,E)!==-1},o.prototype.indexOf=function(a,l,E){return g(this,a,l,E,!0)},o.prototype.lastIndexOf=function(a,l,E){return g(this,a,l,E,!1)};function v(p,a,l,E){l=Number(l)||0;let C=p.length-l;E?(E=Number(E),E>C&&(E=C)):E=C;let N=a.length;E>N/2&&(E=N/2);let F;for(F=0;F<E;++F){let k=parseInt(a.substr(F*2,2),16);if(fn(k))return F;p[l+F]=k}return F}function B(p,a,l,E){return Rr(St(a,p.length-l),p,l,E)}function D(p,a,l,E){return Rr(Et(a),p,l,E)}function L(p,a,l,E){return Rr(li(a),p,l,E)}function K(p,a,l,E){return Rr(cn(a,p.length-l),p,l,E)}o.prototype.write=function(a,l,E,C){if(l===void 0)C="utf8",E=this.length,l=0;else if(E===void 0&&typeof l=="string")C=l,E=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(E)?(E=E>>>0,C===void 0&&(C="utf8")):(C=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-l;if((E===void 0||E>N)&&(E=N),a.length>0&&(E<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 v(this,a,l,E);case"utf8":case"utf-8":return B(this,a,l,E);case"ascii":case"latin1":case"binary":return D(this,a,l,E);case"base64":return L(this,a,l,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,a,l,E);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 U(p,a,l){return a===0&&l===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(a,l))}function $(p,a,l){l=Math.min(p.length,l);let E=[],C=a;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 M,re,ie,oe;switch(k){case 1:N<128&&(F=N);break;case 2:M=p[C+1],(M&192)===128&&(oe=(N&31)<<6|M&63,oe>127&&(F=oe));break;case 3:M=p[C+1],re=p[C+2],(M&192)===128&&(re&192)===128&&(oe=(N&15)<<12|(M&63)<<6|re&63,oe>2047&&(oe<55296||oe>57343)&&(F=oe));break;case 4:M=p[C+1],re=p[C+2],ie=p[C+3],(M&192)===128&&(re&192)===128&&(ie&192)===128&&(oe=(N&15)<<18|(M&63)<<12|(re&63)<<6|ie&63,oe>65535&&oe<1114112&&(F=oe))}}F===null?(F=65533,k=1):F>65535&&(F-=65536,E.push(F>>>10&1023|55296),F=56320|F&1023),E.push(F),C+=k}return J(E)}let G=4096;function J(p){let a=p.length;if(a<=G)return String.fromCharCode.apply(String,p);let l="",E=0;for(;E<a;)l+=String.fromCharCode.apply(String,p.slice(E,E+=G));return l}function ee(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]&127);return E}function z(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]);return E}function W(p,a,l){let E=p.length;(!a||a<0)&&(a=0),(!l||l<0||l>E)&&(l=E);let C="";for(let N=a;N<l;++N)C+=vo[p[N]];return C}function te(p,a,l){let E=p.slice(a,l),C="";for(let N=0;N<E.length-1;N+=2)C+=String.fromCharCode(E[N]+E[N+1]*256);return C}o.prototype.slice=function(a,l){let E=this.length;a=~~a,l=l===void 0?E:~~l,a<0?(a+=E,a<0&&(a=0)):a>E&&(a=E),l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),l<a&&(l=a);let C=this.subarray(a,l);return Object.setPrototypeOf(C,o.prototype),C};function Y(p,a,l){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+a>l)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return C},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a+--l],N=1;for(;l>0&&(N*=256);)C+=this[a+--l]*N;return C},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readBigUInt64LE=ot(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&it(a,this.length-8);let C=l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24,N=this[++a]+this[++a]*2**8+this[++a]*2**16+E*2**24;return BigInt(C)+(BigInt(N)<<BigInt(32))}),o.prototype.readBigUInt64BE=ot(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&it(a,this.length-8);let C=l*2**24+this[++a]*2**16+this[++a]*2**8+this[++a],N=this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E;return(BigInt(C)<<BigInt(32))+BigInt(N)}),o.prototype.readIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return N*=128,C>=N&&(C-=Math.pow(2,8*l)),C},o.prototype.readIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=l,N=1,F=this[a+--C];for(;C>0&&(N*=256);)F+=this[a+--C]*N;return N*=128,F>=N&&(F-=Math.pow(2,8*l)),F},o.prototype.readInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a]|this[a+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a+1]|this[a]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readBigInt64LE=ot(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&it(a,this.length-8);let C=this[a+4]+this[a+5]*2**8+this[a+6]*2**16+(E<<24);return(BigInt(C)<<BigInt(32))+BigInt(l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24)}),o.prototype.readBigInt64BE=ot(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&it(a,this.length-8);let C=(l<<24)+this[++a]*2**16+this[++a]*2**8+this[++a];return(BigInt(C)<<BigInt(32))+BigInt(this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E)}),o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!1,52,8)};function X(p,a,l,E,C,N){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>C||a<N)throw new RangeError('"value" argument is out of bounds');if(l+E>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=1,F=0;for(this[l]=a&255;++F<E&&(N*=256);)this[l+F]=a/N&255;return l+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=E-1,F=1;for(this[l+N]=a&255;--N>=0&&(F*=256);)this[l+N]=a/F&255;return l+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function ce(p,a,l,E,C){Oe(a,E,C,p,l,7);let N=Number(a&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(a>>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,a,l,E,C){Oe(a,E,C,p,l,7);let N=Number(a&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(a>>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=ot(function(a,l=0){return ce(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ot(function(a,l=0){return Z(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=0,F=1,k=0;for(this[l]=a&255;++N<E&&(F*=256);)a<0&&k===0&&this[l+N-1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=E-1,F=1,k=0;for(this[l+N]=a&255;--N>=0&&(F*=256);)a<0&&k===0&&this[l+N+1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeBigInt64LE=ot(function(a,l=0){return ce(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ot(function(a,l=0){return Z(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(p,a,l,E,C,N){if(l+E>p.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function de(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,4),e.write(p,a,l,E,23,4),l+4}o.prototype.writeFloatLE=function(a,l,E){return de(this,a,l,!0,E)},o.prototype.writeFloatBE=function(a,l,E){return de(this,a,l,!1,E)};function be(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,8),e.write(p,a,l,E,52,8),l+8}o.prototype.writeDoubleLE=function(a,l,E){return be(this,a,l,!0,E)},o.prototype.writeDoubleBE=function(a,l,E){return be(this,a,l,!1,E)},o.prototype.copy=function(a,l,E,C){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(E||(E=0),!C&&C!==0&&(C=this.length),l>=a.length&&(l=a.length),l||(l=0),C>0&&C<E&&(C=E),C===E||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=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),a.length-l<C-E&&(C=a.length-l+E);let N=C-E;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,E,C):Uint8Array.prototype.set.call(a,this.subarray(E,C),l),N},o.prototype.fill=function(a,l,E,C){if(typeof a=="string"){if(typeof l=="string"?(C=l,l=0,E=this.length):typeof E=="string"&&(C=E,E=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(a.length===1){let F=a.charCodeAt(0);(C==="utf8"&&F<128||C==="latin1")&&(a=F)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<E)throw new RangeError("Out of range index");if(E<=l)return this;l=l>>>0,E=E===void 0?this.length:E>>>0,a||(a=0);let N;if(typeof a=="number")for(N=l;N<E;++N)this[N]=a;else{let F=o.isBuffer(a)?a:o.from(a,C),k=F.length;if(k===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(N=0;N<E-l;++N)this[N+l]=F[N%k]}return this};let ge={};function Ae(p,a,l){ge[p]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:a.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,a){return`The "${p}" argument must be of type number. Received type ${typeof a}`},TypeError),Ae("ERR_OUT_OF_RANGE",function(p,a,l){let E=`The value of "${p}" is out of range.`,C=l;return Number.isInteger(l)&&Math.abs(l)>2**32?C=we(String(l)):typeof l=="bigint"&&(C=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(C=we(C)),C+="n"),E+=` It must be ${a}. Received ${C}`,E},RangeError);function we(p){let a="",l=p.length,E=p[0]==="-"?1:0;for(;l>=E+4;l-=3)a=`_${p.slice(l-3,l)}${a}`;return`${p.slice(0,l)}${a}`}function ve(p,a,l){xe(a,"offset"),(p[a]===void 0||p[a+l]===void 0)&&it(a,p.length-(l+1))}function Oe(p,a,l,E,C,N){if(p>l||p<a){let F=typeof a=="bigint"?"n":"",k;throw a===0||a===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 ge.ERR_OUT_OF_RANGE("value",k,p)}ve(E,C,N)}function xe(p,a){if(typeof p!="number")throw new ge.ERR_INVALID_ARG_TYPE(a,"number",p)}function it(p,a,l){throw Math.floor(p)!==p?(xe(p,l),new ge.ERR_OUT_OF_RANGE("offset","an integer",p)):a<0?new ge.ERR_BUFFER_OUT_OF_BOUNDS:new ge.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${a}`,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 St(p,a){a=a||1/0;let l,E=p.length,C=null,N=[];for(let F=0;F<E;++F){if(l=p.charCodeAt(F),l>55295&&l<57344){if(!C){if(l>56319){(a-=3)>-1&&N.push(239,191,189);continue}else if(F+1===E){(a-=3)>-1&&N.push(239,191,189);continue}C=l;continue}if(l<56320){(a-=3)>-1&&N.push(239,191,189),C=l;continue}l=(C-55296<<10|l-56320)+65536}else C&&(a-=3)>-1&&N.push(239,191,189);if(C=null,l<128){if((a-=1)<0)break;N.push(l)}else if(l<2048){if((a-=2)<0)break;N.push(l>>6|192,l&63|128)}else if(l<65536){if((a-=3)<0)break;N.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((a-=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 Et(p){let a=[];for(let l=0;l<p.length;++l)a.push(p.charCodeAt(l)&255);return a}function cn(p,a){let l,E,C,N=[];for(let F=0;F<p.length&&!((a-=2)<0);++F)l=p.charCodeAt(F),E=l>>8,C=l%256,N.push(C),N.push(E);return N}function li(p){return t.toByteArray(Ne(p))}function Rr(p,a,l,E){let C;for(C=0;C<E&&!(C+l>=a.length||C>=p.length);++C)a[C+l]=p[C];return C}function Xe(p,a){return p instanceof a||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===a.name}function fn(p){return p!==p}let vo=(function(){let p="0123456789abcdef",a=new Array(256);for(let l=0;l<16;++l){let E=l*16;for(let C=0;C<16;++C)a[E+C]=p[l]+p[C]}return a})();function ot(p){return typeof BigInt>"u"?So:p}function So(){throw new Error("BigInt not supported")}return cr}var hn,vc,gi,Sc,cr,Ec,Ic=ze(()=>{x();P();T();hn={},vc=!1;gi={},Sc=!1;cr={},Ec=!1});var Le={};Mr(Le,{Buffer:()=>V,INSPECT_MAX_BYTES:()=>My,default:()=>Wt,kMaxLength:()=>By});var Wt,V,My,By,ke=ze(()=>{x();P();T();Ic();Wt=Ac();Wt.Buffer;Wt.SlowBuffer;Wt.INSPECT_MAX_BYTES;Wt.kMaxLength;V=Wt.Buffer,My=Wt.INSPECT_MAX_BYTES,By=Wt.kMaxLength});var P=ze(()=>{ke()});var Ee=H((gx,xc)=>{"use strict";x();P();T();var Bo=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}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};xc.exports={AggregateError:Bo,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 No=H((xx,Tc)=>{"use strict";x();P();T();Tc.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 Ue=H((Lx,Rc)=>{"use strict";x();P();T();var{format:Ny,inspect:yi}=No(),{AggregateError:Ly}=Ee(),qy=globalThis.AggregateError||Ly,Dy=Symbol("kIsNodeError"),Uy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Fy=/^([A-Z][a-z0-9]*)+$/,jy="__node_internal_",bi={};function fr(t,e){if(!t)throw new bi.ERR_INTERNAL_ASSERTION(e)}function Pc(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 $y(t,e,r){if(typeof e=="function")return fr(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 fr(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Ny(e,...r)}function qe(t,e,r){r||(r=Error);class n extends r{constructor(...s){super($y(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[Dy]=!0,bi[t]=n}function Oc(t){let e=jy+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Wy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new qy([e,t],e.message);return r.code=e.code,r}return t||e}var Lo=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"}};qe("ERR_ASSERTION","%s",Error);qe("ERR_INVALID_ARG_TYPE",(t,e,r)=>{fr(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)fr(typeof c=="string","All expected entries have to be of type string"),Uy.includes(c)?i.push(c.toLowerCase()):Fy.test(c)?s.push(c):(fr(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 u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{let c=yi(r,{depth:-1});n+=`. Received ${c}`}}else{let c=yi(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof r} (${c})`}return n},TypeError);qe("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=yi(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);qe("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);qe("ERR_MISSING_ARGS",(...t)=>{fr(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);qe("ERR_OUT_OF_RANGE",(t,e,r)=>{fr(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=Pc(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=Pc(n)),n+="n"}else n=yi(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);qe("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);qe("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);qe("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);qe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);qe("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);qe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);qe("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);qe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);qe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);qe("ERR_STREAM_WRITE_AFTER_END","write after end",Error);qe("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Rc.exports={AbortError:Lo,aggregateTwoErrors:Oc(Wy),hideStackFrames:Oc,codes:bi}});var Nr=H((zx,mi)=>{"use strict";x();P();T();var{AbortController:kc,AbortSignal:Vy}=typeof self<"u"?self:typeof window<"u"?window:void 0;mi.exports=kc;mi.exports.AbortSignal=Vy;mi.exports.default=kc});var Vt={};Mr(Vt,{EventEmitter:()=>zy,default:()=>pn,defaultMaxListeners:()=>Gy,init:()=>Qy,listenerCount:()=>Ky,on:()=>Yy,once:()=>Jy});function Hy(){if(Cc)return _i;Cc=!0;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(g,O,v){return Function.prototype.apply.call(g,O,v)},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(A){console&&console.warn&&console.warn(A)}var i=Number.isNaN||function(g){return g!==g};function s(){s.init.call(this)}_i=s,_i.once=m,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function u(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");o=A}}),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(A){return A._maxListeners===void 0?s.defaultMaxListeners:A._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(g){for(var O=[],v=1;v<arguments.length;v++)O.push(arguments[v]);var B=g==="error",D=this._events;if(D!==void 0)B=B&&D.error===void 0;else if(!B)return!1;if(B){var L;if(O.length>0&&(L=O[0]),L instanceof Error)throw L;var K=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw K.context=L,K}var U=D[g];if(U===void 0)return!1;if(typeof U=="function")e(U,this,O);else for(var $=U.length,G=I(U,$),v=0;v<$;++v)e(G[v],this,O);return!0};function f(A,g,O,v){var B,D,L;if(u(O),D=A._events,D===void 0?(D=A._events=Object.create(null),A._eventsCount=0):(D.newListener!==void 0&&(A.emit("newListener",g,O.listener?O.listener:O),D=A._events),L=D[g]),L===void 0)L=D[g]=O,++A._eventsCount;else if(typeof L=="function"?L=D[g]=v?[O,L]:[L,O]:v?L.unshift(O):L.push(O),B=c(A),B>0&&L.length>B&&!L.warned){L.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=A,K.type=g,K.count=L.length,n(K)}return A}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 d(){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 h(A,g,O){var v={fired:!1,wrapFn:void 0,target:A,type:g,listener:O},B=d.bind(v);return B.listener=O,v.wrapFn=B,B}s.prototype.once=function(g,O){return u(O),this.on(g,h(this,g,O)),this},s.prototype.prependOnceListener=function(g,O){return u(O),this.prependListener(g,h(this,g,O)),this},s.prototype.removeListener=function(g,O){var v,B,D,L,K;if(u(O),B=this._events,B===void 0)return this;if(v=B[g],v===void 0)return this;if(v===O||v.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete B[g],B.removeListener&&this.emit("removeListener",g,v.listener||O));else if(typeof v!="function"){for(D=-1,L=v.length-1;L>=0;L--)if(v[L]===O||v[L].listener===O){K=v[L].listener,D=L;break}if(D<0)return this;D===0?v.shift():S(v,D),v.length===1&&(B[g]=v[0]),B.removeListener!==void 0&&this.emit("removeListener",g,K||O)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(g){var O,v,B;if(v=this._events,v===void 0)return this;if(v.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):v[g]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete v[g]),this;if(arguments.length===0){var D=Object.keys(v),L;for(B=0;B<D.length;++B)L=D[B],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=v[g],typeof O=="function")this.removeListener(g,O);else if(O!==void 0)for(B=O.length-1;B>=0;B--)this.removeListener(g,O[B]);return this};function _(A,g,O){var v=A._events;if(v===void 0)return[];var B=v[g];return B===void 0?[]:typeof B=="function"?O?[B.listener||B]:[B]:O?b(B):I(B,B.length)}s.prototype.listeners=function(g){return _(this,g,!0)},s.prototype.rawListeners=function(g){return _(this,g,!1)},s.listenerCount=function(A,g){return typeof A.listenerCount=="function"?A.listenerCount(g):y.call(A,g)},s.prototype.listenerCount=y;function y(A){var g=this._events;if(g!==void 0){var O=g[A];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 I(A,g){for(var O=new Array(g),v=0;v<g;++v)O[v]=A[v];return O}function S(A,g){for(;g+1<A.length;g++)A[g]=A[g+1];A.pop()}function b(A){for(var g=new Array(A.length),O=0;O<g.length;++O)g[O]=A[O].listener||A[O];return g}function m(A,g){return new Promise(function(O,v){function B(L){A.removeListener(g,D),v(L)}function D(){typeof A.removeListener=="function"&&A.removeListener("error",B),O([].slice.call(arguments))}R(A,g,D,{once:!0}),g!=="error"&&w(A,B,{once:!0})})}function w(A,g,O){typeof A.on=="function"&&R(A,"error",g,O)}function R(A,g,O,v){if(typeof A.on=="function")v.once?A.once(g,O):A.on(g,O);else if(typeof A.addEventListener=="function")A.addEventListener(g,function B(D){v.once&&A.removeEventListener(g,B),O(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A)}return _i}var _i,Cc,pn,zy,Gy,Qy,Ky,Yy,Jy,Ht=ze(()=>{x();P();T();_i={},Cc=!1;pn=Hy();pn.once;pn.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)})};pn.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 d=Promise.reject(i);return i=null,d}return s?createIterResult(void 0,!0):new Promise((d,h)=>n.push({resolve:d,reject:h}))},async return(){t.removeListener(e,u),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,u),t.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return t.on(e,u),t.on("error",c),o;function u(...f){let d=n.shift();d?d.resolve(createIterResult(f,!1)):r.push(f)}function c(f){s=!0;let d=n.shift();d?d.reject(f):i=f,o.return()}};({EventEmitter:zy,defaultMaxListeners:Gy,init:Qy,listenerCount:Ky,on:Yy,once:Jy}=pn)});var We=H((fT,Do)=>{"use strict";x();P();T();var Xy=(ke(),_e(Le)),{format:Zy,inspect:eb}=No(),{codes:{ERR_INVALID_ARG_TYPE:qo}}=Ue(),{kResistStopPropagation:tb,AggregateError:rb,SymbolDispose:nb}=Ee(),ib=globalThis.AbortSignal||Nr().AbortSignal,ob=globalThis.AbortController||Nr().AbortController,sb=Object.getPrototypeOf(async function(){}).constructor,Mc=globalThis.Blob||Xy.Blob,ab=typeof Mc<"u"?function(e){return e instanceof Mc}:function(e){return!1},Bc=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new qo(e,"AbortSignal",t)},ub=(t,e)=>{if(typeof t!="function")throw new qo(e,"Function",t)};Do.exports={AggregateError:rb,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:Zy,inspect:eb,types:{isAsyncFunction(t){return t instanceof sb},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:ab,deprecate(t,e){return t},addAbortListener:(Ht(),_e(Vt)).addAbortListener||function(e,r){if(e===void 0)throw new qo("signal","AbortSignal",e);Bc(e,"signal"),ub(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[tb]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[nb](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:ib.any||function(e){if(e.length===1)return e[0];let r=new ob,n=()=>r.abort();return e.forEach(i=>{Bc(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Do.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var qr=H((vT,Vc)=>{"use strict";x();P();T();var{ArrayIsArray:Fo,ArrayPrototypeIncludes:Dc,ArrayPrototypeJoin:Uc,ArrayPrototypeMap:lb,NumberIsInteger:jo,NumberIsNaN:cb,NumberMAX_SAFE_INTEGER:fb,NumberMIN_SAFE_INTEGER:db,NumberParseInt:hb,ObjectPrototypeHasOwnProperty:pb,RegExpPrototypeExec:Fc,String:gb,StringPrototypeToUpperCase:yb,StringPrototypeTrim:bb}=Ee(),{hideStackFrames:Ze,codes:{ERR_SOCKET_BAD_PORT:mb,ERR_INVALID_ARG_TYPE:Fe,ERR_INVALID_ARG_VALUE:Lr,ERR_OUT_OF_RANGE:dr,ERR_UNKNOWN_SIGNAL:Nc}}=Ue(),{normalizeEncoding:_b}=We(),{isAsyncFunction:wb,isArrayBufferView:vb}=We().types,Lc={};function Sb(t){return t===(t|0)}function Eb(t){return t===t>>>0}var Ab=/^[0-7]+$/,Ib="must be a 32-bit unsigned integer or an octal string";function xb(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Fc(Ab,t)===null)throw new Lr(e,t,Ib);t=hb(t,8)}return jc(t,e),t}var Tb=Ze((t,e,r=db,n=fb)=>{if(typeof t!="number")throw new Fe(e,"number",t);if(!jo(t))throw new dr(e,"an integer",t);if(t<r||t>n)throw new dr(e,`>= ${r} && <= ${n}`,t)}),Pb=Ze((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new Fe(e,"number",t);if(!jo(t))throw new dr(e,"an integer",t);if(t<r||t>n)throw new dr(e,`>= ${r} && <= ${n}`,t)}),jc=Ze((t,e,r=!1)=>{if(typeof t!="number")throw new Fe(e,"number",t);if(!jo(t))throw new dr(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new dr(e,`>= ${n} && <= ${i}`,t)});function $o(t,e){if(typeof t!="string")throw new Fe(e,"string",t)}function Ob(t,e,r=void 0,n){if(typeof t!="number")throw new Fe(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&cb(t))throw new dr(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Rb=Ze((t,e,r)=>{if(!Dc(r,t)){let i="must be one of: "+Uc(lb(r,s=>typeof s=="string"?`'${s}'`:gb(s)),", ");throw new Lr(e,t,i)}});function $c(t,e){if(typeof t!="boolean")throw new Fe(e,"boolean",t)}function Uo(t,e,r){return t==null||!pb(t,e)?r:t[e]}var kb=Ze((t,e,r=null)=>{let n=Uo(r,"allowArray",!1),i=Uo(r,"allowFunction",!1);if(!Uo(r,"nullable",!1)&&t===null||!n&&Fo(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new Fe(e,"Object",t)}),Cb=Ze((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Fe(e,"a dictionary",t)}),wi=Ze((t,e,r=0)=>{if(!Fo(t))throw new Fe(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Lr(e,t,n)}});function Mb(t,e){wi(t,e);for(let r=0;r<t.length;r++)$o(t[r],`${e}[${r}]`)}function Bb(t,e){wi(t,e);for(let r=0;r<t.length;r++)$c(t[r],`${e}[${r}]`)}function Nb(t,e){wi(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new Fe(i,"AbortSignal",n);Wc(n,i)}}function Lb(t,e="signal"){if($o(t,e),Lc[t]===void 0)throw Lc[yb(t)]!==void 0?new Nc(t+" (signals must use all capital letters)"):new Nc(t)}var qb=Ze((t,e="buffer")=>{if(!vb(t))throw new Fe(e,["Buffer","TypedArray","DataView"],t)});function Db(t,e){let r=_b(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Lr("encoding",e,`is invalid for data of length ${n}`)}function Ub(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&bb(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new mb(e,t,r);return t|0}var Wc=Ze((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Fe(e,"AbortSignal",t)}),Fb=Ze((t,e)=>{if(typeof t!="function")throw new Fe(e,"Function",t)}),jb=Ze((t,e)=>{if(typeof t!="function"||wb(t))throw new Fe(e,"Function",t)}),$b=Ze((t,e)=>{if(t!==void 0)throw new Fe(e,"undefined",t)});function Wb(t,e,r){if(!Dc(r,t))throw new Fe(e,`('${Uc(r,"|")}')`,t)}var Vb=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function qc(t,e){if(typeof t>"u"||!Fc(Vb,t))throw new Lr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Hb(t){if(typeof t=="string")return qc(t,"hints"),t;if(Fo(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];qc(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Lr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Vc.exports={isInt32:Sb,isUint32:Eb,parseFileMode:xb,validateArray:wi,validateStringArray:Mb,validateBooleanArray:Bb,validateAbortSignalArray:Nb,validateBoolean:$c,validateBuffer:qb,validateDictionary:Cb,validateEncoding:Db,validateFunction:Fb,validateInt32:Pb,validateInteger:Tb,validateNumber:Ob,validateObject:kb,validateOneOf:Rb,validatePlainFunction:jb,validatePort:Ub,validateSignalName:Lb,validateString:$o,validateUint32:jc,validateUndefined:$b,validateUnion:Wb,validateAbortSignal:Wc,validateLinkHeaderValue:Hb}});var zt=H((kT,Qc)=>{x();P();T();var Te=Qc.exports={},dt,ht;function Wo(){throw new Error("setTimeout has not been defined")}function Vo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?dt=setTimeout:dt=Wo}catch{dt=Wo}try{typeof clearTimeout=="function"?ht=clearTimeout:ht=Vo}catch{ht=Vo}})();function Hc(t){if(dt===setTimeout)return setTimeout(t,0);if((dt===Wo||!dt)&&setTimeout)return dt=setTimeout,setTimeout(t,0);try{return dt(t,0)}catch{try{return dt.call(null,t,0)}catch{return dt.call(this,t,0)}}}function zb(t){if(ht===clearTimeout)return clearTimeout(t);if((ht===Vo||!ht)&&clearTimeout)return ht=clearTimeout,clearTimeout(t);try{return ht(t)}catch{try{return ht.call(null,t)}catch{return ht.call(this,t)}}}var xt=[],Dr=!1,hr,vi=-1;function Gb(){!Dr||!hr||(Dr=!1,hr.length?xt=hr.concat(xt):vi=-1,xt.length&&zc())}function zc(){if(!Dr){var t=Hc(Gb);Dr=!0;for(var e=xt.length;e;){for(hr=xt,xt=[];++vi<e;)hr&&hr[vi].run();vi=-1,e=xt.length}hr=null,Dr=!1,zb(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];xt.push(new Gc(t,e)),xt.length===1&&!Dr&&Hc(zc)};function Gc(t,e){this.fun=t,this.array=e}Gc.prototype.run=function(){this.fun.apply(null,this.array)};Te.title="browser";Te.browser=!0;Te.env={};Te.argv=[];Te.version="";Te.versions={};function Tt(){}Te.on=Tt;Te.addListener=Tt;Te.once=Tt;Te.off=Tt;Te.removeListener=Tt;Te.removeAllListeners=Tt;Te.emit=Tt;Te.prependListener=Tt;Te.prependOnceListener=Tt;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 gt=H((jT,cf)=>{"use strict";x();P();T();var{SymbolAsyncIterator:Kc,SymbolIterator:Yc,SymbolFor:pr}=Ee(),Jc=pr("nodejs.stream.destroyed"),Xc=pr("nodejs.stream.errored"),Ho=pr("nodejs.stream.readable"),zo=pr("nodejs.stream.writable"),Zc=pr("nodejs.stream.disturbed"),Qb=pr("nodejs.webstream.isClosedPromise"),Kb=pr("nodejs.webstream.controllerErrorFunction");function Si(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 Ei(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 Yb(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function pt(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function ef(t){return!!(t&&!pt(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function tf(t){return!!(t&&!pt(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function rf(t){return!!(t&&!pt(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Jb(t){return ef(t)||tf(t)||rf(t)}function Xb(t,e){return t==null?!1:e===!0?typeof t[Kc]=="function":e===!1?typeof t[Yc]=="function":typeof t[Kc]=="function"||typeof t[Yc]=="function"}function Ai(t){if(!pt(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Jc]||n!=null&&n.destroyed)}function nf(t){if(!Ei(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 Zb(t,e){if(!Ei(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 em(t){if(!Si(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 of(t,e){if(!Si(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 sf(t){return t&&t[Ho]!=null?t[Ho]:typeof t?.readable!="boolean"?null:Ai(t)?!1:Si(t)&&t.readable&&!of(t)}function af(t){return t&&t[zo]!=null?t[zo]:typeof t?.writable!="boolean"?null:Ai(t)?!1:Ei(t)&&t.writable&&!nf(t)}function tm(t,e){return pt(t)?Ai(t)?!0:!(e?.readable!==!1&&sf(t)||e?.writable!==!1&&af(t)):null}function rm(t){var e,r;return pt(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 nm(t){var e,r;return pt(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 im(t){if(!pt(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"&&uf(t)?t._closed:null}function uf(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function lf(t){return typeof t._sent100=="boolean"&&uf(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 sm(t){if(!pt(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&lf(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function am(t){var e;return!!(t&&((e=t[Zc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function um(t){var e,r,n,i,s,o,u,c,f,d;return!!(t&&((e=(r=(n=(i=(s=(o=t[Xc])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.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:!((d=t._writableState)===null||d===void 0)&&d.errored))}cf.exports={isDestroyed:Ai,kIsDestroyed:Jc,isDisturbed:am,kIsDisturbed:Zc,isErrored:um,kIsErrored:Xc,isReadable:sf,kIsReadable:Ho,kIsClosedPromise:Qb,kControllerErrorFunction:Kb,kIsWritable:zo,isClosed:im,isDuplexNodeStream:Yb,isFinished:tm,isIterable:Xb,isReadableNodeStream:Si,isReadableStream:ef,isReadableEnded:em,isReadableFinished:of,isReadableErrored:nm,isNodeStream:pt,isWebStream:Jb,isWritable:af,isWritableNodeStream:Ei,isWritableStream:tf,isWritableEnded:nf,isWritableFinished:Zb,isWritableErrored:rm,isServerRequest:om,isServerResponse:lf,willEmitClose:sm,isTransformStream:rf}});var Pt=H((JT,Jo)=>{"use strict";x();P();T();var Gt=zt(),{AbortError:_f,codes:lm}=Ue(),{ERR_INVALID_ARG_TYPE:cm,ERR_STREAM_PREMATURE_CLOSE:ff}=lm,{kEmptyObject:Qo,once:Ko}=We(),{validateAbortSignal:fm,validateFunction:dm,validateObject:hm,validateBoolean:pm}=qr(),{Promise:gm,PromisePrototypeThen:ym,SymbolDispose:wf}=Ee(),{isClosed:bm,isReadable:df,isReadableNodeStream:Go,isReadableStream:mm,isReadableFinished:hf,isReadableErrored:pf,isWritable:gf,isWritableNodeStream:yf,isWritableStream:_m,isWritableFinished:bf,isWritableErrored:mf,isNodeStream:wm,willEmitClose:vm,kIsClosedPromise:Sm}=gt(),Ur;function Em(t){return t.setHeader&&typeof t.abort=="function"}var Yo=()=>{};function vf(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Qo):e==null?e=Qo:hm(e,"options"),dm(r,"callback"),fm(e.signal,"options.signal"),r=Ko(r),mm(t)||_m(t))return Am(t,e,r);if(!wm(t))throw new cm("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:Go(t),o=(i=e.writable)!==null&&i!==void 0?i:yf(t),u=t._writableState,c=t._readableState,f=()=>{t.writable||_()},d=vm(t)&&Go(t)===s&&yf(t)===o,h=bf(t,!1),_=()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||y)&&r.call(t)},y=hf(t,!1),I=()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||o))&&(!o||h)&&r.call(t)},S=g=>{r.call(t,g)},b=bm(t),m=()=>{b=!0;let g=mf(t)||pf(t);if(g&&typeof g!="boolean")return r.call(t,g);if(s&&!y&&Go(t,!0)&&!hf(t,!1))return r.call(t,new ff);if(o&&!h&&!bf(t,!1))return r.call(t,new ff);r.call(t)},w=()=>{b=!0;let g=mf(t)||pf(t);if(g&&typeof g!="boolean")return r.call(t,g);r.call(t)},R=()=>{t.req.on("finish",_)};Em(t)?(t.on("complete",_),d||t.on("abort",m),t.req?R():t.on("request",R)):o&&!u&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",m),t.on("end",I),t.on("finish",_),e.error!==!1&&t.on("error",S),t.on("close",m),b?Gt.nextTick(m):u!=null&&u.errorEmitted||c!=null&&c.errorEmitted?d||Gt.nextTick(w):(!s&&(!d||df(t))&&(h||gf(t)===!1)||!o&&(!d||gf(t))&&(y||df(t)===!1)||c&&t.req&&t.aborted)&&Gt.nextTick(w);let A=()=>{r=Yo,t.removeListener("aborted",m),t.removeListener("complete",_),t.removeListener("abort",m),t.removeListener("request",R),t.req&&t.req.removeListener("finish",_),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",_),t.removeListener("end",I),t.removeListener("error",S),t.removeListener("close",m)};if(e.signal&&!b){let g=()=>{let O=r;A(),O.call(t,new _f(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Gt.nextTick(g);else{Ur=Ur||We().addAbortListener;let O=Ur(e.signal,g),v=r;r=Ko((...B)=>{O[wf](),v.apply(t,B)})}}return A}function Am(t,e,r){let n=!1,i=Yo;if(e.signal)if(i=()=>{n=!0,r.call(t,new _f(void 0,{cause:e.signal.reason}))},e.signal.aborted)Gt.nextTick(i);else{Ur=Ur||We().addAbortListener;let o=Ur(e.signal,i),u=r;r=Ko((...c)=>{o[wf](),u.apply(t,c)})}let s=(...o)=>{n||Gt.nextTick(()=>r.apply(t,o))};return ym(t[Sm].promise,s,s),Yo}function Im(t,e){var r;let n=!1;return e===null&&(e=Qo),(r=e)!==null&&r!==void 0&&r.cleanup&&(pm(e.cleanup,"cleanup"),n=e.cleanup),new gm((i,s)=>{let o=vf(t,e,u=>{n&&o(),u?s(u):i()})})}Jo.exports=vf;Jo.exports.finished=Im});var gr=H((aP,Of)=>{"use strict";x();P();T();var yt=zt(),{aggregateTwoErrors:xm,codes:{ERR_MULTIPLE_CALLBACK:Tm},AbortError:Pm}=Ue(),{Symbol:Af}=Ee(),{kIsDestroyed:Om,isDestroyed:Rm,isFinished:km,isServerRequest:Cm}=gt(),If=Af("kDestroy"),Xo=Af("kConstruct");function xf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Mm(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):(xf(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?Sf(this,t,e):this.once(If,function(s){Sf(this,xm(s,t),e)}),this)}function Sf(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,u=t._writableState;xf(s,u,o),u&&(u.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?yt.nextTick(Bm,t,s):yt.nextTick(Tf,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function Bm(t,e){Zo(t,e),Tf(t)}function Tf(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 Zo(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 Nm(){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 es(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?yt.nextTick(Zo,t,e):Zo(t,e))}function Lm(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(Xo,e),!(t.listenerCount(Xo)>1)&&yt.nextTick(qm,t)}function qm(t){let e=!1;function r(n){if(e){es(t,n??new Tm);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(If,n):n?es(t,n,!0):yt.nextTick(Dm,t)}try{t._construct(n=>{yt.nextTick(r,n)})}catch(n){yt.nextTick(r,n)}}function Dm(t){t.emit(Xo)}function Ef(t){return t?.setHeader&&typeof t.abort=="function"}function Pf(t){t.emit("close")}function Um(t,e){t.emit("error",e),yt.nextTick(Pf,t)}function Fm(t,e){!t||Rm(t)||(!e&&!km(t)&&(e=new Pm),Cm(t)?(t.socket=null,t.destroy(e)):Ef(t)?t.abort():Ef(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?yt.nextTick(Um,t,e):yt.nextTick(Pf,t),t.destroyed||(t[Om]=!0))}Of.exports={construct:Lm,destroyer:Fm,destroy:Mm,undestroy:Nm,errorOrDestroy:es}});var Ti=H((bP,kf)=>{"use strict";x();P();T();var{ArrayIsArray:jm,ObjectSetPrototypeOf:Rf}=Ee(),{EventEmitter:Ii}=(Ht(),_e(Vt));function xi(t){Ii.call(this,t)}Rf(xi.prototype,Ii.prototype);Rf(xi,Ii);xi.prototype.pipe=function(t,e){let r=this;function n(d){t.writable&&t.write(d)===!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",u));let s=!1;function o(){s||(s=!0,t.end())}function u(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function c(d){f(),Ii.listenerCount(this,"error")===0&&this.emit("error",d)}ts(r,"error",c),ts(t,"error",c);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",u),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 ts(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):jm(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}kf.exports={Stream:xi,prependListener:ts}});var gn=H((TP,Pi)=>{"use strict";x();P();T();var{SymbolDispose:$m}=Ee(),{AbortError:Cf,codes:Wm}=Ue(),{isNodeStream:Mf,isWebStream:Vm,kControllerErrorFunction:Hm}=gt(),zm=Pt(),{ERR_INVALID_ARG_TYPE:Bf}=Wm,rs,Gm=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Bf(e,"AbortSignal",t)};Pi.exports.addAbortSignal=function(e,r){if(Gm(e,"signal"),!Mf(r)&&!Vm(r))throw new Bf("stream",["ReadableStream","WritableStream","Stream"],r);return Pi.exports.addAbortSignalNoValidate(e,r)};Pi.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Mf(e)?()=>{e.destroy(new Cf(void 0,{cause:t.reason}))}:()=>{e[Hm](new Cf(void 0,{cause:t.reason}))};if(t.aborted)r();else{rs=rs||We().addAbortListener;let n=rs(t,r);zm(e,n[$m])}return e}});var qf=H((DP,Lf)=>{"use strict";x();P();T();var{StringPrototypeSlice:Nf,SymbolIterator:Qm,TypedArrayPrototypeSet:Oi,Uint8Array:Km}=Ee(),{Buffer:ns}=(ke(),_e(Le)),{inspect:Ym}=We();Lf.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 ns.alloc(0);let r=ns.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Oi(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}*[Qm](){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+=Nf(s,0,e),this.head=n,n.data=Nf(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=ns.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Oi(r,o,n-e),e-=o.length;else{e===o.length?(Oi(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Oi(r,new Km(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 Ym(this,{...r,depth:0,customInspect:!1})}}});var yn=H((QP,jf)=>{"use strict";x();P();T();var{MathFloor:Jm,NumberIsInteger:Xm}=Ee(),{validateInteger:Zm}=qr(),{ERR_INVALID_ARG_VALUE:e_}=Ue().codes,Df=16*1024,Uf=16;function t_(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Ff(t){return t?Uf:Df}function r_(t,e){Zm(e,"value",0),t?Uf=e:Df=e}function n_(t,e,r,n){let i=t_(e,n,r);if(i!=null){if(!Xm(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new e_(s,i)}return Jm(i)}return Ff(t.objectMode)}jf.exports={getHighWaterMark:n_,getDefaultHighWaterMark:Ff,setDefaultHighWaterMark:r_}});var Vf=H((is,Wf)=>{x();P();T();var Ri=(ke(),_e(Le)),bt=Ri.Buffer;function $f(t,e){for(var r in t)e[r]=t[r]}bt.from&&bt.alloc&&bt.allocUnsafe&&bt.allocUnsafeSlow?Wf.exports=Ri:($f(Ri,is),is.Buffer=yr);function yr(t,e,r){return bt(t,e,r)}yr.prototype=Object.create(bt.prototype);$f(bt,yr);yr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return bt(t,e,r)};yr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=bt(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};yr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return bt(t)};yr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ri.SlowBuffer(t)}});var Gf=H(zf=>{"use strict";x();P();T();var ss=Vf().Buffer,Hf=ss.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 i_(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=i_(t);if(typeof e!="string"&&(ss.isEncoding===Hf||!Hf(t)))throw new Error("Unknown encoding: "+t);return e||t}zf.StringDecoder=bn;function bn(t){this.encoding=o_(t);var e;switch(this.encoding){case"utf16le":this.text=f_,this.end=d_,e=4;break;case"utf8":this.fillLast=u_,e=4;break;case"base64":this.text=h_,this.end=p_,e=3;break;default:this.write=g_,this.end=y_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ss.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=c_;bn.prototype.text=l_;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 os(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s_(t,e,r){var n=e.length-1;if(n<r)return 0;var i=os(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=os(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=os(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function a_(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 u_(t){var e=this.lastTotal-this.lastNeed,r=a_(this,t,e);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 l_(t,e){var r=s_(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 c_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function f_(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 d_(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 h_(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 p_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function g_(t){return t.toString(this.encoding)}function y_(t){return t&&t.length?this.write(t):""}});var as=H((EO,Jf)=>{"use strict";x();P();T();var Qf=zt(),{PromisePrototypeThen:b_,SymbolAsyncIterator:Kf,SymbolIterator:Yf}=Ee(),{Buffer:m_}=(ke(),_e(Le)),{ERR_INVALID_ARG_TYPE:__,ERR_STREAM_NULL_VALUES:w_}=Ue().codes;function v_(t,e,r){let n;if(typeof e=="string"||e instanceof m_)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Kf])i=!0,n=e[Kf]();else if(e&&e[Yf])i=!1,n=e[Yf]();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,d){b_(u(f),()=>Qf.nextTick(d,f),h=>Qf.nextTick(d,h||f))};async function u(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:_,done:y}=await n.throw(f);if(await _,y)return}if(typeof n.return=="function"){let{value:_}=await n.return();await _}}async function c(){for(;;){try{let{value:f,done:d}=i?await n.next():n.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw o=!1,new w_;if(s.push(h))continue;o=!1}}catch(f){s.destroy(f)}break}}return s}Jf.exports=v_});var _n=H((MO,gd)=>{"use strict";x();P();T();var at=zt(),{ArrayPrototypeIndexOf:S_,NumberIsInteger:E_,NumberIsNaN:A_,NumberParseInt:I_,ObjectDefineProperties:gs,ObjectKeys:x_,ObjectSetPrototypeOf:ed,Promise:td,SafeSet:T_,SymbolAsyncDispose:P_,SymbolAsyncIterator:O_,Symbol:R_}=Ee();gd.exports=le;le.ReadableState=Bi;var{EventEmitter:k_}=(Ht(),_e(Vt)),{Stream:Qt,prependListener:C_}=Ti(),{Buffer:us}=(ke(),_e(Le)),{addAbortSignal:M_}=gn(),rd=Pt(),he=We().debuglog("stream",t=>{he=t}),B_=qf(),$r=gr(),{getHighWaterMark:N_,getDefaultHighWaterMark:L_}=yn(),{aggregateTwoErrors:Xf,codes:{ERR_INVALID_ARG_TYPE:q_,ERR_METHOD_NOT_IMPLEMENTED:D_,ERR_OUT_OF_RANGE:U_,ERR_STREAM_PUSH_AFTER_EOF:F_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j_},AbortError:$_}=Ue(),{validateObject:W_}=qr(),br=R_("kPaused"),{StringDecoder:nd}=Gf(),V_=as();ed(le.prototype,Qt.prototype);ed(le,Qt);var ls=()=>{},{errorOrDestroy:Fr}=$r,jr=1,H_=2,id=4,mn=8,od=16,ki=32,Ci=64,sd=128,z_=256,G_=512,Q_=1024,hs=2048,ps=4096,K_=8192,Y_=16384,J_=32768,ad=65536,X_=1<<17,Z_=1<<18;function Ce(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}gs(Bi.prototype,{objectMode:Ce(jr),ended:Ce(H_),endEmitted:Ce(id),reading:Ce(mn),constructed:Ce(od),sync:Ce(ki),needReadable:Ce(Ci),emittedReadable:Ce(sd),readableListening:Ce(z_),resumeScheduled:Ce(G_),errorEmitted:Ce(Q_),emitClose:Ce(hs),autoDestroy:Ce(ps),destroyed:Ce(K_),closed:Ce(Y_),closeEmitted:Ce(J_),multiAwaitDrain:Ce(ad),readingMore:Ce(X_),dataEmitted:Ce(Z_)});function Bi(t,e,r){typeof r!="boolean"&&(r=e instanceof mt()),this.state=hs|ps|od|ki,t&&t.objectMode&&(this.state|=jr),r&&t&&t.readableObjectMode&&(this.state|=jr),this.highWaterMark=t?N_(this,t,"readableHighWaterMark",r):L_(!1),this.buffer=new B_,this.length=0,this.pipes=[],this.flowing=null,this[br]=null,t&&t.emitClose===!1&&(this.state&=~hs),t&&t.autoDestroy===!1&&(this.state&=~ps),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new nd(t.encoding),this.encoding=t.encoding)}function le(t){if(!(this instanceof le))return new le(t);let e=this instanceof mt();this._readableState=new Bi(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&&M_(t.signal,this)),Qt.call(this,t),$r.construct(this,()=>{this._readableState.needReadable&&Mi(this,this._readableState)})}le.prototype.destroy=$r.destroy;le.prototype._undestroy=$r.undestroy;le.prototype._destroy=function(t,e){e(t)};le.prototype[k_.captureRejectionSymbol]=function(t){this.destroy(t)};le.prototype[P_]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new $_,this.destroy(t)),new td((e,r)=>rd(this,n=>n&&n!==t?r(n):e(null)))};le.prototype.push=function(t,e){return ud(this,t,e,!1)};le.prototype.unshift=function(t,e){return ud(this,t,e,!0)};function ud(t,e,r,n){he("readableAddChunk",e);let i=t._readableState,s;if((i.state&jr)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=us.from(e,r).toString(i.encoding):(e=us.from(e,r),r=""))):e instanceof us?r="":Qt._isUint8Array(e)?(e=Qt._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new q_("chunk",["string","Buffer","Uint8Array"],e))),s)Fr(t,s);else if(e===null)i.state&=~mn,rw(t,i);else if((i.state&jr)!==0||e&&e.length>0)if(n)if((i.state&id)!==0)Fr(t,new j_);else{if(i.destroyed||i.errored)return!1;cs(t,i,e,!0)}else if(i.ended)Fr(t,new F_);else{if(i.destroyed||i.errored)return!1;i.state&=~mn,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?cs(t,i,e,!1):Mi(t,i)):cs(t,i,e,!1)}else n||(i.state&=~mn,Mi(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function cs(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&ad)!==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&Ci)!==0&&Ni(t)),Mi(t,e)}le.prototype.isPaused=function(){let t=this._readableState;return t[br]===!0||t.flowing===!1};le.prototype.setEncoding=function(t){let e=new nd(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 ew=1073741824;function tw(t){if(t>ew)throw new U_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Zf(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&jr)!==0?1:A_(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:E_(t)||(t=I_(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=tw(t)),t!==0&&(e.state&=~sd),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?fs(this):Ni(this),null;if(t=Zf(t,e),t===0&&e.ended)return e.length===0&&fs(this),null;let n=(e.state&Ci)!==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|ki,e.length===0&&(e.state|=Ci);try{this._read(e.highWaterMark)}catch(s){Fr(this,s)}e.state&=~ki,e.reading||(t=Zf(r,e))}let i;return t>0?i=hd(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&&fs(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function rw(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?Ni(t):(e.needReadable=!1,e.emittedReadable=!0,ld(t))}}function Ni(t){let e=t._readableState;he("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(he("emitReadable",e.flowing),e.emittedReadable=!0,at.nextTick(ld,t))}function ld(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,fd(t)}function Mi(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,at.nextTick(nw,t,e))}function nw(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 D_("_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 T_(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!==at.stdout&&t!==at.stderr?u:b;n.endEmitted?at.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(m,w){he("onunpipe"),m===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,d())}function u(){he("onend"),t.end()}let c,f=!1;function d(){he("cleanup"),t.removeListener("close",I),t.removeListener("finish",S),c&&t.removeListener("drain",c),t.removeListener("error",y),t.removeListener("unpipe",o),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",_),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}function h(){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=iw(r,t),t.on("drain",c))}r.on("data",_);function _(m){he("ondata");let w=t.write(m);he("dest.write",w),w===!1&&h()}function y(m){if(he("onerror",m),b(),t.removeListener("error",y),t.listenerCount("error")===0){let w=t._writableState||t._readableState;w&&!w.errorEmitted?Fr(t,m):t.emit("error",m)}}C_(t,"error",y);function I(){t.removeListener("finish",S),b()}t.once("close",I);function S(){he("onfinish"),t.removeListener("close",I),b()}t.once("finish",S);function b(){he("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?h():n.flowing||(he("pipe resume"),r.resume()),t};function iw(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=S_(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=Qt.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?Ni(this):n.reading||at.nextTick(ow,this)),r};le.prototype.addListener=le.prototype.on;le.prototype.removeListener=function(t,e){let r=Qt.prototype.removeListener.call(this,t,e);return t==="readable"&&at.nextTick(cd,this),r};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(t){let e=Qt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&at.nextTick(cd,this),e};function cd(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[br]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function ow(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,sw(this,t)),t[br]=!1,this};function sw(t,e){e.resumeScheduled||(e.resumeScheduled=!0,at.nextTick(aw,t,e))}function aw(t,e){he("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),fd(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[br]=!0,this};function fd(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=>{Fr(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=x_(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[O_]=function(){return dd(this)};le.prototype.iterator=function(t){return t!==void 0&&W_(t,"options"),dd(this,t)};function dd(t,e){typeof t.read!="function"&&(t=le.wrap(t,{objectMode:!0}));let r=uw(t,e);return r.stream=t,r}async function*uw(t,e){let r=ls;function n(o){this===t?(r(),r=ls):r=o}t.on("readable",n);let i,s=rd(t,{writable:!1},o=>{i=o?Xf(i,o):null,r(),r=ls});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 td(n)}}}catch(o){throw i=Xf(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?$r.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(Bi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[br]!==!1},set(t){this[br]=!!t}}});le._fromList=hd;function hd(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 fs(t){let e=t._readableState;he("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,at.nextTick(lw,e,t))}function lw(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)at.nextTick(cw,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function cw(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}le.from=function(t,e){return V_(le,t,e)};var ds;function pd(){return ds===void 0&&(ds={}),ds}le.fromWeb=function(t,e){return pd().newStreamReadableFromReadableStream(t,e)};le.toWeb=function(t,e){return pd().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){$r.destroyer(t,i),s(i)}}).wrap(t)}});var Fi=H((WO,Td)=>{"use strict";x();P();T();var mr=zt(),{ArrayPrototypeSlice:md,Error:fw,FunctionPrototypeSymbolHasInstance:_d,ObjectDefineProperty:wd,ObjectDefineProperties:dw,ObjectSetPrototypeOf:vd,StringPrototypeToLowerCase:hw,Symbol:pw,SymbolHasInstance:gw}=Ee();Td.exports=Ie;Ie.WritableState=Sn;var{EventEmitter:yw}=(Ht(),_e(Vt)),wn=Ti().Stream,{Buffer:Li}=(ke(),_e(Le)),Ui=gr(),{addAbortSignal:bw}=gn(),{getHighWaterMark:mw,getDefaultHighWaterMark:_w}=yn(),{ERR_INVALID_ARG_TYPE:ww,ERR_METHOD_NOT_IMPLEMENTED:vw,ERR_MULTIPLE_CALLBACK:Sd,ERR_STREAM_CANNOT_PIPE:Sw,ERR_STREAM_DESTROYED:vn,ERR_STREAM_ALREADY_FINISHED:Ew,ERR_STREAM_NULL_VALUES:Aw,ERR_STREAM_WRITE_AFTER_END:Iw,ERR_UNKNOWN_ENCODING:Ed}=Ue().codes,{errorOrDestroy:Wr}=Ui;vd(Ie.prototype,wn.prototype);vd(Ie,wn);function ms(){}var Vr=pw("kOnFinished");function Sn(t,e,r){typeof r!="boolean"&&(r=e instanceof mt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?mw(this,t,"writableHighWaterMark",r):_w(!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=Tw.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Di(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[Vr]=[]}function Di(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Sn.prototype.getBuffer=function(){return md(this.buffered,this.bufferedIndex)};wd(Sn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ie(t){let e=this instanceof mt();if(!e&&!_d(Ie,this))return new Ie(t);this._writableState=new Sn(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&&bw(t.signal,this)),wn.call(this,t),Ui.construct(this,()=>{let r=this._writableState;r.writing||ws(this,r),vs(this,r)})}wd(Ie,gw,{__proto__:null,value:function(t){return _d(this,t)?!0:this!==Ie?!1:t&&t._writableState instanceof Sn}});Ie.prototype.pipe=function(){Wr(this,new Sw)};function Ad(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"&&!Li.isEncoding(r))throw new Ed(r);typeof n!="function"&&(n=ms)}if(e===null)throw new Aw;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Li.from(e,r),r="buffer");else if(e instanceof Li)r="buffer";else if(wn._isUint8Array(e))e=wn._uint8ArrayToBuffer(e),r="buffer";else throw new ww("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new Iw:i.destroyed&&(s=new vn("write")),s?(mr.nextTick(n,s),Wr(t,s,!0),s):(i.pendingcb++,xw(t,i,e,r,n))}Ie.prototype.write=function(t,e,r){return Ad(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||ws(this,t))};Ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=hw(e)),!Li.isEncoding(e))throw new Ed(e);return this._writableState.defaultEncoding=e,this};function xw(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!==ms&&(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 yd(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new vn("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function bd(t,e,r,n){--e.pendingcb,n(r),_s(e),Wr(t,r)}function Tw(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Wr(t,new Sd);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?mr.nextTick(bd,t,r,e,i):bd(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&ws(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},mr.nextTick(Pw,r.afterWriteTickInfo)):Id(t,r,1,i))}function Pw({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Id(t,e,r,n)}function Id(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&&_s(e),vs(t,e)}function _s(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],u=t.objectMode?1:s.length;t.length-=u,o((e=t.errored)!==null&&e!==void 0?e:new vn("write"))}let r=t[Vr].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new vn("end"))}Di(t)}function ws(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 u=e.allNoop?ms:f=>{for(let d=o;d<r.length;++d)r[d].callback(f)},c=e.allNoop&&o===0?r:md(r,o);c.allBuffers=e.allBuffers,yd(t,e,!0,e.length,c,"",u),Di(e)}else{do{let{chunk:u,encoding:c,callback:f}=r[o];r[o++]=null;let d=i?1:u.length;yd(t,e,!1,d,u,c,f)}while(o<r.length&&!e.writing);o===r.length?Di(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 vw("_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=Ad(this,t,e);s instanceof fw&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,vs(this,n,!0),n.ended=!0):n.finished?i=new Ew("end"):n.destroyed&&(i=new vn("end"))),typeof r=="function"&&(i||n.finished?mr.nextTick(r,i):n[Vr].push(r)),this};function qi(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 Ow(t,e){let r=!1;function n(i){if(r){Wr(t,i??Sd());return}if(r=!0,e.pendingcb--,i){let s=e[Vr].splice(0);for(let o=0;o<s.length;o++)s[o](i);Wr(t,i,e.sync)}else qi(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,mr.nextTick(bs,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function Rw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Ow(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function vs(t,e,r){qi(e)&&(Rw(t,e),e.pendingcb===0&&(r?(e.pendingcb++,mr.nextTick((n,i)=>{qi(i)?bs(n,i):i.pendingcb--},t,e)):qi(e)&&(e.pendingcb++,bs(t,e))))}function bs(t,e){e.pendingcb--,e.finished=!0;let r=e[Vr].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()}}dw(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 kw=Ui.destroy;Ie.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Vr].length)&&mr.nextTick(_s,r),kw.call(this,t,e),this};Ie.prototype._undestroy=Ui.undestroy;Ie.prototype._destroy=function(t,e){e(t)};Ie.prototype[yw.captureRejectionSymbol]=function(t){this.destroy(t)};var ys;function xd(){return ys===void 0&&(ys={}),ys}Ie.fromWeb=function(t,e){return xd().newStreamWritableFromWritableStream(t,e)};Ie.toWeb=function(t){return xd().newWritableStreamFromStreamWritable(t)}});var $d=H((ZO,jd)=>{x();P();T();var Ss=zt(),Cw=(ke(),_e(Le)),{isReadable:Mw,isWritable:Bw,isIterable:Pd,isNodeStream:Nw,isReadableNodeStream:Od,isWritableNodeStream:Rd,isDuplexNodeStream:Lw,isReadableStream:kd,isWritableStream:Cd}=gt(),Md=Pt(),{AbortError:Ud,codes:{ERR_INVALID_ARG_TYPE:qw,ERR_INVALID_RETURN_VALUE:Bd}}=Ue(),{destroyer:zr}=gr(),Dw=mt(),Fd=_n(),Uw=Fi(),{createDeferredPromise:Nd}=We(),Ld=as(),qd=globalThis.Blob||Cw.Blob,Fw=typeof qd<"u"?function(e){return e instanceof qd}:function(e){return!1},jw=globalThis.AbortController||Nr().AbortController,{FunctionPrototypeCall:Dd}=Ee(),Kt=class extends Dw{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)}};jd.exports=function t(e,r){if(Lw(e))return e;if(Od(e))return Hr({readable:e});if(Rd(e))return Hr({writable:e});if(Nw(e))return Hr({writable:!1,readable:!1});if(kd(e))return Hr({readable:Fd.fromWeb(e)});if(Cd(e))return Hr({writable:Uw.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:u}=$w(e);if(Pd(i))return Ld(Kt,i,{objectMode:!0,write:s,final:o,destroy:u});let c=i?.then;if(typeof c=="function"){let f,d=Dd(c,i,h=>{if(h!=null)throw new Bd("nully","body",h)},h=>{zr(f,h)});return f=new Kt({objectMode:!0,readable:!1,write:s,final(h){o(async()=>{try{await d,Ss.nextTick(h,null)}catch(_){Ss.nextTick(h,_)}})},destroy:u})}throw new Bd("Iterable, AsyncIterable or AsyncFunction",r,i)}if(Fw(e))return t(e.arrayBuffer());if(Pd(e))return Ld(Kt,e,{objectMode:!0,writable:!1});if(kd(e?.readable)&&Cd(e?.writable))return Kt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?Od(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?Rd(e?.writable)?e?.writable:t(e.writable):void 0;return Hr({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return Dd(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{zr(i,s)}),i=new Kt({objectMode:!0,writable:!1,read(){}})}throw new qw(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function $w(t){let{promise:e,resolve:r}=Nd(),n=new jw,i=n.signal;return{value:t((async function*(){for(;;){let o=e;e=null;let{chunk:u,done:c,cb:f}=await o;if(Ss.nextTick(f),c)return;if(i.aborted)throw new Ud(void 0,{cause:i.reason});({promise:e,resolve:r}=Nd()),yield u}})(),{signal:i}),write(o,u,c){let f=r;r=null,f({chunk:o,done:!1,cb:c})},final(o){let u=r;r=null,u({done:!0,cb:o})},destroy(o,u){n.abort(),u(o)}}}function Hr(t){let e=t.readable&&typeof t.readable.read!="function"?Fd.wrap(t.readable):t.readable,r=t.writable,n=!!Mw(e),i=!!Bw(r),s,o,u,c,f;function d(h){let _=c;c=null,_?_(h):h&&f.destroy(h)}return f=new Kt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Md(r,h=>{i=!1,h&&zr(e,h),d(h)}),f._write=function(h,_,y){r.write(h,_)?y():s=y},f._final=function(h){r.end(),o=h},r.on("drain",function(){if(s){let h=s;s=null,h()}}),r.on("finish",function(){if(o){let h=o;o=null,h()}})),n&&(Md(e,h=>{n=!1,h&&zr(e,h),d(h)}),e.on("readable",function(){if(u){let h=u;u=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){u=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,_){!h&&c!==null&&(h=new Ud),u=null,s=null,o=null,c===null?_(h):(c=_,zr(r,h),zr(e,h))},f}});var mt=H((lR,Hd)=>{"use strict";x();P();T();var{ObjectDefineProperties:Ww,ObjectGetOwnPropertyDescriptor:Ot,ObjectKeys:Vw,ObjectSetPrototypeOf:Wd}=Ee();Hd.exports=ut;var Is=_n(),et=Fi();Wd(ut.prototype,Is.prototype);Wd(ut,Is);{let t=Vw(et.prototype);for(let e=0;e<t.length;e++){let r=t[e];ut.prototype[r]||(ut.prototype[r]=et.prototype[r])}}function ut(t){if(!(this instanceof ut))return new ut(t);Is.call(this,t),et.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}Ww(ut.prototype,{writable:{__proto__:null,...Ot(et.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ot(et.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ot(et.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ot(et.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ot(et.prototype,"writableLength")},writableFinished:{__proto__:null,...Ot(et.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ot(et.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ot(et.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ot(et.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 Es;function Vd(){return Es===void 0&&(Es={}),Es}ut.fromWeb=function(t,e){return Vd().newStreamDuplexFromReadableWritablePair(t,e)};ut.toWeb=function(t){return Vd().newReadableWritablePairFromDuplex(t)};var As;ut.from=function(t){return As||(As=$d()),As(t,"body")}});var Ps=H((_R,Gd)=>{"use strict";x();P();T();var{ObjectSetPrototypeOf:zd,Symbol:Hw}=Ee();Gd.exports=Rt;var{ERR_METHOD_NOT_IMPLEMENTED:zw}=Ue().codes,Ts=mt(),{getHighWaterMark:Gw}=yn();zd(Rt.prototype,Ts.prototype);zd(Rt,Ts);var En=Hw("kCallback");function Rt(t){if(!(this instanceof Rt))return new Rt(t);let e=t?Gw(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Ts.call(this,t),this._readableState.sync=!1,this[En]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Qw)}function xs(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 Qw(){this._final!==xs&&xs.call(this)}Rt.prototype._final=xs;Rt.prototype._transform=function(t,e,r){throw new zw("_transform()")};Rt.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,u)=>{if(o){r(o);return}u!=null&&this.push(u),i.ended||s===n.length||n.length<n.highWaterMark?r():this[En]=r})};Rt.prototype._read=function(){if(this[En]){let t=this[En];this[En]=null,t()}}});var Rs=H((OR,Kd)=>{"use strict";x();P();T();var{ObjectSetPrototypeOf:Qd}=Ee();Kd.exports=Gr;var Os=Ps();Qd(Gr.prototype,Os.prototype);Qd(Gr,Os);function Gr(t){if(!(this instanceof Gr))return new Gr(t);Os.call(this,t)}Gr.prototype._transform=function(t,e,r){r(null,t)}});var Vi=H((UR,eh)=>{x();P();T();var An=zt(),{ArrayIsArray:Kw,Promise:Yw,SymbolAsyncIterator:Jw,SymbolDispose:Xw}=Ee(),Wi=Pt(),{once:Zw}=We(),ev=gr(),Yd=mt(),{aggregateTwoErrors:tv,codes:{ERR_INVALID_ARG_TYPE:Us,ERR_INVALID_RETURN_VALUE:ks,ERR_MISSING_ARGS:rv,ERR_STREAM_DESTROYED:nv,ERR_STREAM_PREMATURE_CLOSE:iv},AbortError:ov}=Ue(),{validateFunction:sv,validateAbortSignal:av}=qr(),{isIterable:_r,isReadable:Cs,isReadableNodeStream:$i,isNodeStream:Jd,isTransformStream:Qr,isWebStream:uv,isReadableStream:Ms,isReadableFinished:lv}=gt(),cv=globalThis.AbortController||Nr().AbortController,Bs,Ns,Ls;function Xd(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Wi(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,ev.destroyer(t,s||new nv("pipe")))},cleanup:i}}function fv(t){return sv(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function qs(t){if(_r(t))return t;if($i(t))return dv(t);throw new Us("val",["Readable","Iterable","AsyncIterable"],t)}async function*dv(t){Ns||(Ns=_n()),yield*Ns.prototype[Jw].call(t)}async function ji(t,e,r,{end:n}){let i,s=null,o=f=>{if(f&&(i=f),s){let d=s;s=null,d()}},u=()=>new Yw((f,d)=>{i?d(i):s=()=>{i?d(i):f()}});e.on("drain",o);let c=Wi(e,{readable:!1},o);try{e.writableNeedDrain&&await u();for await(let f of t)e.write(f)||await u();n&&(e.end(),await u()),r()}catch(f){r(i!==f?tv(i,f):f)}finally{c(),e.off("drain",o)}}async function Ds(t,e,r,{end:n}){Qr(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 hv(...t){return Zd(t,Zw(fv(t)))}function Zd(t,e,r){if(t.length===1&&Kw(t[0])&&(t=t[0]),t.length<2)throw new rv("streams");let n=new cv,i=n.signal,s=r?.signal,o=[];av(s,"options.signal");function u(){I(new ov)}Ls=Ls||We().addAbortListener;let c;s&&(c=Ls(s,u));let f,d,h=[],_=0;function y(R){I(R,--_===0)}function I(R,A){var g;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!A)){for(;h.length;)h.shift()(f);(g=c)===null||g===void 0||g[Xw](),n.abort(),A&&(f||o.forEach(O=>O()),An.nextTick(e,f,d))}}let S;for(let R=0;R<t.length;R++){let A=t[R],g=R<t.length-1,O=R>0,v=g||r?.end!==!1,B=R===t.length-1;if(Jd(A)){let D=function(L){L&&L.name!=="AbortError"&&L.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y(L)};var w=D;if(v){let{destroy:L,cleanup:K}=Xd(A,g,O);h.push(L),Cs(A)&&B&&o.push(K)}A.on("error",D),Cs(A)&&B&&o.push(()=>{A.removeListener("error",D)})}if(R===0)if(typeof A=="function"){if(S=A({signal:i}),!_r(S))throw new ks("Iterable, AsyncIterable or Stream","source",S)}else _r(A)||$i(A)||Qr(A)?S=A:S=Yd.from(A);else if(typeof A=="function"){if(Qr(S)){var b;S=qs((b=S)===null||b===void 0?void 0:b.readable)}else S=qs(S);if(S=A(S,{signal:i}),g){if(!_r(S,!0))throw new ks("AsyncIterable",`transform[${R-1}]`,S)}else{var m;Bs||(Bs=Rs());let D=new Bs({objectMode:!0}),L=(m=S)===null||m===void 0?void 0:m.then;if(typeof L=="function")_++,L.call(S,$=>{d=$,$!=null&&D.write($),v&&D.end(),An.nextTick(y)},$=>{D.destroy($),An.nextTick(y,$)});else if(_r(S,!0))_++,ji(S,D,y,{end:v});else if(Ms(S)||Qr(S)){let $=S.readable||S;_++,ji($,D,y,{end:v})}else throw new ks("AsyncIterable or Promise","destination",S);S=D;let{destroy:K,cleanup:U}=Xd(S,!1,!0);h.push(K),B&&o.push(U)}}else if(Jd(A)){if($i(S)){_+=2;let D=pv(S,A,y,{end:v});Cs(A)&&B&&o.push(D)}else if(Qr(S)||Ms(S)){let D=S.readable||S;_++,ji(D,A,y,{end:v})}else if(_r(S))_++,ji(S,A,y,{end:v});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else if(uv(A)){if($i(S))_++,Ds(qs(S),A,y,{end:v});else if(Ms(S)||_r(S))_++,Ds(S,A,y,{end:v});else if(Qr(S))_++,Ds(S.readable,A,y,{end:v});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else S=Yd.from(A)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&An.nextTick(u),S}function pv(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new iv)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;lv(t)?An.nextTick(o):t.once("end",o)}else r();return Wi(t,{readable:!0,writable:!1},o=>{let u=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?t.once("end",r).once("error",r):r(o)}),Wi(e,{readable:!1,writable:!0},r)}eh.exports={pipelineImpl:Zd,pipeline:hv}});var js=H((KR,sh)=>{"use strict";x();P();T();var{pipeline:gv}=Vi(),Hi=mt(),{destroyer:yv}=gr(),{isNodeStream:zi,isReadable:th,isWritable:rh,isWebStream:Fs,isTransformStream:wr,isWritableStream:nh,isReadableStream:ih}=gt(),{AbortError:bv,codes:{ERR_INVALID_ARG_VALUE:oh,ERR_MISSING_ARGS:mv}}=Ue(),_v=Pt();sh.exports=function(...e){if(e.length===0)throw new mv("streams");if(e.length===1)return Hi.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Hi.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Hi.from(e[y])}for(let y=0;y<e.length;++y)if(!(!zi(e[y])&&!Fs(e[y]))){if(y<e.length-1&&!(th(e[y])||ih(e[y])||wr(e[y])))throw new oh(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(rh(e[y])||nh(e[y])||wr(e[y])))throw new oh(`streams[${y}]`,r[y],"must be writable")}let n,i,s,o,u;function c(y){let I=o;o=null,I?I(y):y?u.destroy(y):!_&&!h&&u.destroy()}let f=e[0],d=gv(e,c),h=!!(rh(f)||nh(f)||wr(f)),_=!!(th(d)||ih(d)||wr(d));if(u=new Hi({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:_}),h){if(zi(f))u._write=function(I,S,b){f.write(I,S)?b():n=b},u._final=function(I){f.end(),i=I},f.on("drain",function(){if(n){let I=n;n=null,I()}});else if(Fs(f)){let S=(wr(f)?f.writable:f).getWriter();u._write=async function(b,m,w){try{await S.ready,S.write(b).catch(()=>{}),w()}catch(R){w(R)}},u._final=async function(b){try{await S.ready,S.close().catch(()=>{}),i=b}catch(m){b(m)}}}let y=wr(d)?d.readable:d;_v(y,()=>{if(i){let I=i;i=null,I()}})}if(_){if(zi(d))d.on("readable",function(){if(s){let y=s;s=null,y()}}),d.on("end",function(){u.push(null)}),u._read=function(){for(;;){let y=d.read();if(y===null){s=u._read;return}if(!u.push(y))return}};else if(Fs(d)){let I=(wr(d)?d.readable:d).getReader();u._read=async function(){for(;;)try{let{value:S,done:b}=await I.read();if(!u.push(S))return;if(b){u.push(null);return}}catch{return}}}}return u._destroy=function(y,I){!y&&o!==null&&(y=new bv),s=null,n=null,i=null,o===null?I(y):(o=I,zi(d)&&yv(d,y))},u}});var yh=H((ok,Vs)=>{"use strict";x();P();T();var wv=globalThis.AbortController||Nr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:vv,ERR_INVALID_ARG_TYPE:In,ERR_MISSING_ARGS:Sv,ERR_OUT_OF_RANGE:Ev},AbortError:_t}=Ue(),{validateAbortSignal:vr,validateInteger:ah,validateObject:Sr}=qr(),Av=Ee().Symbol("kWeak"),Iv=Ee().Symbol("kResistStopPropagation"),{finished:xv}=Pt(),Tv=js(),{addAbortSignalNoValidate:Pv}=gn(),{isWritable:Ov,isNodeStream:Rv}=gt(),{deprecate:kv}=We(),{ArrayPrototypePush:Cv,Boolean:Mv,MathFloor:uh,Number:Bv,NumberIsNaN:Nv,Promise:lh,PromiseReject:ch,PromiseResolve:Lv,PromisePrototypeThen:fh,Symbol:hh}=Ee(),Gi=hh("kEmpty"),dh=hh("kEof");function qv(t,e){if(e!=null&&Sr(e,"options"),e?.signal!=null&&vr(e.signal,"options.signal"),Rv(t)&&!Ov(t))throw new vv("stream",t,"must be writable");let r=Tv(this,t);return e!=null&&e.signal&&Pv(e.signal,r),r}function Qi(t,e){if(typeof t!="function")throw new In("fn",["Function","AsyncFunction"],t);e!=null&&Sr(e,"options"),e?.signal!=null&&vr(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=uh(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=uh(e.highWaterMark)),ah(r,"options.concurrency",1),ah(n,"options.highWaterMark",0),n+=r,async function*(){let s=We().AbortSignalAny([e?.signal].filter(Mv)),o=this,u=[],c={signal:s},f,d,h=!1,_=0;function y(){h=!0,I()}function I(){_-=1,S()}function S(){d&&!h&&_<r&&u.length<n&&(d(),d=null)}async function b(){try{for await(let m of o){if(h)return;if(s.aborted)throw new _t;try{if(m=t(m,c),m===Gi)continue;m=Lv(m)}catch(w){m=ch(w)}_+=1,fh(m,I,y),u.push(m),f&&(f(),f=null),!h&&(u.length>=n||_>=r)&&await new lh(w=>{d=w})}u.push(dh)}catch(m){let w=ch(m);fh(w,I,y),u.push(w)}finally{h=!0,f&&(f(),f=null)}}b();try{for(;;){for(;u.length>0;){let m=await u[0];if(m===dh)return;if(s.aborted)throw new _t;m!==Gi&&(yield m),u.shift(),S()}await new lh(m=>{f=m})}}finally{h=!0,d&&(d(),d=null)}}.call(this)}function Dv(t=void 0){return t!=null&&Sr(t,"options"),t?.signal!=null&&vr(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 _t({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function ph(t,e=void 0){for await(let r of Ws.call(this,t,e))return!0;return!1}async function Uv(t,e=void 0){if(typeof t!="function")throw new In("fn",["Function","AsyncFunction"],t);return!await ph.call(this,async(...r)=>!await t(...r),e)}async function Fv(t,e){for await(let r of Ws.call(this,t,e))return r}async function jv(t,e){if(typeof t!="function")throw new In("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Gi}for await(let n of Qi.call(this,r,e));}function Ws(t,e){if(typeof t!="function")throw new In("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Gi}return Qi.call(this,r,e)}var $s=class extends Sv{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function $v(t,e,r){var n;if(typeof t!="function")throw new In("reducer",["Function","AsyncFunction"],t);r!=null&&Sr(r,"options"),r?.signal!=null&&vr(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new _t(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await xv(this.destroy(f)),f}let s=new wv,o=s.signal;if(r!=null&&r.signal){let f={once:!0,[Av]:this,[Iv]:!0};r.signal.addEventListener("abort",()=>s.abort(),f)}let u=!1;try{for await(let f of this){var c;if(u=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new _t;i?e=await t(e,f,{signal:o}):(e=f,i=!0)}if(!u&&!i)throw new $s}finally{s.abort()}return e}async function Wv(t){t!=null&&Sr(t,"options"),t?.signal!=null&&vr(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 _t(void 0,{cause:t.signal.reason});Cv(e,n)}return e}function Vv(t,e){let r=Qi.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function gh(t){if(t=Bv(t),Nv(t))return 0;if(t<0)throw new Ev("number",">= 0",t);return t}function Hv(t,e=void 0){return e!=null&&Sr(e,"options"),e?.signal!=null&&vr(e.signal,"options.signal"),t=gh(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _t;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _t;t--<=0&&(yield s)}}.call(this)}function zv(t,e=void 0){return e!=null&&Sr(e,"options"),e?.signal!=null&&vr(e.signal,"options.signal"),t=gh(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _t;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _t;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Vs.exports.streamReturningOperators={asIndexedPairs:kv(Dv,"readable.asIndexedPairs will be removed in a future version."),drop:Hv,filter:Ws,flatMap:Vv,map:Qi,take:zv,compose:qv};Vs.exports.promiseReturningOperators={every:Uv,forEach:jv,reduce:$v,toArray:Wv,some:ph,find:Fv}});var Hs=H((gk,bh)=>{"use strict";x();P();T();var{ArrayPrototypePop:Gv,Promise:Qv}=Ee(),{isIterable:Kv,isNodeStream:Yv,isWebStream:Jv}=gt(),{pipelineImpl:Xv}=Vi(),{finished:Zv}=Pt();zs();function e0(...t){return new Qv((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!Yv(s)&&!Kv(s)&&!Jv(s)){let o=Gv(t);n=o.signal,i=o.end}Xv(t,(o,u)=>{o?r(o):e(u)},{signal:n,end:i})})}bh.exports={finished:Zv,pipeline:e0}});var zs=H((Ik,xh)=>{"use strict";x();P();T();var{Buffer:t0}=(ke(),_e(Le)),{ObjectDefineProperty:kt,ObjectKeys:wh,ReflectApply:vh}=Ee(),{promisify:{custom:Sh}}=We(),{streamReturningOperators:mh,promiseReturningOperators:_h}=yh(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Eh}}=Ue(),r0=js(),{setDefaultHighWaterMark:n0,getDefaultHighWaterMark:i0}=yn(),{pipeline:Ah}=Vi(),{destroyer:o0}=gr(),Ih=Pt(),Gs=Hs(),xn=gt(),Se=xh.exports=Ti().Stream;Se.isDestroyed=xn.isDestroyed;Se.isDisturbed=xn.isDisturbed;Se.isErrored=xn.isErrored;Se.isReadable=xn.isReadable;Se.isWritable=xn.isWritable;Se.Readable=_n();for(let t of wh(mh)){let r=function(...n){if(new.target)throw Eh();return Se.Readable.from(vh(e,this,n))},e=mh[t];kt(r,"name",{__proto__:null,value:e.name}),kt(r,"length",{__proto__:null,value:e.length}),kt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of wh(_h)){let r=function(...n){if(new.target)throw Eh();return vh(e,this,n)},e=_h[t];kt(r,"name",{__proto__:null,value:e.name}),kt(r,"length",{__proto__:null,value:e.length}),kt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}Se.Writable=Fi();Se.Duplex=mt();Se.Transform=Ps();Se.PassThrough=Rs();Se.pipeline=Ah;var{addAbortSignal:s0}=gn();Se.addAbortSignal=s0;Se.finished=Ih;Se.destroy=o0;Se.compose=r0;Se.setDefaultHighWaterMark=n0;Se.getDefaultHighWaterMark=i0;kt(Se,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Gs}});kt(Ah,Sh,{__proto__:null,enumerable:!0,get(){return Gs.pipeline}});kt(Ih,Sh,{__proto__:null,enumerable:!0,get(){return Gs.finished}});Se.Stream=Se;Se._isUint8Array=function(e){return e instanceof Uint8Array};Se._uint8ArrayToBuffer=function(e){return t0.from(e.buffer,e.byteOffset,e.byteLength)}});var Yt=H((Nk,Pe)=>{"use strict";x();P();T();var Me=zs(),a0=Hs(),u0=Me.Readable.destroy;Pe.exports=Me.Readable;Pe.exports._uint8ArrayToBuffer=Me._uint8ArrayToBuffer;Pe.exports._isUint8Array=Me._isUint8Array;Pe.exports.isDisturbed=Me.isDisturbed;Pe.exports.isErrored=Me.isErrored;Pe.exports.isReadable=Me.isReadable;Pe.exports.Readable=Me.Readable;Pe.exports.Writable=Me.Writable;Pe.exports.Duplex=Me.Duplex;Pe.exports.Transform=Me.Transform;Pe.exports.PassThrough=Me.PassThrough;Pe.exports.addAbortSignal=Me.addAbortSignal;Pe.exports.finished=Me.finished;Pe.exports.destroy=Me.destroy;Pe.exports.destroy=u0;Pe.exports.pipeline=Me.pipeline;Pe.exports.compose=Me.compose;Object.defineProperty(Me,"promises",{configurable:!0,enumerable:!0,get(){return a0}});Pe.exports.Stream=Me.Stream;Pe.exports.default=Pe.exports});var Th=H((Hk,Qs)=>{x();P();T();typeof Object.create=="function"?Qs.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qs.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 Rh=H((tC,Oh)=>{"use strict";x();P();T();var{Buffer:lt}=(ke(),_e(Le)),Ph=Symbol.for("BufferList");function me(t){if(!(this instanceof me))return new me(t);me._init.call(this,t)}me._init=function(e){Object.defineProperty(this,Ph,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};me.prototype._new=function(e){return new me(e)};me.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}};me.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};me.prototype.getBuffers=function(){return this._bufs};me.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};me.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)};me.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||lt.alloc(0);let s=!!e,o=this._offset(n),u=i-n,c=u,f=s&&r||0,d=o[1];if(n===0&&i===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:lt.concat(this._bufs,this.length);for(let h=0;h<this._bufs.length;h++)this._bufs[h].copy(e,f),f+=this._bufs[h].length;return e}if(c<=this._bufs[o[0]].length-d)return s?this._bufs[o[0]].copy(e,r,d,d+c):this._bufs[o[0]].slice(d,d+c);s||(e=lt.allocUnsafe(u));for(let h=o[0];h<this._bufs.length;h++){let _=this._bufs[h].length-d;if(c>_)this._bufs[h].copy(e,f,d),f+=_;else{this._bufs[h].copy(e,f,d,d+c),f+=_;break}c-=_,d&&(d=0)}return e.length>f?e.slice(0,f):e};me.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)};me.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};me.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};me.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};me.prototype.append=function(e){return this._attach(e,me.prototype._appendBuffer)};me.prototype.prepend=function(e){return this._attach(e,me.prototype._prependBuffer,!0)};me.prototype._attach=function(e,r,n){if(e==null)return this;if(e.buffer)r.call(this,lt.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,lt.from(e));return this};me.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};me.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length};me.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=lt.from([t]):typeof t=="string"?t=lt.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=lt.from(t.buffer,t.byteOffset,t.byteLength):lt.isBuffer(t)||(t=lt.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};me.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?me.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:me.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)}})(e)})();me.prototype._isBufferList=function(e){return e instanceof me||me.isBufferList(e)};me.isBufferList=function(e){return e!=null&&e[Ph]};Oh.exports=me});var kh=H((fC,Ki)=>{"use strict";x();P();T();var Ks=Yt().Duplex,l0=Th(),Tn=Rh();function je(t){if(!(this instanceof je))return new je(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}Tn._init.call(this,t),Ks.call(this)}l0(je,Ks);Object.assign(je.prototype,Tn.prototype);je.prototype._new=function(e){return new je(e)};je.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n()};je.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)};je.prototype.end=function(e){Ks.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};je.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};je.prototype._isBufferList=function(e){return e instanceof je||e instanceof Tn||je.isBufferList(e)};je.isBufferList=Tn.isBufferList;Ki.exports=je;Ki.exports.BufferListStream=je;Ki.exports.BufferList=Tn});var Mh=H((vC,Ch)=>{x();P();T();var Ys=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};Ch.exports=Ys});var Js=H((kC,Bh)=>{x();P();T();var Q=Bh.exports,{Buffer:Ge}=(ke(),_e(Le));Q.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"};Q.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};Q.requiredHeaderFlagsErrors={};for(let t in Q.requiredHeaderFlags){let e=Q.requiredHeaderFlags[t];Q.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+Q.types[t]+" packet"}Q.codes={};for(let t in Q.types){let e=Q.types[t];Q.codes[e]=t}Q.CMD_SHIFT=4;Q.CMD_MASK=240;Q.DUP_MASK=8;Q.QOS_MASK=3;Q.QOS_SHIFT=1;Q.RETAIN_MASK=1;Q.VARBYTEINT_MASK=127;Q.VARBYTEINT_FIN_MASK=128;Q.VARBYTEINT_MAX=268435455;Q.SESSIONPRESENT_MASK=1;Q.SESSIONPRESENT_HEADER=Ge.from([Q.SESSIONPRESENT_MASK]);Q.CONNACK_HEADER=Ge.from([Q.codes.connack<<Q.CMD_SHIFT]);Q.USERNAME_MASK=128;Q.PASSWORD_MASK=64;Q.WILL_RETAIN_MASK=32;Q.WILL_QOS_MASK=24;Q.WILL_QOS_SHIFT=3;Q.WILL_FLAG_MASK=4;Q.CLEAN_SESSION_MASK=2;Q.CONNECT_HEADER=Ge.from([Q.codes.connect<<Q.CMD_SHIFT]);Q.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};Q.propertiesCodes={};for(let t in Q.properties){let e=Q.properties[t];Q.propertiesCodes[e]=t}Q.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(n=>{let i=Ge.alloc(1);return i.writeUInt8(Q.codes[t]<<Q.CMD_SHIFT|(r?Q.DUP_MASK:0)|e<<Q.QOS_SHIFT|n,0,!0),i})))}Q.PUBLISH_HEADER=Jt("publish");Q.SUBSCRIBE_HEADER=Jt("subscribe");Q.SUBSCRIBE_OPTIONS_QOS_MASK=3;Q.SUBSCRIBE_OPTIONS_NL_MASK=1;Q.SUBSCRIBE_OPTIONS_NL_SHIFT=2;Q.SUBSCRIBE_OPTIONS_RAP_MASK=1;Q.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;Q.SUBSCRIBE_OPTIONS_RH_MASK=3;Q.SUBSCRIBE_OPTIONS_RH_SHIFT=4;Q.SUBSCRIBE_OPTIONS_RH=[0,16,32];Q.SUBSCRIBE_OPTIONS_NL=4;Q.SUBSCRIBE_OPTIONS_RAP=8;Q.SUBSCRIBE_OPTIONS_QOS=[0,1,2];Q.UNSUBSCRIBE_HEADER=Jt("unsubscribe");Q.ACKS={unsuback:Jt("unsuback"),puback:Jt("puback"),pubcomp:Jt("pubcomp"),pubrel:Jt("pubrel"),pubrec:Jt("pubrec")};Q.SUBACK_HEADER=Ge.from([Q.codes.suback<<Q.CMD_SHIFT]);Q.VERSION3=Ge.from([3]);Q.VERSION4=Ge.from([4]);Q.VERSION5=Ge.from([5]);Q.VERSION131=Ge.from([131]);Q.VERSION132=Ge.from([132]);Q.QOS=[0,1,2].map(t=>Ge.from([t]));Q.EMPTY={pingreq:Ge.from([Q.codes.pingreq<<4,0]),pingresp:Ge.from([Q.codes.pingresp<<4,0]),disconnect:Ge.from([Q.codes.disconnect<<4,0])};Q.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"};Q.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};Q.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"};Q.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"};Q.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"};Q.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var Lh=H((jC,Nh)=>{x();P();T();var Kr=1e3,Yr=Kr*60,Jr=Yr*60,Er=Jr*24,c0=Er*7,f0=Er*365.25;Nh.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return d0(t);if(r==="number"&&isFinite(t))return e.long?p0(t):h0(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function d0(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*f0;case"weeks":case"week":case"w":return r*c0;case"days":case"day":case"d":return r*Er;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Jr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Yr;case"seconds":case"second":case"secs":case"sec":case"s":return r*Kr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function h0(t){var e=Math.abs(t);return e>=Er?Math.round(t/Er)+"d":e>=Jr?Math.round(t/Jr)+"h":e>=Yr?Math.round(t/Yr)+"m":e>=Kr?Math.round(t/Kr)+"s":t+"ms"}function p0(t){var e=Math.abs(t);return e>=Er?Yi(t,e,Er,"day"):e>=Jr?Yi(t,e,Jr,"hour"):e>=Yr?Yi(t,e,Yr,"minute"):e>=Kr?Yi(t,e,Kr,"second"):t+" ms"}function Yi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Dh=H((JC,qh)=>{x();P();T();function g0(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=u,r.humanize=Lh(),r.destroy=f,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let h=0;for(let _=0;_<d.length;_++)h=(h<<5)-h+d.charCodeAt(_),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(d){let h,_=null,y,I;function S(...b){if(!S.enabled)return;let m=S,w=Number(new Date),R=w-(h||w);m.diff=R,m.prev=h,m.curr=w,h=w,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,v)=>{if(O==="%%")return"%";A++;let B=r.formatters[v];if(typeof B=="function"){let D=b[A];O=B.call(m,D),b.splice(A,1),A--}return O}),r.formatArgs.call(m,b),(m.log||r.log).apply(m,b)}return S.namespace=d,S.useColors=r.useColors(),S.color=r.selectColor(d),S.extend=n,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(y!==r.namespaces&&(y=r.namespaces,I=r.enabled(d)),I),set:b=>{_=b}}),typeof r.init=="function"&&r.init(S),S}function n(d,h){let _=r(this.namespace+(typeof h>"u"?":":h)+d);return _.log=this.log,_}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let h=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of h)_[0]==="-"?r.skips.push(_.slice(1)):r.names.push(_)}function s(d,h){let _=0,y=0,I=-1,S=0;for(;_<d.length;)if(y<h.length&&(h[y]===d[_]||h[y]==="*"))h[y]==="*"?(I=y,S=_,y++):(_++,y++);else if(I!==-1)y=I+1,S++,_=S;else return!1;for(;y<h.length&&h[y]==="*";)y++;return y===h.length}function o(){let d=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),d}function u(d){for(let h of r.skips)if(s(d,h))return!1;for(let h of r.names)if(s(d,h))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}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}qh.exports=g0});var Xt=H((Qe,Ji)=>{x();P();T();Qe.formatArgs=b0;Qe.save=m0;Qe.load=_0;Qe.useColors=y0;Qe.storage=w0();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 y0(){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 b0(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ji.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 m0(t){try{t?Qe.storage.setItem("debug",t):Qe.storage.removeItem("debug")}catch{}}function _0(){let t;try{t=Qe.storage.getItem("debug")||Qe.storage.getItem("DEBUG")}catch{}return!t&&typeof q<"u"&&"env"in q&&(t=q.env.DEBUG),t}function w0(){try{return localStorage}catch{}}Ji.exports=Dh()(Qe);var{formatters:v0}=Ji.exports;v0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var jh=H((yM,Fh)=>{x();P();T();var S0=kh(),{EventEmitter:E0}=(Ht(),_e(Vt)),Uh=Mh(),pe=Js(),ae=Xt()("mqtt-packet:parser"),Xs=class t extends E0{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 Uh,this.error=null,this._list=S0(),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>>pe.CMD_SHIFT;this.packet.cmd=pe.types[r];let n=e&15,i=pe.requiredHeaderFlags[r];return i!=null&&n!==i?this._emitError(new Error(pe.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&pe.RETAIN_MASK)!==0,this.packet.qos=e>>pe.QOS_SHIFT&pe.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&pe.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,u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse protocolId"));if(u!=="MQTT"&&u!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=u,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)&pe.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&pe.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&pe.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&pe.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&pe.WILL_QOS_MASK)>>pe.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)&pe.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 h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.properties=h)}let d=this._parseString();if(d===null)return this._emitError(new Error("Packet too short"));if(o.clientId=d,ae("_parseConnect: packet.clientId: %s",o.clientId),s.will){if(o.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.will.properties=h)}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&pe.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,u,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&pe.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(u=(n>>pe.SUBSCRIBE_OPTIONS_NL_SHIFT&pe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,o=(n>>pe.SUBSCRIBE_OPTIONS_RAP_SHIFT&pe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,s=n>>pe.SUBSCRIBE_OPTIONS_RH_SHIFT&pe.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=u,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(!pe.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(!pe.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(!pe.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!pe.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(),pe.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(),!pe.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,u,c=this._pos?this._pos:0;for(;n<r&&c+n<this._list.length;){if(u=this._list.readUInt8(c+n++),s+=i*(u&pe.VARBYTEINT_MASK),i*=128,(u&pe.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=pe.propertiesCodes[s];if(!o)return this._emitError(new Error("Unknown property")),!1;if(o==="userProperties"){i[o]||(i[o]=Object.create(null));let u=this._parseByType(pe.propertiesTypes[o]);if(i[o][u.name])if(Array.isArray(i[o][u.name]))i[o][u.name].push(u.value);else{let c=i[o][u.name];i[o][u.name]=[c],i[o][u.name].push(u.value)}else i[o][u.name]=u.value;continue}i[o]?Array.isArray(i[o])?i[o].push(this._parseByType(pe.propertiesTypes[o])):(i[o]=[i[o]],i[o].push(this._parseByType(pe.propertiesTypes[o]))):i[o]=this._parseByType(pe.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 Uh,this._pos=0,!0}_emitError(e){ae("_emitError",e),this.error=e,this.emit("error",e)}};Fh.exports=Xs});var Hh=H((xM,Vh)=>{x();P();T();var{Buffer:Pn}=(ke(),_e(Le)),A0=65536,$h={},I0=Pn.isBuffer(Pn.from([1,2]).subarray(0,1));function Wh(t){let e=Pn.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,1),e}function x0(){for(let t=0;t<A0;t++)$h[t]=Wh(t)}function T0(t){let r=0,n=0,i=Pn.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),I0?i.subarray(0,n):i.slice(0,n)}function P0(t){let e=Pn.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Vh.exports={cache:$h,generateCache:x0,generateNumber:Wh,genBufVariableByteInt:T0,generate4ByteBuffer:P0}});var zh=H((LM,Zs)=>{"use strict";x();P();T();typeof q>"u"||!q.version||q.version.indexOf("v0.")===0||q.version.indexOf("v1.")===0&&q.version.indexOf("v1.8.")!==0?Zs.exports={nextTick:O0}:Zs.exports=q;function O0(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 q.nextTick(t);case 2:return q.nextTick(function(){t.call(null,e)});case 3:return q.nextTick(function(){t.call(null,e,r)});case 4:return q.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 q.nextTick(function(){t.apply(null,s)})}}});var ra=H((zM,ep)=>{x();P();T();var ue=Js(),{Buffer:se}=(ke(),_e(Le)),R0=se.allocUnsafe(0),k0=se.from([0]),On=Hh(),C0=zh().nextTick,tt=Xt()("mqtt-packet:writeToStream"),Xi=On.cache,M0=On.generateNumber,B0=On.generateCache,ea=On.genBufVariableByteInt,N0=On.generate4ByteBuffer,Ve=ta,Zi=!0;function Xh(t,e,r){switch(tt("generate called"),e.cork&&(e.cork(),C0(L0,e)),Zi&&(Zi=!1,B0()),tt("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return q0(t,e,r);case"connack":return D0(t,e,r);case"publish":return U0(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return F0(t,e,r);case"subscribe":return j0(t,e,r);case"suback":return $0(t,e,r);case"unsubscribe":return W0(t,e,r);case"unsuback":return V0(t,e,r);case"pingreq":case"pingresp":return H0(t,e,r);case"disconnect":return z0(t,e,r);case"auth":return G0(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Xh,"cacheNumbers",{get(){return Ve===ta},set(t){t?((!Xi||Object.keys(Xi).length===0)&&(Zi=!0),Ve=ta):(Zi=!1,Ve=Q0)}});function L0(t){t.uncork()}function q0(t,e,r){let n=t||{},i=n.protocolId||"MQTT",s=n.protocolVersion||4,o=n.will,u=n.clean,c=n.keepalive||0,f=n.clientId||"",d=n.username,h=n.password,_=n.properties;u===void 0&&(u=!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||u))y+=se.byteLength(f)+2;else{if(s<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(u*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 I,S;if(s===5){if(I=Zt(e,_),!I)return!1;y+=I.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(S={},s===5){if(S=Zt(e,o.properties),!S)return!1;y+=S.length}}let b=!1;if(d!=null)if(Jh(d))b=!0,y+=se.byteLength(d)+2;else return e.destroy(new Error("Invalid username")),!1;if(h!=null){if(!b)return e.destroy(new Error("Username is required to use password")),!1;if(Jh(h))y+=Zh(h)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(ue.CONNECT_HEADER),rt(e,y),Xr(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|=d!=null?ue.USERNAME_MASK:0,m|=h!=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|=u?ue.CLEAN_SESSION_MASK:0,e.write(se.from([m])),Ve(e,c),s===5&&I.write(),Xr(e,f),o&&(s===5&&S.write(),Ar(e,o.topic),Xr(e,o.payload)),d!=null&&Xr(e,d),h!=null&&Xr(e,h),!0}function D0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=n===5?i.reasonCode:i.returnCode,o=i.properties,u=2;if(typeof s!="number")return e.destroy(new Error("Invalid return code")),!1;let c=null;if(n===5){if(c=Zt(e,o),!c)return!1;u+=c.length}return e.write(ue.CONNACK_HEADER),rt(e,u),e.write(i.sessionPresent?ue.SESSIONPRESENT_HEADER:k0),e.write(se.from([s])),c?.write(),!0}function U0(t,e,r){tt("publish: packet: %o",t);let n=r?r.protocolVersion:4,i=t||{},s=i.qos||0,o=i.retain?ue.RETAIN_MASK:0,u=i.topic,c=i.payload||R0,f=i.messageId,d=i.properties,h=0;if(typeof u=="string")h+=se.byteLength(u)+2;else if(se.isBuffer(u))h+=u.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(se.isBuffer(c)?h+=c.length:h+=se.byteLength(c),s&&typeof f!="number")return e.destroy(new Error("Invalid messageId")),!1;s&&(h+=2);let _=null;if(n===5){if(_=Zt(e,d),!_)return!1;h+=_.length}return e.write(ue.PUBLISH_HEADER[s][i.dup?1:0][o?1:0]),rt(e,h),Ve(e,Zh(u)),e.write(u),s>0&&Ve(e,f),_?.write(),tt("publish: payload: %o",c),e.write(c)}function F0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.cmd||"puback",o=i.messageId,u=i.dup&&s==="pubrel"?ue.DUP_MASK:0,c=0,f=i.reasonCode,d=i.properties,h=n===5?3:2;if(s==="pubrel"&&(c=1),typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;let _=null;if(n===5&&typeof d=="object"){if(_=Rn(e,d,r,h),!_)return!1;h+=_.length}return e.write(ue.ACKS[s][c][u][0]),h===3&&(h+=f!==0?1:-1),rt(e,h),Ve(e,o),n===5&&h!==2&&e.write(se.from([f])),_!==null?_.write():h===4&&e.write(se.from([0])),!0}function j0(t,e,r){tt("subscribe: packet: ");let n=r?r.protocolVersion:4,i=t||{},s=i.dup?ue.DUP_MASK:0,o=i.messageId,u=i.subscriptions,c=i.properties,f=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;f+=2;let d=null;if(n===5){if(d=Zt(e,c),!d)return!1;f+=d.length}if(typeof u=="object"&&u.length)for(let _=0;_<u.length;_+=1){let y=u[_].topic,I=u[_].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof I!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(n===5){if(typeof(u[_].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(u[_].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let m=u[_].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;tt("subscribe: writing to stream: %o",ue.SUBSCRIBE_HEADER),e.write(ue.SUBSCRIBE_HEADER[1][s?1:0][0]),rt(e,f),Ve(e,o),d!==null&&d.write();let h=!0;for(let _ of u){let y=_.topic,I=_.qos,S=+_.nl,b=+_.rap,m=_.rh,w;Ar(e,y),w=ue.SUBSCRIBE_OPTIONS_QOS[I],n===5&&(w|=S?ue.SUBSCRIBE_OPTIONS_NL:0,w|=b?ue.SUBSCRIBE_OPTIONS_RAP:0,w|=m?ue.SUBSCRIBE_OPTIONS_RH[m]:0),h=e.write(se.from([w]))}return h}function $0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.granted,u=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 d=0;d<o.length;d+=1){if(typeof o[d]!="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=Rn(e,u,r,c),!f)return!1;c+=f.length}return e.write(ue.SUBACK_HEADER),rt(e,c),Ve(e,s),f!==null&&f.write(),e.write(se.from(o))}function W0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.unsubscriptions,c=i.properties,f=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(f+=2,typeof u=="object"&&u.length)for(let _=0;_<u.length;_+=1){if(typeof u[_]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;f+=se.byteLength(u[_])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let d=null;if(n===5){if(d=Zt(e,c),!d)return!1;f+=d.length}e.write(ue.UNSUBSCRIBE_HEADER[1][o?1:0][0]),rt(e,f),Ve(e,s),d!==null&&d.write();let h=!0;for(let _=0;_<u.length;_++)h=Ar(e,u[_]);return h}function V0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.granted,c=i.properties,f=i.cmd,d=0,h=2;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(n===5)if(typeof u=="object"&&u.length)for(let y=0;y<u.length;y+=1){if(typeof u[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;h+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let _=null;if(n===5){if(_=Rn(e,c,r,h),!_)return!1;h+=_.length}return e.write(ue.ACKS[f][d][o][0]),rt(e,h),Ve(e,s),_!==null&&_.write(),n===5&&e.write(se.from(u)),!0}function H0(t,e,r){return e.write(ue.EMPTY[t.cmd])}function z0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0,c=null;if(n===5){if(c=Rn(e,o,r,u),!c)return!1;u+=c.length}return e.write(se.from([ue.codes.disconnect<<4])),rt(e,u),n===5&&e.write(se.from([s])),c!==null&&c.write(),!0}function G0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0;n!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let c=Rn(e,o,r,u);return c?(u+=c.length,e.write(se.from([ue.codes.auth<<4])),rt(e,u),e.write(se.from([s])),c!==null&&c.write(),!0):!1}var Gh={};function rt(t,e){if(e>ue.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Gh[e];return r||(r=ea(e),e<16384&&(Gh[e]=r)),tt("writeVarByteInt: writing to stream: %o",r),t.write(r)}function Ar(t,e){let r=se.byteLength(e);return Ve(t,r),tt("writeString: %s",e),t.write(e,"utf8")}function Qh(t,e,r){Ar(t,e),Ar(t,r)}function ta(t,e){return tt("writeNumberCached: number: %d",e),tt("writeNumberCached: %o",Xi[e]),t.write(Xi[e])}function Q0(t,e){let r=M0(e);return tt("writeNumberGenerated: %o",r),t.write(r)}function K0(t,e){let r=N0(e);return tt("write4ByteNumber: %o",r),t.write(r)}function Xr(t,e){typeof e=="string"?Ar(t,e):e?(Ve(t,e.length),t.write(e)):Ve(t,0)}function Zt(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){Yh(t,{},0)}};let r=0;function n(s,o){let u=ue.propertiesTypes[s],c=0;switch(u){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(ea(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,d)=>{let h=o[d];return Array.isArray(h)?f+=h.reduce((_,y)=>(_+=3+se.byteLength(d.toString())+2+se.byteLength(y.toString()),_),0):f+=3+se.byteLength(d.toString())+2+se.byteLength(o[d].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,u=0,c=e[s];if(c!==void 0){if(Array.isArray(c))for(let f=0;f<c.length;f++){if(u=n(s,c[f]),!u)return!1;o+=u}else{if(u=n(s,c),!u)return!1;o=u}if(!o)return!1;r+=o}}return{length:se.byteLength(ea(r))+r,write(){Yh(t,e,r)}}}function Rn(t,e,r,n){let i=["reasonString","userProperties"],s=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,o=Zt(t,e);if(s)for(;n+o.length>s;){let u=i.shift();if(u&&e[u])delete e[u],o=Zt(t,e);else return!1}return o}function Kh(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]])),Xr(t,r);break}case"int16":{t.write(se.from([ue.properties[e]])),Ve(t,r);break}case"int32":{t.write(se.from([ue.properties[e]])),K0(t,r);break}case"var":{t.write(se.from([ue.properties[e]])),rt(t,r);break}case"string":{t.write(se.from([ue.properties[e]])),Ar(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]])),Qh(t,i.toString(),o.toString())}):(t.write(se.from([ue.properties[e]])),Qh(t,i.toString(),s.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Yh(t,e,r){rt(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++)Kh(t,n,i[s]);else Kh(t,n,i)}}function Zh(t){return t?t instanceof se?t.length:se.byteLength(t):0}function Jh(t){return typeof t=="string"||t instanceof se}ep.exports=Xh});var np=H((r2,rp)=>{x();P();T();var Y0=ra(),{EventEmitter:J0}=(Ht(),_e(Vt)),{Buffer:tp}=(ke(),_e(Le));function X0(t,e){let r=new na;return Y0(t,r,e),r.concat()}var na=class extends J0{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]=tp.byteLength(n[s]),e+=r[s];let o=tp.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)}};rp.exports=X0});var ip=H(eo=>{x();P();T();eo.parser=jh().parser;eo.generate=np();eo.writeToStream=ra()});var sp=H((S2,op)=>{"use strict";x();P();T();op.exports=Z0;function Zr(t){return t instanceof V?V.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function Z0(t){if(t=t||{},t.circles)return eS(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,u)=>new Map(n(Array.from(o),u))),e.set(Set,(o,u)=>new Set(n(Array.from(o),u))),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,u){let c=Object.keys(o),f=new Array(c.length);for(let d=0;d<c.length;d++){let h=c[d],_=o[h];typeof _!="object"||_===null?f[h]=_:_.constructor!==Object&&(r=e.get(_.constructor))?f[h]=r(_,u):ArrayBuffer.isView(_)?f[h]=Zr(_):f[h]=u(_)}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 u={};for(let c in o){if(Object.hasOwnProperty.call(o,c)===!1)continue;let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,i):ArrayBuffer.isView(f)?u[c]=Zr(f):u[c]=i(f)}return u}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 u={};for(let c in o){let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,s):ArrayBuffer.isView(f)?u[c]=Zr(f):u[c]=s(f)}return u}}function eS(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?u:o;function s(c,f){let d=Object.keys(c),h=new Array(d.length);for(let _=0;_<d.length;_++){let y=d[_],I=c[y];if(typeof I!="object"||I===null)h[y]=I;else if(I.constructor!==Object&&(i=n.get(I.constructor)))h[y]=i(I,f);else if(ArrayBuffer.isView(I))h[y]=Zr(I);else{let S=e.indexOf(I);S!==-1?h[y]=r[S]:h[y]=f(I)}}return h}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 d in c){if(Object.hasOwnProperty.call(c,d)===!1)continue;let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,o);else if(ArrayBuffer.isView(h))f[d]=Zr(h);else{let _=e.indexOf(h);_!==-1?f[d]=r[_]:f[d]=o(h)}}return e.pop(),r.pop(),f}function u(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,u);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,u);let f={};e.push(c),r.push(f);for(let d in c){let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,u);else if(ArrayBuffer.isView(h))f[d]=Zr(h);else{let _=e.indexOf(h);_!==-1?f[d]=r[_]:f[d]=u(h)}}return e.pop(),r.pop(),f}}});var up=H((C2,ap)=>{"use strict";x();P();T();ap.exports=sp()()});var ia=H(to=>{"use strict";x();P();T();Object.defineProperty(to,"__esModule",{value:!0});to.validateTopic=lp;to.validateTopics=tS;function lp(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 tS(t){if(t.length===0)return"empty_topic_list";for(let e=0;e<t.length;e++)if(!lp(t[e]))return t[e];return null}});var aa=H(sa=>{"use strict";x();P();T();Object.defineProperty(sa,"__esModule",{value:!0});var rS=Yt(),nS={objectMode:!0},iS={clean:!0},oa=class{options;_inflights;constructor(e){this.options=e||{},this.options={...iS,...e},this._inflights=new Map}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new rS.Readable(nS),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()}};sa.default=oa});var cp=H((uB,oS)=>{oS.exports={version:"5.16.0"}});var Ct=H(ct=>{"use strict";x();P();T();Object.defineProperty(ct,"__esModule",{value:!0});ct.MQTTJS_VERSION=ct.nextTick=ct.ErrorWithSubackPacket=ct.ErrorWithReasonCode=void 0;ct.applyMixin=sS;var ua=class t extends Error{code;constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};ct.ErrorWithReasonCode=ua;var la=class t extends Error{packet;constructor(e,r){super(e),this.packet=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};ct.ErrorWithSubackPacket=la;function sS(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))}ct.nextTick=typeof q?.nextTick=="function"?q.nextTick:t=>{setTimeout(t,0)};ct.MQTTJS_VERSION=cp().version});var dp=H(ca=>{"use strict";x();P();T();Object.defineProperty(ca,"__esModule",{value:!0});var aS=Ct(),fp=[0,16,128,131,135,144,145,151,153],uS=148,lS=130,ro=(t,e,r,n,i=uS)=>{n?.discardParsedPackets(),(!n||n.isCurrent())&&t._cleanUp(!0),r(),t.emit("error",new aS.ErrorWithReasonCode(e,i))},no=(t,e,r)=>{r(),t.emit("error",e)},cS=(t,e,r,n)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),s=e.payload,{qos:o}=e,{messageId:u}=e,{options:c}=t;if(t.options.protocolVersion===5){let f;if(e.properties&&(f=e.properties.topicAlias),typeof f<"u"){let d=t.topicAliasRecv;if(!d){t.log("handlePublish :: received unexpected topic alias. alias: %d",f),ro(t,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);return}if(i.length===0)if(f>0&&f<=65535){let h=d.getTopicByAlias(f);if(h)i=h,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,f);else{t.log("handlePublish :: unregistered topic alias. alias: %d",f),ro(t,"Received unregistered Topic Alias",r,n,lS);return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",f),ro(t,`Received Topic Alias ${f} is outside the valid range 1-65535`,r,n);return}else if(d.put(i,f))t.log("handlePublish :: registered topic: %s - alias: %d",i,f);else{t.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",f,d.max),ro(t,`Received Topic Alias ${f} is outside the advertised Topic Alias Maximum range 1-${d.max}`,r,n);return}}}switch(t.log("handlePublish: qos %d",o),o){case 2:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return no(t,f,r);if(fp.indexOf(d)===-1)return no(t,new Error("Wrong reason code for pubrec"),r);if(d)t._sendPacket({cmd:"pubrec",messageId:u,reasonCode:d},r);else{if(!t._trackIncomingQoS2Publish(u,r,n))return;t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:u},r)})}});break}case 1:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return no(t,f,r);if(fp.indexOf(d)===-1)return no(t,new Error("Wrong reason code for puback"),r);d||t.emit("message",i,s,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:u,reasonCode:d},r)})});break}case 0:t.emit("message",i,s,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};ca.default=cS});var hp=H(fa=>{"use strict";x();P();T();Object.defineProperty(fa,"__esModule",{value:!0});var kn=Ct(),Cn=130,en=(t,e,r)=>{t.log("handleAuth :: %s",e.message),r?.discardParsedPackets(),(!r||r.isCurrent())&&t._cleanUp(!0),t.emit("error",e)},fS=(t,e,r)=>{let{options:n}=t,i=n.protocolVersion,s=i===5?e.reasonCode:e.returnCode;if(i!==5){en(t,new kn.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,Cn),r);return}let o=t._authenticationMethod;if(!o){en(t,new kn.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",Cn),r);return}if(e.properties?.authenticationMethod!==o){en(t,new kn.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${o}" sent in CONNECT`,Cn),r);return}t.handleAuth(e,(u,c)=>{if(u){en(t,u,r);return}if(s===0){t.log("handleAuth :: authentication exchange completed successfully");return}if(s===24){if(!c){en(t,new kn.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",Cn),r);return}t.reconnecting=!1,t._sendPacket(c);return}en(t,new kn.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${s} is not one a broker may send`,Cn),r)})};fa.default=fS});var Mn=H(er=>{"use strict";x();P();T();Object.defineProperty(er,"__esModule",{value:!0});er.ReasonCodes=void 0;var pp=Ct();er.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 dS={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]},hS=(t,e)=>{let{messageId:r}=e,n=e.cmd,i=null,s=t.outgoing[r],o=s?s.cb:null,u=null;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}if(!dS[s.cmd]?.includes(n)){t.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",n,s.cmd,r),t.emit("error",new Error(`Protocol error: ${n} does not answer the ${s.cmd} pending on message id ${r}`));return}switch(t.log("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{let c=e.reasonCode;c&&c>0&&c!==16?(u=new pp.ErrorWithReasonCode(`Publish error: ${er.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{i={cmd:"pubrel",qos:2,messageId:r};let c=e.reasonCode;c&&c>0&&c!==16?(u=new pp.ErrorWithReasonCode(`Publish error: ${er.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._sendPacket(i);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let c=e.granted;for(let f=0;f<c.length;f++){let d=c[f];if((d&128)!==0){u=new Error(`Subscribe error: ${er.ReasonCodes[d]}`),u.code=d;let h=t.messageIdToTopic[r];h&&h.forEach(_=>{delete t._resubscribeTopics[_]})}}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(u,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),o(null,e);break}default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty")};er.default=hS});var _p=H(oo=>{"use strict";x();P();T();Object.defineProperty(oo,"__esModule",{value:!0});oo.LRUCache=void 0;var tn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,yp=new Set,da=typeof q=="object"&&q?q:{},bp=(t,e,r,n)=>{typeof da.emitWarning=="function"?da.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},io=globalThis.AbortController,gp=globalThis.AbortSignal;if(typeof io>"u"){gp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},io=class{constructor(){e()}signal=new gp;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=da.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,bp("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 pS=t=>!yp.has(t),JB=Symbol("type"),tr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),mp=t=>tr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?rn:null:null,rn=class extends Array{constructor(e){super(e),this.fill(0)}},ha=class t{heap;length;static#u=!1;static create(e){let r=mp(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]}},pa=class t{#u;#f;#g;#y;#R;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#b;#n;#r;#e;#l;#d;#a;#o;#m;#s;#_;#w;#h;#v;#x;#c;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#h,sizes:e.#_,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#a},get tail(){return e.#o},free:e.#m,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,i,s)=>e.#B(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.#g}get disposeAfter(){return this.#y}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:f,disposeAfter:d,noDisposeOnSet:h,noUpdateTTL:_,maxSize:y=0,maxEntrySize:I=0,sizeCalculation:S,fetchMethod:b,memoMethod:m,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:g,ignoreFetchAbort:O}=e;if(r!==0&&!tr(r))throw new TypeError("max option must be a nonnegative integer");let v=r?mp(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=y,this.maxEntrySize=I||this.#f,this.sizeCalculation=S,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 v(r),this.#d=new v(r),this.#a=0,this.#o=0,this.#m=ha.create(r),this.#i=0,this.#b=0,typeof f=="function"&&(this.#g=f),typeof d=="function"?(this.#y=d,this.#s=[]):(this.#y=void 0,this.#s=void 0),this.#v=!!this.#g,this.#c=!!this.#y,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#f!==0&&!tr(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!tr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tr(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!tr(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 B="LRU_CACHE_UNBOUNDED";pS(B)&&(yp.add(B),bp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new rn(this.#u),r=new rn(this.#u);this.#h=e,this.#w=r,this.#L=(s,o,u=tn.now())=>{if(r[s]=o!==0?u: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?tn.now():0},this.#I=(s,o)=>{if(e[o]){let u=e[o],c=r[o];if(!u||!c)return;s.ttl=u,s.start=c,s.now=n||i();let f=s.now-c;s.remainingTTL=u-f}};let n=0,i=()=>{let s=tn.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 u=e[o],c=r[o];if(!u||!c)return 1/0;let f=(n||i())-c;return u-f},this.#p=s=>{let o=r[s],u=e[s];return!!u&&!!o&&(n||i())-o>u}}#T=()=>{};#I=()=>{};#L=()=>{};#p=()=>!1;#j(){let e=new rn(this.#u);this.#b=0,this.#_=e,this.#P=r=>{this.#b-=e[r],e[r]=0},this.#q=(r,n,i,s)=>{if(this.#t(n))return 0;if(!tr(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!tr(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.#M(!0)}this.#b+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#b)}}#P=e=>{};#C=(e,r,n)=>{};#q=(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.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#d[r]}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#o));)r=this.#l[r]}#D(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.#h&&this.#w){let o=this.#h[r],u=this.#w[r];if(o&&u){let c=o-(tn.now()-u);s.ttl=c,s.start=Date.now()}}return this.#_&&(s.size=this.#_[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.#h&&this.#w){o.ttl=this.#h[r];let u=tn.now()-this.#w[r];o.start=Math.floor(Date.now()-u)}this.#_&&(o.size=this.#_[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=tn.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:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:f=this.noUpdateTTL}=n,d=this.#q(e,r,n.size||0,u);if(this.maxEntrySize&&d>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let h=this.#i===0?void 0:this.#n.get(e);if(h===void 0)h=this.#i===0?this.#o:this.#m.length!==0?this.#m.pop():this.#i===this.#u?this.#M(!1):this.#i,this.#r[h]=e,this.#e[h]=r,this.#n.set(e,h),this.#l[this.#o]=h,this.#d[h]=this.#o,this.#o=h,this.#i++,this.#C(h,d,c),c&&(c.set="add"),f=!1;else{this.#O(h);let _=this.#e[h];if(r!==_){if(this.#x&&this.#t(_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=_;y!==void 0&&!o&&(this.#v&&this.#g?.(y,e,"set"),this.#c&&this.#s?.push([y,e,"set"]))}else o||(this.#v&&this.#g?.(_,e,"set"),this.#c&&this.#s?.push([_,e,"set"]));if(this.#P(h),this.#C(h,d,c),this.#e[h]=r,c){c.set="replace";let y=_&&this.#t(_)?_.__staleWhileFetching:_;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(i!==0&&!this.#h&&this.#N(),this.#h&&(f||this.#L(h,i,s),c&&this.#I(c,h)),!o&&this.#c&&this.#s){let _=this.#s,y;for(;y=_?.shift();)this.#y?.(...y)}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#M(!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.#y?.(...r)}}}#M(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.#g?.(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.#m.push(r)),this.#i===1?(this.#a=this.#o=0,this.#m.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}#B(e,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new io,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},f=(S,b=!1)=>{let{aborted:m}=o.signal,w=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(m&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),m&&!w&&!b)return h(o.signal.reason);let R=y;return this.#e[r]===y&&(S===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,S,c.options))),S},d=S=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=S),h(S)),h=S=>{let{aborted:b}=o.signal,m=b&&n.allowStaleOnFetchAbort,w=m||n.allowStaleOnFetchRejection,R=w||n.noDeleteOnFetchRejection,A=y;if(this.#e[r]===y&&(!R||A.__staleWhileFetching===void 0?this.#A(e,"fetch"):m||(this.#e[r]=A.__staleWhileFetching)),w)return n.status&&A.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw S},_=(S,b)=>{let m=this.#R?.(e,s,c);m&&m instanceof Promise&&m.then(w=>S(w===void 0?void 0:w),b),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=w=>f(w,!0)))})};n.status&&(n.status.fetchDispatched=!0);let y=new Promise(_).then(f,d),I=Object.assign(y,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,I,{...c.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=I,I}#t(e){if(!this.#x)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof io}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:I=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:m,signal:w}=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:u,size:c,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:I,ignoreFetchAbort:y,status:m,signal:w},A=this.#n.get(e);if(A===void 0){m&&(m.fetch="miss");let g=this.#B(e,A,R,S);return g.__returned=g}else{let g=this.#e[A];if(this.#t(g)){let L=n&&g.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",L&&(m.returnedStale=!0)),L?g.__staleWhileFetching:g.__returned=g}let O=this.#p(A);if(!b&&!O)return m&&(m.fetch="hit"),this.#O(A),i&&this.#T(A),m&&this.#I(m,A),g;let v=this.#B(e,A,R,S),D=v.__staleWhileFetching!==void 0&&n;return m&&(m.fetch=O?"stale":"refresh",D&&O&&(m.returnedStale=!0)),D?v.__staleWhileFetching:v.__returned=v}}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,u=this.get(e,o);if(!s&&u!==void 0)return u;let c=n(e,u,{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,u=this.#n.get(e);if(u!==void 0){let c=this.#e[u],f=this.#t(c);return o&&this.#I(o,u),this.#p(u)?(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(u),i&&this.#T(u),c))}else o&&(o.get="miss")}#U(e,r){this.#d[r]=e,this.#l[e]=r}#O(e){e!==this.#o&&(e===this.#a?this.#a=this.#l[e]:this.#U(this.#d[e],this.#l[e]),this.#U(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.#F(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.#g?.(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.#d[i];else if(i===this.#a)this.#a=this.#l[i];else{let o=this.#d[i];this.#l[o]=this.#l[i];let u=this.#l[i];this.#d[u]=this.#d[i]}this.#i--,this.#m.push(i)}}if(this.#c&&this.#s?.length){let i=this.#s,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#F("delete")}#F(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.#g?.(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.#h&&this.#w&&(this.#h.fill(0),this.#w.fill(0)),this.#_&&this.#_.fill(0),this.#a=0,this.#o=0,this.#m.length=0,this.#b=0,this.#i=0,this.#c&&this.#s){let r=this.#s,n;for(;n=r?.shift();)this.#y?.(...n)}}};oo.LRUCache=pa});var ya=H(so=>{"use strict";x();P();T();Object.defineProperty(so,"__esModule",{value:!0});so.NumberAllocator=void 0;var ga=class{used;min;max;lowWaterMark;constructor(e,r){this.min=e,this.max=r,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return e<this.min||e>this.max||this.used.has(e)?!1:(this.used.add(e),!0)}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}};so.NumberAllocator=ga});var wp=H(ma=>{"use strict";x();P();T();Object.defineProperty(ma,"__esModule",{value:!0});var gS=_p(),yS=ya(),ba=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new gS.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new yS.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]}};ma.default=ba});var Sp=H(Bn=>{"use strict";x();P();T();var bS=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});var mS=Mn(),_S=bS(wp()),vp=Ct(),wS=(t,e,r)=>{t.log("_handleConnack");let{options:n}=t,s=n.protocolVersion===5?e.reasonCode:e.returnCode;if(t.connackReceived){let o=new vp.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",o);return}if(t.connackReceived=!0,clearTimeout(t.connackTimer),delete t.topicAliasSend,t._serverProperties=e.properties,e.properties&&e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new _S.default(e.properties.topicAliasMaximum))}if(s===0)t.reconnecting=!1,t._onConnect(e);else if(s>0){t.log("_handleConnack :: connection refused with reason code %d",s);let o=new vp.ErrorWithReasonCode(`Connection refused: ${mS.ReasonCodes[s]}`,s);r?.discardParsedPackets(),t.reconnectSuppressed=!0,t._cleanUp(!0);try{t.emit("error",o)}finally{n.reconnectOnConnackError&&(t.reconnectSuppressed=!1,t._setupReconnect())}}};Bn.default=wS});var Ep=H(_a=>{"use strict";x();P();T();Object.defineProperty(_a,"__esModule",{value:!0});var vS=(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,u)=>{o?t._sendPacket(s,n):(t.emit("message",u.topic,u.payload,u),t.handleMessage(u,c=>{if(c)return n(c);t.incomingStore.del(u,t.noop),t._releaseIncomingQoS2Publish(i),t._sendPacket(s,n)}))})};_a.default=vS});var Ap=H(Nn=>{"use strict";x();P();T();var Ln=Nn&&Nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});var SS=Ln(dp()),ES=Ln(hp()),AS=Ln(Sp()),IS=Ln(Mn()),xS=Ln(Ep()),TS=Ct(),PS=t=>t<128?1:t<16384?2:t<2097152?3:4,OS=t=>1+PS(t)+t,RS=(t,e,r,n)=>{let{options:i}=t,s=i.properties?.maximumPacketSize,o=OS(e.length);if(i.protocolVersion===5&&s&&s<o)return t.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",e.cmd,o,s),n?.discardParsedPackets(),t._cleanUp(!0),r(),t.emit("error",new TS.ErrorWithReasonCode(`exceeding packets size ${e.cmd}: ${o} bytes, maximumPacketSize is ${s}`,149)),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,SS.default)(t,e,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing();try{(0,IS.default)(t,e)}finally{r()}break;case"pubrel":t.reschedulePing(),(0,xS.default)(t,e,r);break;case"connack":try{(0,AS.default)(t,e,n)}finally{r()}break;case"auth":t.reschedulePing();try{(0,ES.default)(t,e,n)}finally{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}};Nn.default=RS});var Sa=H(va=>{"use strict";x();P();T();Object.defineProperty(va,"__esModule",{value:!0});var wa=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(){}};va.default=wa});var Ip=H(Aa=>{"use strict";x();P();T();Object.defineProperty(Aa,"__esModule",{value:!0});var Ea=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={}}};Aa.default=Ea});var xp=H(nn=>{"use strict";x();P();T();var kS=nn&&nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nn,"__esModule",{value:!0});nn.TypedEventEmitter=void 0;var CS=kS((Ht(),_e(Vt))),MS=Ct(),ao=class{};nn.TypedEventEmitter=ao;(0,MS.applyMixin)(ao,CS.default)});var Ia=H((uo,Tp)=>{x();P();T();(function(t,e){typeof uo=="object"&&typeof Tp<"u"?e(uo):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(uo,(function(t){"use strict";var e=function(_){return function(y){var I=_(y);return y.add(I),I}},r=function(_){return function(y,I){return _.set(y,I),I}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,o=function(_,y){return function(I){var S=y.get(I),b=S===void 0?I.size:S<s?S+1:0;if(!I.has(b))return _(I,b);if(I.size<i){for(;I.has(b);)b=Math.floor(Math.random()*s);return _(I,b)}if(I.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;I.has(b);)b=Math.floor(Math.random()*n);return _(I,b)}},u=new WeakMap,c=r(u),f=o(c,u),d=e(f);t.addUniqueNumber=d,t.generateUniqueNumber=f}))});var qn=H((WL,Mt)=>{x();P();T();function xa(t){"@babel/helpers - typeof";return Mt.exports=xa=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},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports,xa(t)}Mt.exports=xa,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports});var Op=H((ZL,Dn)=>{x();P();T();var Pp=qn().default;function BS(t,e){if(Pp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}Dn.exports=BS,Dn.exports.__esModule=!0,Dn.exports.default=Dn.exports});var Rp=H((lq,Un)=>{x();P();T();var NS=qn().default,LS=Op();function qS(t){var e=LS(t,"string");return NS(e)=="symbol"?e:e+""}Un.exports=qS,Un.exports.__esModule=!0,Un.exports.default=Un.exports});var kp=H((_q,Fn)=>{x();P();T();var DS=Rp();function US(t,e,r){return(e=DS(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Fn.exports=US,Fn.exports.__esModule=!0,Fn.exports.default=Fn.exports});var Cp=H((Oq,jn)=>{x();P();T();function FS(t){if(Array.isArray(t))return t}jn.exports=FS,jn.exports.__esModule=!0,jn.exports.default=jn.exports});var Mp=H((Uq,$n)=>{x();P();T();function jS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,o,u=[],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)&&(u.push(n.value),u.length!==e);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}$n.exports=jS,$n.exports.__esModule=!0,$n.exports.default=$n.exports});var Bp=H((Kq,Wn)=>{x();P();T();function $S(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}Wn.exports=$S,Wn.exports.__esModule=!0,Wn.exports.default=Wn.exports});var Lp=H((oD,Vn)=>{x();P();T();var Np=Bp();function WS(t,e){if(t){if(typeof t=="string")return Np(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)?Np(t,e):void 0}}Vn.exports=WS,Vn.exports.__esModule=!0,Vn.exports.default=Vn.exports});var qp=H((gD,Hn)=>{x();P();T();function VS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Hn.exports=VS,Hn.exports.__esModule=!0,Hn.exports.default=Hn.exports});var Dp=H((ID,zn)=>{x();P();T();var HS=Cp(),zS=Mp(),GS=Lp(),QS=qp();function KS(t,e){return HS(t)||zS(t,e)||GS(t,e)||QS()}zn.exports=KS,zn.exports.__esModule=!0,zn.exports.default=zn.exports});var Fp=H((ND,Gn)=>{x();P();T();function Up(t,e,r,n,i,s,o){try{var u=t[s](o),c=u.value}catch(f){return void r(f)}u.done?e(c):Promise.resolve(c).then(n,i)}function YS(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){Up(s,n,i,o,u,"next",c)}function u(c){Up(s,n,i,o,u,"throw",c)}o(void 0)})}}Gn.exports=YS,Gn.exports.__esModule=!0,Gn.exports.default=Gn.exports});var Ta=H((HD,Qn)=>{x();P();T();function JS(t,e){this.v=t,this.k=e}Qn.exports=JS,Qn.exports.__esModule=!0,Qn.exports.default=Qn.exports});var Pa=H((tU,Bt)=>{x();P();T();function lo(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Bt.exports=lo=function(o,u,c,f){function d(h,_){lo(o,h,function(y){return this._invoke(h,_,y)})}u?i?i(o,u,{value:c,enumerable:!f,configurable:!f,writable:!f}):o[u]=c:(d("next",0),d("throw",1),d("return",2))},Bt.exports.__esModule=!0,Bt.exports.default=Bt.exports,lo(t,e,r,n)}Bt.exports=lo,Bt.exports.__esModule=!0,Bt.exports.default=Bt.exports});var Oa=H((fU,Nt)=>{x();P();T();var wt=Pa();function jp(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(y,I,S,b){var m=I&&I.prototype instanceof u?I:u,w=Object.create(m.prototype);return wt(w,"_invoke",(function(R,A,g){var O,v,B,D=0,L=g||[],K=!1,U={p:0,n:0,v:t,a:$,f:$.bind(t,4),d:function(J,ee){return O=J,v=0,B=t,U.n=ee,o}};function $(G,J){for(v=G,B=J,e=0;!K&&D&&!ee&&e<L.length;e++){var ee,z=L[e],W=U.p,te=z[2];G>3?(ee=te===J)&&(B=z[(v=z[4])?5:(v=3,3)],z[4]=z[5]=t):z[0]<=W&&((ee=G<2&&W<z[1])?(v=0,U.v=J,U.n=z[1]):W<te&&(ee=G<3||z[0]>J||J>te)&&(z[4]=G,z[5]=J,U.n=te,v=0))}if(ee||G>1)return o;throw K=!0,J}return function(G,J,ee){if(D>1)throw TypeError("Generator is already running");for(K&&J===1&&$(J,ee),v=J,B=ee;(e=v<2?t:B)||!K;){O||(v?v<3?(v>1&&(U.n=-1),$(v,B)):U.n=B:U.v=B);try{if(D=2,O){if(v||(G="next"),e=O[G]){if(!(e=e.call(O,B)))throw TypeError("iterator result is not an object");if(!e.done)return e;B=e.value,v<2&&(v=0)}else v===1&&(e=O.return)&&e.call(O),v<2&&(B=TypeError("The iterator does not provide a '"+G+"' method"),v=1);O=t}else if((e=(K=U.n<0)?B:R.call(A,U))!==o)break}catch(z){O=t,v=1,B=z}finally{D=1}}return{value:e,done:K}}})(y,S,b),!0),w}var o={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var d=[][n]?e(e([][n]())):(wt(e={},n,function(){return this}),e),h=f.prototype=u.prototype=Object.create(d);function _(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,f):(y.__proto__=f,wt(y,i,"GeneratorFunction")),y.prototype=Object.create(h),y}return c.prototype=f,wt(h,"constructor",f),wt(f,"constructor",c),c.displayName="GeneratorFunction",wt(f,i,"GeneratorFunction"),wt(h),wt(h,i,"Generator"),wt(h,n,function(){return this}),wt(h,"toString",function(){return"[object Generator]"}),(Nt.exports=jp=function(){return{w:s,m:_}},Nt.exports.__esModule=!0,Nt.exports.default=Nt.exports)()}Nt.exports=jp,Nt.exports.__esModule=!0,Nt.exports.default=Nt.exports});var Ca=H((vU,Kn)=>{x();P();T();var XS=Ta(),Ra=Pa();function ka(t,e){function r(i,s,o,u){try{var c=t[i](s),f=c.value;return f instanceof XS?e.resolve(f.v).then(function(d){r("next",d,o,u)},function(d){r("throw",d,o,u)}):e.resolve(f).then(function(d){c.value=d,o(c)},function(d){return r("throw",d,o,u)})}catch(d){u(d)}}var n;this.next||(Ra(ka.prototype),Ra(ka.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Ra(this,"_invoke",function(i,s,o){function u(){return new e(function(c,f){r(i,o,c,f)})}return n=n?n.then(u,u):u()},!0)}Kn.exports=ka,Kn.exports.__esModule=!0,Kn.exports.default=Kn.exports});var Ma=H((kU,Yn)=>{x();P();T();var ZS=Oa(),eE=Ca();function tE(t,e,r,n,i){return new eE(ZS().w(t,e,r,n),i||Promise)}Yn.exports=tE,Yn.exports.__esModule=!0,Yn.exports.default=Yn.exports});var $p=H((jU,Jn)=>{x();P();T();var rE=Ma();function nE(t,e,r,n,i){var s=rE(t,e,r,n,i);return s.next().then(function(o){return o.done?o.value:s.next()})}Jn.exports=nE,Jn.exports.__esModule=!0,Jn.exports.default=Jn.exports});var Wp=H((JU,Xn)=>{x();P();T();function iE(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}}Xn.exports=iE,Xn.exports.__esModule=!0,Xn.exports.default=Xn.exports});var Vp=H((a3,Zn)=>{x();P();T();var oE=qn().default;function sE(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(oE(t)+" is not iterable")}Zn.exports=sE,Zn.exports.__esModule=!0,Zn.exports.default=Zn.exports});var zp=H((b3,Lt)=>{x();P();T();var aE=Ta(),uE=Oa(),lE=$p(),cE=Ma(),fE=Ca(),dE=Wp(),Hp=Vp();function Ba(){"use strict";var t=uE(),e=t.m(Ba),r=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(o){var u=typeof o=="function"&&o.constructor;return!!u&&(u===r||(u.displayName||u.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function s(o){var u,c;return function(f){u||(u={stop:function(){return c(f.a,2)},catch:function(){return f.v},abrupt:function(h,_){return c(f.a,i[h],_)},delegateYield:function(h,_,y){return u.resultName=_,c(f.d,Hp(h),y)},finish:function(h){return c(f.f,h)}},c=function(h,_,y){f.p=u.prev,f.n=u.next;try{return h(_,y)}finally{u.next=f.n}}),u.resultName&&(u[u.resultName]=f.v,u.resultName=void 0),u.sent=f.v,u.next=f.n;try{return o.call(this,u)}finally{f.p=u.prev,f.n=u.next}}}return(Lt.exports=Ba=function(){return{wrap:function(c,f,d,h){return t.w(s(c),f,d,h&&h.reverse())},isGeneratorFunction:n,mark:t.m,awrap:function(c,f){return new aE(c,f)},AsyncIterator:fE,async:function(c,f,d,h,_){return(n(f)?cE:lE)(s(c),f,d,h,_)},keys:dE,values:Hp}},Lt.exports.__esModule=!0,Lt.exports.default=Lt.exports)()}Lt.exports=Ba,Lt.exports.__esModule=!0,Lt.exports.default=Lt.exports});var Qp=H((T3,Gp)=>{x();P();T();var co=zp()();Gp.exports=co;try{regeneratorRuntime=co}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=co:Function("r","regeneratorRuntime = r")(co)}});var Yp=H((fo,Kp)=>{x();P();T();(function(t,e){typeof fo=="object"&&typeof Kp<"u"?e(fo,Ia(),kp(),Dp(),Fp(),Qp()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.brokerFactory={},t.fastUniqueNumbers,t._defineProperty,t._slicedToArray,t._asyncToGenerator,t._regeneratorRuntime))})(fo,(function(t,e,r,n,i,s){"use strict";function o(S,b){var m=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),m.push.apply(m,w)}return m}function u(S){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?o(Object(m),!0).forEach(function(w){r(S,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(m)):o(Object(m)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(m,w))})}return S}var c=function(b,m,w,R){return function(A){var g=m(A);return function(O){var v=b(O);O.addEventListener("message",function(ee){var z=ee.data,W=z.id;if(W!==null&&v.has(W)){var te=v.get(W),Y=te.reject,X=te.resolve;v.delete(W),z.error===void 0?X(z.result):Y(new Error(z.error.message))}}),R(O)&&O.start();for(var B=function(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Y,X){var ce=w(v);v.set(ce,{reject:X,resolve:Y}),W===null?O.postMessage({id:ce,method:z},te):O.postMessage({id:ce,method:z,params:W},te)})},D=function(z,W){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];O.postMessage({id:null,method:z,params:W},te)},L={},K=0,U=Object.entries(g);K<U.length;K++){var $=n(U[K],2),G=$[0],J=$[1];L=u(u({},L),{},r({},G,J({call:B,notify:D})))}return u({},L)}}},f=function(b){return function(m){if(b.has(m))return b.get(m);var w=new Map;return b.set(m,w),w}};function d(S,b){var m=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),m.push.apply(m,w)}return m}function h(S){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?d(Object(m),!0).forEach(function(w){r(S,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(m)):d(Object(m)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(m,w))})}return S}var _=function(b){return function(m){return h(h({},m),{},{connect:function(R){var A=R.call;return i(s.mark(function g(){var O,v,B,D;return s.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return O=new MessageChannel,v=O.port1,B=O.port2,L.next=1,A("connect",{port:v},[v]);case 1:return D=L.sent,b.set(B,D),L.abrupt("return",B);case 2:case"end":return L.stop()}},g)}))},disconnect:function(R){var A=R.call;return(function(){var g=i(s.mark(function O(v){var B;return s.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(B=b.get(v),B!==void 0){D.next=1;break}throw new Error("The given port is not connected.");case 1:return D.next=2,A("disconnect",{portId:B});case 2:case"end":return D.stop()}},O)}));return function(O){return g.apply(this,arguments)}})()},isSupported:function(R){var A=R.call;return function(){return A("isSupported")}}})}},y=function(b){return typeof b.start=="function"},I=c(f(new WeakMap),_(new WeakMap),e.generateUniqueNumber,y);t.createBroker=I}))});var Xp=H((ho,Jp)=>{x();P();T();(function(t,e){typeof ho=="object"&&typeof Jp<"u"?e(ho,Yp(),Ia(),qn()):typeof define=="function"&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t.brokerFactory,t.fastUniqueNumbers,t._typeof))})(ho,(function(t,e,r,n){"use strict";var i=function(m){return function(w){return function(R){n(m.get(R))==="symbol"&&(m.set(R,null),w(R).then(function(){m.delete(R)}))}}},s=function(m){return function(w){return function(R){n(m.get(R))==="symbol"&&(m.set(R,null),w(R).then(function(){m.delete(R)}))}}},o=function(m,w){return function(R){return function(A){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),L=m(w);w.set(L,D);var K=function(){return R(g,L).then(function(){var $=w.get(L);if($===void 0)throw new Error("The timer is in an undefined state.");$===D&&(A.apply(void 0,v),w.get(L)===D&&K())})};return K(),L}}},u=function(m,w){return function(R){return function(A){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),L=m(w);return w.set(L,D),R(g,L).then(function(){var K=w.get(L);if(K===void 0)throw new Error("The timer is in an undefined state.");K===D&&(w.delete(L),A.apply(void 0,v))}),L}}},c=new Map([[0,null]]),f=new Map([[0,null]]),d=i(c),h=s(f),_=o(r.generateUniqueNumber,c),y=u(r.generateUniqueNumber,f),I=e.createBroker({clearInterval:function(m){var w=m.call;return d(function(R){return w("clear",{timerId:R,timerType:"interval"})})},clearTimeout:function(m){var w=m.call;return h(function(R){return w("clear",{timerId:R,timerType:"timeout"})})},setInterval:function(m){var w=m.call;return _(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"interval"})})},setTimeout:function(m){var w=m.call;return y(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"timeout"})})}}),S=function(m){var w=new Worker(m);return I(w)};t.load=S,t.wrap=I}))});var eg=H((po,Zp)=>{x();P();T();(function(t,e){typeof po=="object"&&typeof Zp<"u"?e(po,Xp()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimers={},t.workerTimersBroker))})(po,(function(t,e){"use strict";var r=function(d,h){var _=null;return function(){if(_!==null)return _;var y=new Blob([h],{type:"application/javascript; charset=utf-8"}),I=URL.createObjectURL(y);return _=d(I),setTimeout(function(){return URL.revokeObjectURL(I)}),_}},n=`(()=>{var e={389(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)},623(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))},472(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))},172(e){e.exports=function(e,t){this.v=e,this.k=t},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},987(e){e.exports=function(e){if(Array.isArray(e))return e},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},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},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},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},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},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},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},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){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(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},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},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},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},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},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},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},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},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)}}},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(d){return i().clearInterval(d)},o=function(d){return i().clearTimeout(d)},u=function(){var d;return(d=i()).setInterval.apply(d,arguments)},c=function(){var d;return(d=i()).setTimeout.apply(d,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=u,t.setTimeout=c}))});var ei=H(Ir=>{"use strict";x();P();T();Object.defineProperty(Ir,"__esModule",{value:!0});Ir.isReactNativeBrowser=Ir.isWebWorker=void 0;var hE=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&q?.versions?!Object.prototype.hasOwnProperty.call(q.versions,"electron"):typeof window.document<"u":!1,tg=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),rg=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pE=hE()||tg()||rg();Ir.isWebWorker=tg();Ir.isReactNativeBrowser=rg();Ir.default=pE});var sg=H(qt=>{"use strict";x();P();T();var gE=qt&&qt.__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]})),yE=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bE=qt&&qt.__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"&&gE(r,e,n[i]);return yE(r,e),r}})();Object.defineProperty(qt,"__esModule",{value:!0});var ng=eg(),Na=bE(ei()),ig={set:ng.setInterval,clear:ng.clearInterval},og={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},mE=t=>{switch(t){case"native":return og;case"worker":return ig;case"auto":default:return Na.default&&!Na.isWebWorker&&!Na.isReactNativeBrowser?ig:og}};qt.default=mE});var qa=H(ti=>{"use strict";x();P();T();var _E=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});var wE=_E(sg()),La=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,wE.default)(r),this.setKeepalive(e.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)}};ti.default=La});var yo=H(ft=>{"use strict";x();P();T();var vE=ft&&ft.__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]})),SE=ft&&ft.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dg=ft&&ft.__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"&&vE(r,e,n[i]);return SE(r,e),r}})(),rr=ft&&ft.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ft,"__esModule",{value:!0});var Da=rr(ip()),EE=Yt(),ag=rr(up()),AE=rr(Xt()),ug=dg(ia()),on=rr(aa()),IE=rr(Ap()),xE=Mn(),TE=rr(Sa()),PE=rr(Ip()),xr=Ct(),OE=xp(),RE=rr(qa()),lg=dg(ei()),Ua=globalThis.setImmediate||((...t)=>{let e=t.shift();(0,xr.nextTick)(()=>{e(...t)})}),go=65535,cg=147,fg={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},Fa=class t extends OE.TypedEventEmitter{static VERSION=xr.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;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in fg)typeof this.options[i]>"u"?this.options[i]=fg[i]:this.options[i]=r[i];this.log=this.options.log||(0,AE.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),lg.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",lg.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||(Da.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new TE.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new on.default,this.incomingStore=r.incomingStore||new on.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=go;let n=r.properties?.receiveMaximum;n!==void 0&&(Number.isInteger(n)&&n>=1&&n<=go?this._receiveMaximum=n:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",n,go,go)),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.connackReceived=!1,this.reconnectSuppressed=!1,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 PE.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,s=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let u=null;if(!o){this._resubscribe();return}u=o.packet,this.log("deliver :: call _sendPacket for %o",u);let c=!0;u.messageId&&u.messageId!==0&&(this.messageIdProvider.register(u.messageId)||(c=!1)),c?this._sendPacket(u,f=>{o.cb&&o.cb(f),s()}):(this.log("messageId: %d has already used. The message is skipped and removed.",u.messageId),s())};this.log("connect :: sending queued packets"),s()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,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()}_trackIncomingQoS2Publish(e,r,n){return this._incomingQoS2Ids.has(e)?!0:this.options.protocolVersion===5&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),n?.discardParsedPackets(),(!n||n.isCurrent())&&this._cleanUp(!0),r(),this.emit("error",new xr.ErrorWithReasonCode(`${xE.ReasonCodes[cg]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,cg)),!1):(this._incomingQoS2Ids.add(e),!0)}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(this._incomingQoS2Ids.size!==0){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(let e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){let e=new EE.Writable,r=Da.default.parser(this.options),n=null,i=[],s={discardParsedPackets:()=>{i.length=0},isCurrent:()=>this._currentPump===s};this._currentPump=s,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new on.default,this.outgoingStore=this.options.outgoingStore||new on.default,this._incomingQoS2Ids.clear(),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",d=>{this.log("parser :: on packet push to packets array."),i.push(d)});let o=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==s&&(this.log("work :: pump superseded, dropping %d queued packets",i.length),i.length=0);let d=i.shift();if(d)this.log("work :: packet pulled from queue"),(0,IE.default)(this,d,u,s);else{this.log("work :: no packets in queue");let h=n;n=null,this.log("work :: done flag is %s",!!h),h&&h()}},u=()=>{if(i.length)(0,xr.nextTick)(o);else{let d=n;n=null,d&&d()}};e._write=(d,h,_)=>{n=_,this.log("writable stream :: parsing buffer"),r.parse(d),o()};let c=d=>{this.log("streamErrorHandler :: error",d.message),d.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",d)):this.noop(d)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",c),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 f={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?{...this.options.properties}:void 0};if(f.properties?.receiveMaximum!==void 0&&(f.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(f.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(f.properties||(f.properties={}),this.topicAliasRecv&&(f.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=f.properties?.authenticationMethod,this._writePacket(f),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 d={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(d)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}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:u,retain:c,dup:f,properties:d,cbStorePut:h}=n;if(this._checkDisconnecting(i))return this;let _=()=>{let y=0;if((u===1||u===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let I={cmd:"publish",topic:e,payload:r,qos:u,retain:c,messageId:y,dup:f};switch(s.protocolVersion===5&&(I.properties=d),this.log("publish :: qos",u),u){case 1:case 2:this.outgoing[I.messageId]={volatile:!1,cmd:"publish",cb:i||this.noop},this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,void 0,h);break;default:this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,i,h);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!_())&&this._storeProcessingQueue.push({invoke:_,cbStorePut:n.cbStorePut,callback:i}),this}publishAsync(e,r,n){return new Promise((i,s)=>{this.publish(e,r,n,(o,u)=>{o?s(o):i(u)})})}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 u=ug.validateTopics(o);if(u!==null)return Ua(n,new Error(`Invalid topic ${u}`)),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,d=[],h=(I,S)=>{if(S=S||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,I)||this._resubscribeTopics[I].qos<S.qos||s){let b={topic:I,qos:S.qos};i===5&&(b.nl=S.nl,b.rap=S.rap,b.rh=S.rh,b.properties=f),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",b.topic,b.qos),d.push(b)}};if(Array.isArray(e)?e.forEach(I=>{this.log("subscribe: array topic %s",I),h(I)}):Object.keys(e).forEach(I=>{this.log("subscribe: object topic %s, %o",I,e[I]),h(I,e[I])}),!d.length)return n(null,[]),this;let _=(I,S)=>{let b={cmd:"subscribe",subscriptions:I,messageId:S};if(f&&(b.properties=f),this.options.resubscribe){this.log("subscribe :: resubscribe true");let w=[];I.forEach(R=>{if(this.options.reconnectPeriod>0){let A={qos:R.qos};i===5&&(A.nl=R.nl||!1,A.rap=R.rap||!1,A.rh=R.rh||0,A.properties=R.properties),this._resubscribeTopics[R.topic]=A,w.push(R.topic)}}),this.messageIdToTopic[b.messageId]=w}let m=new Promise((w,R)=>{this.outgoing[b.messageId]={volatile:!0,cmd:"subscribe",cb:(A,g)=>{if(A){R(new xr.ErrorWithSubackPacket(A.message,g));return}let{granted:O}=g;if(O.length!==I.length){R(new xr.ErrorWithSubackPacket(`Protocol error: suback granted ${O.length} reason code(s) for ${I.length} subscription(s)`,g)),this._cleanUp(!0);return}for(let v=0;v<O.length;v+=1)I[v].qos=O[v];w(g)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(b),m},y=()=>{let I=this.options.subscribeBatchSize??d.length,S=[];for(let b=0;b<d.length;b+=I){let m=d.slice(b,b+I),w=this._nextId();if(w===null)return this.log("No messageId left"),!1;S.push(_(m,w))}return Promise.all(S).then(b=>{n(null,d,b.at(-1))}).catch(b=>{n(b,d,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=ug.validateTopics(e);if(i!==null)return Ua(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 u={cmd:"unsubscribe",messageId:o,unsubscriptions:[]};return typeof e=="string"?u.unsubscriptions=[e]:Array.isArray(e)&&(u.unsubscriptions=e),this.options.resubscribe&&u.unsubscriptions.forEach(c=>{delete this._resubscribeTopics[c]}),typeof r=="object"&&r.properties&&(u.properties=r.properties),this.outgoing[u.messageId]={volatile:!0,cmd:"unsubscribe",cb:n},this.log("unsubscribe: call _sendPacket"),this._sendPacket(u),!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._incomingQoS2Ids.clear(),this.incomingStore.close(o=>{this.outgoingStore.close(u=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),n){let c=o||u;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,xr.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 on.default,this.outgoingStore=this.options.outgoingStore||new on.default,this._incomingQoS2Ids.clear(),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.reconnectSuppressed&&!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),Ua(()=>{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,ag.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=Da.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,ag.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"))}get serverProperties(){return this._serverProperties}get keepalive(){let e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new RE.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.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.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_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.options.clean&&(this.options.protocolVersion<4||e.sessionPresent===!0)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();let n=()=>{let i=this.outgoingStore.createStream(),s=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",s),i.on("error",c=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",s),this.emit("error",c)});let u=()=>{if(!i)return;let c=i.read(1),f;if(!c){i.once("readable",u);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[c.messageId]){u();return}!this.disconnecting&&!this.reconnectTimer?(f=this.outgoing[c.messageId]?this.outgoing[c.messageId].cb:null,this.outgoing[c.messageId]={volatile:!1,cmd:c.cmd,cb(d,h){f&&f(d,h),u()}},this._packetIdsDuringStoreProcessing[c.messageId]=!0,this.messageIdProvider.register(c.messageId)?this._sendPacket(c,void 0,void 0,!0):this.log("messageId: %d has already used.",c.messageId)):i.destroy&&i.destroy()};i.on("end",()=>{let c=!0;for(let f in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[f]){c=!1;break}this.removeListener("close",s),c?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):n()}),u()};n()}_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()})}};ft.default=Fa});var hg=H($a=>{"use strict";x();P();T();Object.defineProperty($a,"__esModule",{value:!0});var kE=ya(),ja=class{numberAllocator;lastId;constructor(){this.numberAllocator=new kE.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()}};$a.default=ja});function CE(){if(pg)return Wa;pg=!0;let t=2147483647,e=36,r=1,n=26,i=38,s=700,o=72,u=128,c="-",f=/^xn--/,d=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,_={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,I=Math.floor,S=String.fromCharCode;function b($){throw new RangeError(_[$])}function m($,G){let J=[],ee=$.length;for(;ee--;)J[ee]=G($[ee]);return J}function w($,G){let J=$.split("@"),ee="";J.length>1&&(ee=J[0]+"@",$=J[1]),$=$.replace(h,".");let z=$.split("."),W=m(z,G).join(".");return ee+W}function R($){let G=[],J=0,ee=$.length;for(;J<ee;){let z=$.charCodeAt(J++);if(z>=55296&&z<=56319&&J<ee){let W=$.charCodeAt(J++);(W&64512)==56320?G.push(((z&1023)<<10)+(W&1023)+65536):(G.push(z),J--)}else G.push(z)}return G}let A=$=>String.fromCodePoint(...$),g=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:e},O=function($,G){return $+22+75*($<26)-((G!=0)<<5)},v=function($,G,J){let ee=0;for($=J?I($/s):$>>1,$+=I($/G);$>y*n>>1;ee+=e)$=I($/y);return I(ee+(y+1)*$/($+i))},B=function($){let G=[],J=$.length,ee=0,z=u,W=o,te=$.lastIndexOf(c);te<0&&(te=0);for(let Y=0;Y<te;++Y)$.charCodeAt(Y)>=128&&b("not-basic"),G.push($.charCodeAt(Y));for(let Y=te>0?te+1:0;Y<J;){let X=ee;for(let Z=1,ne=e;;ne+=e){Y>=J&&b("invalid-input");let de=g($.charCodeAt(Y++));de>=e&&b("invalid-input"),de>I((t-ee)/Z)&&b("overflow"),ee+=de*Z;let be=ne<=W?r:ne>=W+n?n:ne-W;if(de<be)break;let ge=e-be;Z>I(t/ge)&&b("overflow"),Z*=ge}let ce=G.length+1;W=v(ee-X,ce,X==0),I(ee/ce)>t-z&&b("overflow"),z+=I(ee/ce),ee%=ce,G.splice(ee++,0,z)}return String.fromCodePoint(...G)},D=function($){let G=[];$=R($);let J=$.length,ee=u,z=0,W=o;for(let X of $)X<128&&G.push(S(X));let te=G.length,Y=te;for(te&&G.push(c);Y<J;){let X=t;for(let Z of $)Z>=ee&&Z<X&&(X=Z);let ce=Y+1;X-ee>I((t-z)/ce)&&b("overflow"),z+=(X-ee)*ce,ee=X;for(let Z of $)if(Z<ee&&++z>t&&b("overflow"),Z===ee){let ne=z;for(let de=e;;de+=e){let be=de<=W?r:de>=W+n?n:de-W;if(ne<be)break;let ge=ne-be,Ae=e-be;G.push(S(O(be+ge%Ae,0))),ne=I(ge/Ae)}G.push(S(O(ne,0))),W=v(z,ce,Y===te),z=0,++Y}++z,++ee}return G.join("")};return Wa={version:"2.3.1",ucs2:{decode:R,encode:A},decode:B,encode:D,toASCII:function($){return w($,function(G){return d.test(G)?"xn--"+D(G):G})},toUnicode:function($){return w($,function(G){return f.test(G)?B(G.slice(4).toLowerCase()):G})}},Wa}var Wa,pg,nr,s8,a8,u8,l8,c8,f8,gg=ze(()=>{x();P();T();Wa={},pg=!1;nr=CE(),s8=nr.decode,a8=nr.encode,u8=nr.toASCII,l8=nr.toUnicode,c8=nr.ucs2,f8=nr.version});function ME(){return yg||(yg=!0,Va=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}),Va}function BE(){return bg||(bg=!0,Ha=Error),Ha}function NE(){return mg||(mg=!0,za=EvalError),za}function LE(){return _g||(_g=!0,Ga=RangeError),Ga}function qE(){return wg||(wg=!0,Qa=ReferenceError),Qa}function qg(){return vg||(vg=!0,Ka=SyntaxError),Ka}function sn(){return Sg||(Sg=!0,Ya=TypeError),Ya}function DE(){return Eg||(Eg=!0,Ja=URIError),Ja}function UE(){if(Ag)return Xa;Ag=!0;var t=typeof Symbol<"u"&&Symbol,e=ME();return Xa=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Xa}function FE(){if(Ig)return Za;Ig=!0;var t={__proto__:null,foo:{}},e=Object;return Za=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},Za}function jE(){if(xg)return eu;xg=!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 d=[],h=0;h<c.length;h+=1)d[h]=c[h];for(var _=0;_<f.length;_+=1)d[_+c.length]=f[_];return d},s=function(c,f){for(var d=[],h=f,_=0;h<c.length;h+=1,_+=1)d[_]=c[h];return d},o=function(u,c){for(var f="",d=0;d<u.length;d+=1)f+=u[d],d+1<u.length&&(f+=c);return f};return eu=function(c){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var d=s(arguments,1),h,_=function(){if(this instanceof h){var m=f.apply(this,i(d,arguments));return Object(m)===m?m:this}return f.apply(c,i(d,arguments))},y=r(0,f.length-d.length),I=[],S=0;S<y;S++)I[S]="$"+S;if(h=Function("binder","return function ("+o(I,",")+"){ return binder.apply(this,arguments); }")(_),f.prototype){var b=function(){};b.prototype=f.prototype,h.prototype=new b,b.prototype=null}return h},eu}function cu(){if(Tg)return tu;Tg=!0;var t=jE();return tu=Function.prototype.bind||t,tu}function $E(){if(Pg)return ru;Pg=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=cu();return ru=r.call(t,e),ru}function Tr(){if(Og)return nu;Og=!0;var t,e=BE(),r=NE(),n=LE(),i=qE(),s=qg(),o=sn(),u=DE(),c=Function,f=function(z){try{return c('"use strict"; return ('+z+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var h=function(){throw new o},_=d?(function(){try{return arguments.callee,h}catch{try{return d(arguments,"callee").get}catch{return h}}})():h,y=UE()(),I=FE()(),S=Object.getPrototypeOf||(I?function(z){return z.__proto__}:null),b={},m=typeof Uint8Array>"u"||!S?t:S(Uint8Array),w={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":y&&S?S([][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&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!S?t:S(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||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&S?S(""[Symbol.iterator]()):t,"%Symbol%":y?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":_,"%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%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(S)try{null.error}catch(z){var R=S(S(z));w["%Error.prototype%"]=R}var A=function z(W){var te;if(W==="%AsyncFunction%")te=f("async function () {}");else if(W==="%GeneratorFunction%")te=f("function* () {}");else if(W==="%AsyncGeneratorFunction%")te=f("async function* () {}");else if(W==="%AsyncGenerator%"){var Y=z("%AsyncGeneratorFunction%");Y&&(te=Y.prototype)}else if(W==="%AsyncIteratorPrototype%"){var X=z("%AsyncGenerator%");X&&S&&(te=S(X.prototype))}return w[W]=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=cu(),v=$E(),B=O.call(Function.call,Array.prototype.concat),D=O.call(Function.apply,Array.prototype.splice),L=O.call(Function.call,String.prototype.replace),K=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,J=function(W){var te=K(W,0,1),Y=K(W,-1);if(te==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var X=[];return L(W,$,function(ce,Z,ne,de){X[X.length]=ne?L(de,G,"$1"):Z||ce}),X},ee=function(W,te){var Y=W,X;if(v(g,Y)&&(X=g[Y],Y="%"+X[0]+"%"),v(w,Y)){var ce=w[Y];if(ce===b&&(ce=A(Y)),typeof ce>"u"&&!te)throw new o("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:X,name:Y,value:ce}}throw new s("intrinsic "+W+" does not exist!")};return nu=function(W,te){if(typeof W!="string"||W.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(U(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=J(W),X=Y.length>0?Y[0]:"",ce=ee("%"+X+"%",te),Z=ce.name,ne=ce.value,de=!1,be=ce.alias;be&&(X=be[0],D(Y,B([0,1],be)));for(var ge=1,Ae=!0;ge<Y.length;ge+=1){var we=Y[ge],ve=K(we,0,1),Oe=K(we,-1);if((ve==='"'||ve==="'"||ve==="`"||Oe==='"'||Oe==="'"||Oe==="`")&&ve!==Oe)throw new s("property names with quotes must have matching quotes");if((we==="constructor"||!Ae)&&(de=!0),X+="."+we,Z="%"+X+"%",v(w,Z))ne=w[Z];else if(ne!=null){if(!(we in ne)){if(!te)throw new o("base intrinsic for "+W+" exists, but the property is not available.");return}if(d&&ge+1>=Y.length){var xe=d(ne,we);Ae=!!xe,Ae&&"get"in xe&&!("originalValue"in xe.get)?ne=xe.get:ne=ne[we]}else Ae=v(ne,we),ne=ne[we];Ae&&!de&&(w[Z]=ne)}}return ne},nu}function fu(){if(Rg)return iu;Rg=!0;var t=Tr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return iu=e,iu}function Dg(){if(kg)return ou;kg=!0;var t=Tr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return ou=e,ou}function WE(){if(Cg)return su;Cg=!0;var t=fu(),e=qg(),r=sn(),n=Dg();return su=function(s,o,u){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,d=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,_=!!n&&n(s,o);if(t)t(s,o,{configurable:d===null&&_?_.configurable:!d,enumerable:c===null&&_?_.enumerable:!c,value:u,writable:f===null&&_?_.writable:!f});else if(h||!c&&!f&&!d)s[o]=u;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},su}function VE(){if(Mg)return au;Mg=!0;var t=fu(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},au=e,au}function HE(){if(Bg)return uu;Bg=!0;var t=Tr(),e=WE(),r=VE()(),n=Dg(),i=sn(),s=t("%Math.floor%");return uu=function(u,c){if(typeof u!="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],d=!0,h=!0;if("length"in u&&n){var _=n(u,"length");_&&!_.configurable&&(d=!1),_&&!_.writable&&(h=!1)}return(d||h||!f)&&(r?e(u,"length",c,!0,!0):e(u,"length",c)),u},uu}function zE(){if(Ng)return ri;Ng=!0;var t=cu(),e=Tr(),r=HE(),n=sn(),i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),o=e("%Reflect.apply%",!0)||t.call(s,i),u=fu(),c=e("%Math.max%");ri=function(h){if(typeof h!="function")throw new n("a function is required");var _=o(t,s,arguments);return r(_,1+c(0,h.length-(arguments.length-1)),!0)};var f=function(){return o(t,i,arguments)};return u?u(ri,"apply",{value:f}):ri.apply=f,ri}function Ug(){if(Lg)return lu;Lg=!0;var t=Tr(),e=zE(),r=e(t("String.prototype.indexOf"));return lu=function(i,s){var o=t(i,!!s);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},lu}var Va,yg,Ha,bg,za,mg,Ga,_g,Qa,wg,Ka,vg,Ya,Sg,Ja,Eg,Xa,Ag,Za,Ig,eu,xg,tu,Tg,ru,Pg,nu,Og,iu,Rg,ou,kg,su,Cg,au,Mg,uu,Bg,ri,Ng,lu,Lg,Fg=ze(()=>{x();P();T();Va={},yg=!1;Ha={},bg=!1;za={},mg=!1;Ga={},_g=!1;Qa={},wg=!1;Ka={},vg=!1;Ya={},Sg=!1;Ja={},Eg=!1;Xa={},Ag=!1;Za={},Ig=!1;eu={},xg=!1;tu={},Tg=!1;ru={},Pg=!1;nu={},Og=!1;iu={},Rg=!1;ou={},kg=!1;su={},Cg=!1;au={},Mg=!1;uu={},Bg=!1;ri={},Ng=!1;lu={},Lg=!1});function gu(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function GE(){!an||!Pr||(an=!1,Pr.length?Dt=Pr.concat(Dt):bo=-1,Dt.length&&jg())}function jg(){if(!an){var t=setTimeout(GE,0);an=!0;for(var e=Dt.length;e;){for(Pr=Dt,Dt=[];++bo<e;)Pr&&Pr[bo].run();bo=-1,e=Dt.length}Pr=null,an=!1,clearTimeout(t)}}function QE(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];Dt.push(new $g(t,e)),Dt.length===1&&!an&&setTimeout(jg,0)}function $g(t,e){this.fun=t,this.array=e}function $e(){}function f1(t){gu("_linkedBinding")}function g1(t){gu("dlopen")}function y1(){return[]}function b1(){return[]}function x1(t,e){if(!t)throw new Error(e||"assertion error")}function R1(){return!1}function G1(){return ir.now()/1e3}function pu(t){var e=Math.floor((Date.now()-ir.now())*.001),r=ir.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+=hu)),[n,i]}function or(){return bu}function oA(t){return[]}var Dt,an,Pr,bo,KE,YE,JE,XE,ZE,e1,t1,r1,n1,i1,o1,s1,a1,u1,l1,c1,d1,h1,p1,m1,_1,yu,w1,v1,S1,E1,A1,I1,T1,P1,O1,k1,C1,M1,B1,N1,L1,q1,D1,U1,F1,j1,$1,W1,V1,H1,z1,ir,du,hu,Q1,K1,Y1,J1,X1,Z1,eA,tA,rA,nA,iA,bu,mu=ze(()=>{x();P();T();Dt=[],an=!1,bo=-1;$g.prototype.run=function(){this.fun.apply(null,this.array)};KE="browser",YE="x64",JE="browser",XE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},ZE=["/usr/bin/node"],e1=[],t1="v16.8.0",r1={},n1=function(t,e){console.warn((e?e+": ":"")+t)},i1=function(t){gu("binding")},o1=function(t){return 0},s1=function(){return"/"},a1=function(t){},u1={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};l1=$e,c1=[];d1={},h1=!1,p1={};m1=$e,_1=$e,yu=function(){return{}},w1=yu,v1=yu,S1=$e,E1=$e,A1=$e,I1={};T1={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},P1=$e,O1=$e;k1=$e,C1=$e,M1=$e,B1=$e,N1=$e,L1=void 0,q1=void 0,D1=void 0,U1=$e,F1=2,j1=1,$1="/bin/usr/node",W1=9229,V1="node",H1=[],z1=$e,ir={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};ir.now===void 0&&(du=Date.now(),ir.timing&&ir.timing.navigationStart&&(du=ir.timing.navigationStart),ir.now=()=>Date.now()-du);hu=1e9;pu.bigint=function(t){var e=pu(t);return typeof BigInt>"u"?e[0]*hu+e[1]:BigInt(e[0]*hu)+BigInt(e[1])};Q1=10,K1={},Y1=0;J1=or,X1=or,Z1=or,eA=or,tA=or,rA=$e,nA=or,iA=or;bu={version:t1,versions:r1,arch:YE,platform:JE,release:u1,_rawDebug:l1,moduleLoadList:c1,binding:i1,_linkedBinding:f1,_events:K1,_eventsCount:Y1,_maxListeners:Q1,on:or,addListener:J1,once:X1,off:Z1,removeListener:eA,removeAllListeners:tA,emit:rA,prependListener:nA,prependOnceListener:iA,listeners:oA,domain:d1,_exiting:h1,config:p1,dlopen:g1,uptime:G1,_getActiveRequests:y1,_getActiveHandles:b1,reallyExit:m1,_kill:_1,cpuUsage:yu,resourceUsage:w1,memoryUsage:v1,kill:S1,exit:E1,openStdin:A1,allowedNodeEnvironmentFlags:I1,assert:x1,features:T1,_fatalExceptions:P1,setUncaughtExceptionCaptureCallback:O1,hasUncaughtExceptionCaptureCallback:R1,emitWarning:n1,nextTick:QE,_tickCallback:k1,_debugProcess:C1,_debugEnd:M1,_startProfilerIdleNotifier:B1,_stopProfilerIdleNotifier:N1,stdout:L1,stdin:D1,stderr:q1,abort:U1,umask:o1,chdir:a1,cwd:s1,env:XE,title:KE,argv:ZE,execArgv:e1,pid:F1,ppid:j1,execPath:$1,debugPort:W1,hrtime:pu,argv0:V1,_preload_modules:H1,setSourceMapsEnabled:z1}});function sA(){if(Wg)return _u;Wg=!0;var t=bu;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 u="",c=0,f=-1,d=0,h,_=0;_<=s.length;++_){if(_<s.length)h=s.charCodeAt(_);else{if(h===47)break;h=47}if(h===47){if(!(f===_-1||d===1))if(f!==_-1&&d===2){if(u.length<2||c!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var y=u.lastIndexOf("/");if(y!==u.length-1){y===-1?(u="",c=0):(u=u.slice(0,y),c=u.length-1-u.lastIndexOf("/")),f=_,d=0;continue}}else if(u.length===2||u.length===1){u="",c=0,f=_,d=0;continue}}o&&(u.length>0?u+="/..":u="..",c=2)}else u.length>0?u+="/"+s.slice(f+1,_):u=s.slice(f+1,_),c=_-f-1;f=_,d=0}else h===46&&d!==-1?++d:d=-1}return u}function n(s,o){var u=o.dir||o.root,c=o.base||(o.name||"")+(o.ext||"");return u?u===o.root?u+c:u+s+c:c}var i={resolve:function(){for(var o="",u=!1,c,f=arguments.length-1;f>=-1&&!u;f--){var d;f>=0?d=arguments[f]:(c===void 0&&(c=t.cwd()),d=c),e(d),d.length!==0&&(o=d+"/"+o,u=d.charCodeAt(0)===47)}return o=r(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var u=o.charCodeAt(0)===47,c=o.charCodeAt(o.length-1)===47;return o=r(o,!u),o.length===0&&!u&&(o="."),o.length>0&&c&&(o+="/"),u?"/"+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,u=0;u<arguments.length;++u){var c=arguments[u];e(c),c.length>0&&(o===void 0?o=c:o+="/"+c)}return o===void 0?".":i.normalize(o)},relative:function(o,u){if(e(o),e(u),o===u||(o=i.resolve(o),u=i.resolve(u),o===u))return"";for(var c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var f=o.length,d=f-c,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var _=u.length,y=_-h,I=d<y?d:y,S=-1,b=0;b<=I;++b){if(b===I){if(y>I){if(u.charCodeAt(h+b)===47)return u.slice(h+b+1);if(b===0)return u.slice(h+b)}else d>I&&(o.charCodeAt(c+b)===47?S=b:b===0&&(S=0));break}var m=o.charCodeAt(c+b),w=u.charCodeAt(h+b);if(m!==w)break;m===47&&(S=b)}var R="";for(b=c+S+1;b<=f;++b)(b===f||o.charCodeAt(b)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(h+S):(h+=S,u.charCodeAt(h)===47&&++h,u.slice(h))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var u=o.charCodeAt(0),c=u===47,f=-1,d=!0,h=o.length-1;h>=1;--h)if(u=o.charCodeAt(h),u===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":o.slice(0,f)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');e(o);var c=0,f=-1,d=!0,h;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var _=u.length-1,y=-1;for(h=o.length-1;h>=0;--h){var I=o.charCodeAt(h);if(I===47){if(!d){c=h+1;break}}else y===-1&&(d=!1,y=h+1),_>=0&&(I===u.charCodeAt(_)?--_===-1&&(f=h):(_=-1,f=y))}return c===f?f=y:f===-1&&(f=o.length),o.slice(c,f)}else{for(h=o.length-1;h>=0;--h)if(o.charCodeAt(h)===47){if(!d){c=h+1;break}}else f===-1&&(d=!1,f=h+1);return f===-1?"":o.slice(c,f)}},extname:function(o){e(o);for(var u=-1,c=0,f=-1,d=!0,h=0,_=o.length-1;_>=0;--_){var y=o.charCodeAt(_);if(y===47){if(!d){c=_+1;break}continue}f===-1&&(d=!1,f=_+1),y===46?u===-1?u=_:h!==1&&(h=1):u!==-1&&(h=-1)}return u===-1||f===-1||h===0||h===1&&u===f-1&&u===c+1?"":o.slice(u,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 u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var c=o.charCodeAt(0),f=c===47,d;f?(u.root="/",d=1):d=0;for(var h=-1,_=0,y=-1,I=!0,S=o.length-1,b=0;S>=d;--S){if(c=o.charCodeAt(S),c===47){if(!I){_=S+1;break}continue}y===-1&&(I=!1,y=S+1),c===46?h===-1?h=S:b!==1&&(b=1):h!==-1&&(b=-1)}return h===-1||y===-1||b===0||b===1&&h===y-1&&h===_+1?y!==-1&&(_===0&&f?u.base=u.name=o.slice(1,y):u.base=u.name=o.slice(_,y)):(_===0&&f?(u.name=o.slice(1,h),u.base=o.slice(1,y)):(u.name=o.slice(_,h),u.base=o.slice(_,y)),u.ext=o.slice(h,y)),_>0?u.dir=o.slice(0,_-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,_u=i,_u}var _u,Wg,wu,Vg=ze(()=>{x();P();T();mu();_u={},Wg=!1;wu=sA()});var ry={};Mr(ry,{URL:()=>wA,Url:()=>gA,default:()=>He,fileURLToPath:()=>ey,format:()=>yA,parse:()=>_A,pathToFileURL:()=>ty,resolve:()=>bA,resolveObject:()=>mA});function uA(){if(Hg)return vu;Hg=!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,u=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,f=c?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,h=d?WeakSet.prototype.has:null,_=typeof WeakRef=="function"&&WeakRef.prototype,y=_?WeakRef.prototype.deref:null,I=Boolean.prototype.valueOf,S=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,w=String.prototype.slice,R=String.prototype.replace,A=String.prototype.toUpperCase,g=String.prototype.toLowerCase,O=RegExp.prototype.test,v=Array.prototype.concat,B=Array.prototype.join,D=Array.prototype.slice,L=Math.floor,K=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,ee=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function W(k,M){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||O.call(/e/,M))return M;var re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var ie=k<0?-L(-k):L(k);if(ie!==k){var oe=String(ie),fe=w.call(M,oe.length+1);return R.call(oe,re,"$&_")+"."+R.call(R.call(fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(M,re,"$&_")}var te=aA,Y=te.custom,X=Oe(Y)?Y:null;vu=function k(M,re,ie,oe){var fe=re||{};if(Re(fe,"quoteStyle")&&fe.quoteStyle!=="single"&&fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(fe,"maxStringLength")&&(typeof fe.maxStringLength=="number"?fe.maxStringLength<0&&fe.maxStringLength!==1/0:fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ft=Re(fe,"customInspect")?fe.customInspect:!0;if(typeof Ft!="boolean"&&Ft!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(fe,"indent")&&fe.indent!==null&&fe.indent!==" "&&!(parseInt(fe.indent,10)===fe.indent&&fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(fe,"numericSeparator")&&typeof fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ur=fe.numericSeparator;if(typeof M>"u")return"undefined";if(M===null)return"null";if(typeof M=="boolean")return M?"true":"false";if(typeof M=="string")return ot(M,fe);if(typeof M=="number"){if(M===0)return 1/0/M>0?"0":"-0";var Ke=String(M);return ur?W(M,Ke):Ke}if(typeof M=="bigint"){var jt=String(M)+"n";return ur?W(M,jt):jt}var Eo=typeof fe.depth>"u"?5:fe.depth;if(typeof ie>"u"&&(ie=0),ie>=Eo&&Eo>0&&typeof M=="object")return ne(M)?"[Array]":"[Object]";var kr=C(fe,ie);if(typeof oe>"u")oe=[];else if(Et(oe,M)>=0)return"[Circular]";function st(Cr,fi,Iy){if(fi&&(oe=D.call(oe),oe.push(fi)),Iy){var nl={depth:fe.depth};return Re(fe,"quoteStyle")&&(nl.quoteStyle=fe.quoteStyle),k(Cr,nl,ie+1,oe)}return k(Cr,fe,ie+1,oe)}if(typeof M=="function"&&!be(M)){var Yu=St(M),Ju=F(M,st);return"[Function"+(Yu?": "+Yu:" (anonymous)")+"]"+(Ju.length>0?" { "+B.call(Ju,", ")+" }":"")}if(Oe(M)){var Xu=G?R.call(String(M),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(M);return typeof M=="object"&&!G?p(Xu):Xu}if(vo(M)){for(var dn="<"+g.call(String(M.nodeName)),Ao=M.attributes||[],ci=0;ci<Ao.length;ci++)dn+=" "+Ao[ci].name+"="+ce(Z(Ao[ci].value),"double",fe);return dn+=">",M.childNodes&&M.childNodes.length&&(dn+="..."),dn+="</"+g.call(String(M.nodeName))+">",dn}if(ne(M)){if(M.length===0)return"[]";var Io=F(M,st);return kr&&!E(Io)?"["+N(Io,kr)+"]":"[ "+B.call(Io,", ")+" ]"}if(ge(M)){var xo=F(M,st);return!("cause"in Error.prototype)&&"cause"in M&&!ee.call(M,"cause")?"{ ["+String(M)+"] "+B.call(v.call("[cause]: "+st(M.cause),xo),", ")+" }":xo.length===0?"["+String(M)+"]":"{ ["+String(M)+"] "+B.call(xo,", ")+" }"}if(typeof M=="object"&&Ft){if(X&&typeof M[X]=="function"&&te)return te(M,{depth:Eo-ie});if(Ft!=="symbol"&&typeof M.inspect=="function")return M.inspect()}if(cn(M)){var Zu=[];return n&&n.call(M,function(Cr,fi){Zu.push(st(fi,M,!0)+" => "+st(Cr,M))}),l("Map",r.call(M),Zu,kr)}if(Xe(M)){var el=[];return u&&u.call(M,function(Cr){el.push(st(Cr,M))}),l("Set",o.call(M),el,kr)}if(li(M))return a("WeakMap");if(fn(M))return a("WeakSet");if(Rr(M))return a("WeakRef");if(we(M))return p(st(Number(M)));if(xe(M))return p(st(K.call(M)));if(ve(M))return p(I.call(M));if(Ae(M))return p(st(String(M)));if(typeof window<"u"&&M===window)return"{ [object Window] }";if(typeof globalThis<"u"&&M===globalThis||typeof Su<"u"&&M===Su)return"{ [object globalThis] }";if(!de(M)&&!be(M)){var To=F(M,st),tl=z?z(M)===Object.prototype:M instanceof Object||M.constructor===Object,Po=M instanceof Object?"":"null prototype",rl=!tl&&J&&Object(M)===M&&J in M?w.call(Ne(M),8,-1):Po?"Object":"",Ay=tl||typeof M.constructor!="function"?"":M.constructor.name?M.constructor.name+" ":"",Oo=Ay+(rl||Po?"["+B.call(v.call([],rl||[],Po||[]),": ")+"] ":"");return To.length===0?Oo+"{}":kr?Oo+"{"+N(To,kr)+"}":Oo+"{ "+B.call(To,", ")+" }"}return String(M)};function ce(k,M,re){var ie=(re.quoteStyle||M)==="double"?'"':"'";return ie+k+ie}function Z(k){return R.call(String(k),/"/g,"&quot;")}function ne(k){return Ne(k)==="[object Array]"&&(!J||!(typeof k=="object"&&J in k))}function de(k){return Ne(k)==="[object Date]"&&(!J||!(typeof k=="object"&&J in k))}function be(k){return Ne(k)==="[object RegExp]"&&(!J||!(typeof k=="object"&&J in k))}function ge(k){return Ne(k)==="[object Error]"&&(!J||!(typeof k=="object"&&J in k))}function Ae(k){return Ne(k)==="[object String]"&&(!J||!(typeof k=="object"&&J in k))}function we(k){return Ne(k)==="[object Number]"&&(!J||!(typeof k=="object"&&J in k))}function ve(k){return Ne(k)==="[object Boolean]"&&(!J||!(typeof k=="object"&&J 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"||!$)return!1;try{return $.call(k),!0}catch{}return!1}function xe(k){if(!k||typeof k!="object"||!K)return!1;try{return K.call(k),!0}catch{}return!1}var it=Object.prototype.hasOwnProperty||function(k){return k in(this||Su)};function Re(k,M){return it.call(k,M)}function Ne(k){return S.call(k)}function St(k){if(k.name)return k.name;var M=m.call(b.call(k),/^function\s*([\w$]+)/);return M?M[1]:null}function Et(k,M){if(k.indexOf)return k.indexOf(M);for(var re=0,ie=k.length;re<ie;re++)if(k[re]===M)return re;return-1}function cn(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 li(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{h.call(k,h)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function Rr(k){if(!y||!k||typeof k!="object")return!1;try{return y.call(k),!0}catch{}return!1}function Xe(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 fn(k){if(!h||!k||typeof k!="object")return!1;try{h.call(k,h);try{f.call(k,f)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function vo(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function ot(k,M){if(k.length>M.maxStringLength){var re=k.length-M.maxStringLength,ie="... "+re+" more character"+(re>1?"s":"");return ot(w.call(k,0,M.maxStringLength),M)+ie}var oe=R.call(R.call(k,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,So);return ce(oe,"single",M)}function So(k){var M=k.charCodeAt(0),re={8:"b",9:"t",10:"n",12:"f",13:"r"}[M];return re?"\\"+re:"\\x"+(M<16?"0":"")+A.call(M.toString(16))}function p(k){return"Object("+k+")"}function a(k){return k+" { ? }"}function l(k,M,re,ie){var oe=ie?N(re,ie):B.call(re,", ");return k+" ("+M+") {"+oe+"}"}function E(k){for(var M=0;M<k.length;M++)if(Et(k[M],`
4
+ `)>=0)return!1;return!0}function C(k,M){var re;if(k.indent===" ")re=" ";else if(typeof k.indent=="number"&&k.indent>0)re=B.call(Array(k.indent+1)," ");else return null;return{base:re,prev:B.call(Array(M+1),re)}}function N(k,M){if(k.length===0)return"";var re=`
5
+ `+M.prev+M.base;return re+B.call(k,","+re)+`
6
+ `+M.prev}function F(k,M){var re=ne(k),ie=[];if(re){ie.length=k.length;for(var oe=0;oe<k.length;oe++)ie[oe]=Re(k,oe)?M(k[oe],k):""}var fe=typeof U=="function"?U(k):[],Ft;if(G){Ft={};for(var ur=0;ur<fe.length;ur++)Ft["$"+fe[ur]]=fe[ur]}for(var Ke in k)Re(k,Ke)&&(re&&String(Number(Ke))===Ke&&Ke<k.length||G&&Ft["$"+Ke]instanceof Symbol||(O.call(/[^\w$]/,Ke)?ie.push(M(Ke,k)+": "+M(k[Ke],k)):ie.push(Ke+": "+M(k[Ke],k))));if(typeof U=="function")for(var jt=0;jt<fe.length;jt++)ee.call(k,fe[jt])&&ie.push("["+M(fe[jt])+"]: "+M(k[fe[jt]],k));return ie}return vu}function lA(){if(zg)return Eu;zg=!0;var t=Tr(),e=Ug(),r=uA(),n=sn(),i=t("%WeakMap%",!0),s=t("%Map%",!0),o=e("WeakMap.prototype.get",!0),u=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),d=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),_=function(b,m){for(var w=b,R;(R=w.next)!==null;w=R)if(R.key===m)return w.next=R.next,R.next=b.next,b.next=R,R},y=function(b,m){var w=_(b,m);return w&&w.value},I=function(b,m,w){var R=_(b,m);R?R.value=w:b.next={key:m,next:b.next,value:w}},S=function(b,m){return!!_(b,m)};return Eu=function(){var m,w,R,A={assert:function(g){if(!A.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(w)return f(w,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(w)return h(w,g)}else if(R)return S(R,g);return!1},set:function(g,O){i&&g&&(typeof g=="object"||typeof g=="function")?(m||(m=new i),u(m,g,O)):s?(w||(w=new s),d(w,g,O)):(R||(R={key:{},next:null}),I(R,g,O))}};return A},Eu}function Ru(){if(Gg)return Au;Gg=!0;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Au={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Au}function Zg(){if(Qg)return Iu;Qg=!0;var t=Ru(),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 w=m.pop(),R=w.obj[w.prop];if(r(R)){for(var A=[],g=0;g<R.length;++g)typeof R[g]<"u"&&A.push(R[g]);w.obj[w.prop]=A}}},s=function(m,w){for(var R=w&&w.plainObjects?Object.create(null):{},A=0;A<m.length;++A)typeof m[A]<"u"&&(R[A]=m[A]);return R},o=function b(m,w,R){if(!w)return m;if(typeof w!="object"){if(r(m))m.push(w);else if(m&&typeof m=="object")(R&&(R.plainObjects||R.allowPrototypes)||!e.call(Object.prototype,w))&&(m[w]=!0);else return[m,w];return m}if(!m||typeof m!="object")return[m].concat(w);var A=m;return r(m)&&!r(w)&&(A=s(m,R)),r(m)&&r(w)?(w.forEach(function(g,O){if(e.call(m,O)){var v=m[O];v&&typeof v=="object"&&g&&typeof g=="object"?m[O]=b(v,g,R):m.push(g)}else m[O]=g}),m):Object.keys(w).reduce(function(g,O){var v=w[O];return e.call(g,O)?g[O]=b(g[O],v,R):g[O]=v,g},A)},u=function(m,w){return Object.keys(w).reduce(function(R,A){return R[A]=w[A],R},m)},c=function(b,m,w){var R=b.replace(/\+/g," ");if(w==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},f=1024,d=function(m,w,R,A,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($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var v="",B=0;B<O.length;B+=f){for(var D=O.length>=f?O.slice(B,B+f):O,L=[],K=0;K<D.length;++K){var U=D.charCodeAt(K);if(U===45||U===46||U===95||U===126||U>=48&&U<=57||U>=65&&U<=90||U>=97&&U<=122||g===t.RFC1738&&(U===40||U===41)){L[L.length]=D.charAt(K);continue}if(U<128){L[L.length]=n[U];continue}if(U<2048){L[L.length]=n[192|U>>6]+n[128|U&63];continue}if(U<55296||U>=57344){L[L.length]=n[224|U>>12]+n[128|U>>6&63]+n[128|U&63];continue}K+=1,U=65536+((U&1023)<<10|D.charCodeAt(K)&1023),L[L.length]=n[240|U>>18]+n[128|U>>12&63]+n[128|U>>6&63]+n[128|U&63]}v+=L.join("")}return v},h=function(m){for(var w=[{obj:{o:m},prop:"o"}],R=[],A=0;A<w.length;++A)for(var g=w[A],O=g.obj[g.prop],v=Object.keys(O),B=0;B<v.length;++B){var D=v[B],L=O[D];typeof L=="object"&&L!==null&&R.indexOf(L)===-1&&(w.push({obj:O,prop:D}),R.push(L))}return i(w),m},_=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))},I=function(m,w){return[].concat(m,w)},S=function(m,w){if(r(m)){for(var R=[],A=0;A<m.length;A+=1)R.push(w(m[A]));return R}return w(m)};return Iu={arrayToObject:s,assign:u,combine:I,compact:h,decode:c,encode:d,isBuffer:y,isRegExp:_,maybeMap:S,merge:o},Iu}function cA(){if(Kg)return xu;Kg=!0;var t=lA(),e=Zg(),r=Ru(),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,u=function(S,b){o.apply(S,s(b)?b:[b])},c=Date.prototype.toISOString,f=r.default,d={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},h=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},_={},y=function S(b,m,w,R,A,g,O,v,B,D,L,K,U,$,G,J,ee,z){for(var W=b,te=z,Y=0,X=!1;(te=te.get(_))!==void 0&&!X;){var ce=te.get(b);if(Y+=1,typeof ce<"u"){if(ce===Y)throw new RangeError("Cyclic object value");X=!0}typeof te.get(_)>"u"&&(Y=0)}if(typeof D=="function"?W=D(m,W):W instanceof Date?W=U(W):w==="comma"&&s(W)&&(W=e.maybeMap(W,function(Ne){return Ne instanceof Date?U(Ne):Ne})),W===null){if(g)return B&&!J?B(m,d.encoder,ee,"key",$):m;W=""}if(h(W)||e.isBuffer(W)){if(B){var Z=J?m:B(m,d.encoder,ee,"key",$);return[G(Z)+"="+G(B(W,d.encoder,ee,"value",$))]}return[G(m)+"="+G(String(W))]}var ne=[];if(typeof W>"u")return ne;var de;if(w==="comma"&&s(W))J&&B&&(W=e.maybeMap(W,B)),de=[{value:W.length>0?W.join(",")||null:void 0}];else if(s(D))de=D;else{var be=Object.keys(W);de=L?be.sort(L):be}var ge=v?m.replace(/\./g,"%2E"):m,Ae=R&&s(W)&&W.length===1?ge+"[]":ge;if(A&&s(W)&&W.length===0)return Ae+"[]";for(var we=0;we<de.length;++we){var ve=de[we],Oe=typeof ve=="object"&&typeof ve.value<"u"?ve.value:W[ve];if(!(O&&Oe===null)){var xe=K&&v?ve.replace(/\./g,"%2E"):ve,it=s(W)?typeof w=="function"?w(Ae,xe):Ae:Ae+(K?"."+xe:"["+xe+"]");z.set(b,Y);var Re=t();Re.set(_,z),u(ne,S(Oe,it,w,R,A,g,O,v,w==="comma"&&J&&s(W)?null:B,D,L,K,U,$,G,J,ee,Re))}}return ne},I=function(b){if(!b)return d;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||d.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 w=r.default;if(typeof b.format<"u"){if(!n.call(r.formatters,b.format))throw new TypeError("Unknown format option provided.");w=b.format}var R=r.formatters[w],A=d.filter;(typeof b.filter=="function"||s(b.filter))&&(A=b.filter);var g;if(b.arrayFormat in i?g=b.arrayFormat:"indices"in b?g=b.indices?"indices":"repeat":g=d.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:d.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:d.addQueryPrefix,allowDots:O,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:g,charset:m,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:d.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?d.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:d.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:d.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:d.encodeValuesOnly,filter:A,format:w,formatter:R,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:d.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:d.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:d.strictNullHandling}};return xu=function(S,b){var m=S,w=I(b),R,A;typeof w.filter=="function"?(A=w.filter,m=A("",m)):s(w.filter)&&(A=w.filter,R=A);var g=[];if(typeof m!="object"||m===null)return"";var O=i[w.arrayFormat],v=O==="comma"&&w.commaRoundTrip;R||(R=Object.keys(m)),w.sort&&R.sort(w.sort);for(var B=t(),D=0;D<R.length;++D){var L=R[D];w.skipNulls&&m[L]===null||u(g,y(m[L],L,O,v,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,B))}var K=g.join(w.delimiter),U=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?U+="utf8=%26%2310003%3B&":U+="utf8=%E2%9C%93&"),K.length>0?U+K:""},xu}function fA(){if(Yg)return Tu;Yg=!0;var t=Zg(),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(_){return _.replace(/&#(\d+);/g,function(y,I){return String.fromCharCode(parseInt(I,10))})},s=function(_,y){return _&&typeof _=="string"&&y.comma&&_.indexOf(",")>-1?_.split(","):_},o="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",c=function(y,I){var S={__proto__:null},b=I.ignoreQueryPrefix?y.replace(/^\?/,""):y;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=I.parameterLimit===1/0?void 0:I.parameterLimit,w=b.split(I.delimiter,m),R=-1,A,g=I.charset;if(I.charsetSentinel)for(A=0;A<w.length;++A)w[A].indexOf("utf8=")===0&&(w[A]===u?g="utf-8":w[A]===o&&(g="iso-8859-1"),R=A,A=w.length);for(A=0;A<w.length;++A)if(A!==R){var O=w[A],v=O.indexOf("]="),B=v===-1?O.indexOf("="):v+1,D,L;B===-1?(D=I.decoder(O,n.decoder,g,"key"),L=I.strictNullHandling?null:""):(D=I.decoder(O.slice(0,B),n.decoder,g,"key"),L=t.maybeMap(s(O.slice(B+1),I),function(U){return I.decoder(U,n.decoder,g,"value")})),L&&I.interpretNumericEntities&&g==="iso-8859-1"&&(L=i(L)),O.indexOf("[]=")>-1&&(L=r(L)?[L]:L);var K=e.call(S,D);K&&I.duplicates==="combine"?S[D]=t.combine(S[D],L):(!K||I.duplicates==="last")&&(S[D]=L)}return S},f=function(_,y,I,S){for(var b=S?y:s(y,I),m=_.length-1;m>=0;--m){var w,R=_[m];if(R==="[]"&&I.parseArrays)w=I.allowEmptyArrays&&(b===""||I.strictNullHandling&&b===null)?[]:[].concat(b);else{w=I.plainObjects?Object.create(null):{};var A=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,g=I.decodeDotInKeys?A.replace(/%2E/g,"."):A,O=parseInt(g,10);!I.parseArrays&&g===""?w={0:b}:!isNaN(O)&&R!==g&&String(O)===g&&O>=0&&I.parseArrays&&O<=I.arrayLimit?(w=[],w[O]=b):g!=="__proto__"&&(w[g]=b)}b=w}return b},d=function(y,I,S,b){if(y){var m=S.allowDots?y.replace(/\.([^.[]+)/g,"[$1]"):y,w=/(\[[^[\]]*])/,R=/(\[[^[\]]*])/g,A=S.depth>0&&w.exec(m),g=A?m.slice(0,A.index):m,O=[];if(g){if(!S.plainObjects&&e.call(Object.prototype,g)&&!S.allowPrototypes)return;O.push(g)}for(var v=0;S.depth>0&&(A=R.exec(m))!==null&&v<S.depth;){if(v+=1,!S.plainObjects&&e.call(Object.prototype,A[1].slice(1,-1))&&!S.allowPrototypes)return;O.push(A[1])}if(A){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");O.push("["+m.slice(A.index)+"]")}return f(O,I,S,b)}},h=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 I=typeof y.charset>"u"?n.charset:y.charset,S=typeof y.duplicates>"u"?n.duplicates:y.duplicates;if(S!=="combine"&&S!=="first"&&S!=="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:I,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:S,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 Tu=function(_,y){var I=h(y);if(_===""||_===null||typeof _>"u")return I.plainObjects?Object.create(null):{};for(var S=typeof _=="string"?c(_,I):_,b=I.plainObjects?Object.create(null):{},m=Object.keys(S),w=0;w<m.length;++w){var R=m[w],A=d(R,S[R],I,typeof _=="string");b=t.merge(b,A,I)}return I.allowSparse===!0?b:t.compact(b)},Tu}function dA(){if(Jg)return Pu;Jg=!0;var t=cA(),e=fA(),r=Ru();return Pu={formats:r,parse:e,stringify:t},Pu}function hA(){if(Xg)return Or;Xg=!0;var t=nr;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",`
7
+ `," "],o=["{","}","|","\\","^","`"].concat(s),u=["'"].concat(o),c=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=dA();function m(g,O,v){if(g&&typeof g=="object"&&g instanceof e)return g;var B=new e;return B.parse(g,O,v),B}e.prototype.parse=function(g,O,v){if(typeof g!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof g);var B=g.indexOf("?"),D=B!==-1&&B<g.indexOf("#")?"?":"#",L=g.split(D),K=/\\/g;L[0]=L[0].replace(K,"/"),g=L.join(D);var U=g;if(U=U.trim(),!v&&g.split("#").length===1){var $=i.exec(U);if($)return this.path=U,this.href=U,this.pathname=$[1],$[2]?(this.search=$[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(U);if(G){G=G[0];var J=G.toLowerCase();this.protocol=J,U=U.substr(G.length)}if(v||G||U.match(/^\/\/[^@/]+@[^@/]+/)){var ee=U.substr(0,2)==="//";ee&&!(G&&I[G])&&(U=U.substr(2),this.slashes=!0)}if(!I[G]&&(ee||G&&!S[G])){for(var z=-1,W=0;W<f.length;W++){var te=U.indexOf(f[W]);te!==-1&&(z===-1||te<z)&&(z=te)}var Y,X;z===-1?X=U.lastIndexOf("@"):X=U.lastIndexOf("@",z),X!==-1&&(Y=U.slice(0,X),U=U.slice(X+1),this.auth=decodeURIComponent(Y)),z=-1;for(var W=0;W<c.length;W++){var te=U.indexOf(c[W]);te!==-1&&(z===-1||te<z)&&(z=te)}z===-1&&(z=U.length),this.host=U.slice(0,z),U=U.slice(z),this.parseHost(),this.hostname=this.hostname||"";var ce=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ce)for(var Z=this.hostname.split(/\./),W=0,ne=Z.length;W<ne;W++){var de=Z[W];if(de&&!de.match(h)){for(var be="",ge=0,Ae=de.length;ge<Ae;ge++)de.charCodeAt(ge)>127?be+="x":be+=de[ge];if(!be.match(h)){var we=Z.slice(0,W),ve=Z.slice(W+1),Oe=de.match(_);Oe&&(we.push(Oe[1]),ve.unshift(Oe[2])),ve.length&&(U="/"+ve.join(".")+U),this.hostname=we.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),ce||(this.hostname=t.toASCII(this.hostname));var xe=this.port?":"+this.port:"",it=this.hostname||"";this.host=it+xe,this.href+=this.host,ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),U[0]!=="/"&&(U="/"+U))}if(!y[J])for(var W=0,ne=u.length;W<ne;W++){var Re=u[W];if(U.indexOf(Re)!==-1){var Ne=encodeURIComponent(Re);Ne===Re&&(Ne=escape(Re)),U=U.split(Re).join(Ne)}}var St=U.indexOf("#");St!==-1&&(this.hash=U.substr(St),U=U.slice(0,St));var Et=U.indexOf("?");if(Et!==-1?(this.search=U.substr(Et),this.query=U.substr(Et+1),O&&(this.query=b.parse(this.query)),U=U.slice(0,Et)):O&&(this.search="",this.query={}),U&&(this.pathname=U),S[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var xe=this.pathname||"",cn=this.search||"";this.path=xe+cn}return this.href=this.format(),this};function w(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||"",v=this.pathname||"",B=this.hash||"",D=!1,L="";this.host?D=g+this.host:this.hostname&&(D=g+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(L=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var K=this.search||L&&"?"+L||"";return O&&O.substr(-1)!==":"&&(O+=":"),this.slashes||(!O||S[O])&&D!==!1?(D="//"+(D||""),v&&v.charAt(0)!=="/"&&(v="/"+v)):D||(D=""),B&&B.charAt(0)!=="#"&&(B="#"+B),K&&K.charAt(0)!=="?"&&(K="?"+K),v=v.replace(/[?#]/g,function(U){return encodeURIComponent(U)}),K=K.replace("#","%23"),O+D+v+K+B};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 A(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 v=new e,B=Object.keys(this),D=0;D<B.length;D++){var L=B[D];v[L]=this[L]}if(v.hash=g.hash,g.href==="")return v.href=v.format(),v;if(g.slashes&&!g.protocol){for(var K=Object.keys(g),U=0;U<K.length;U++){var $=K[U];$!=="protocol"&&(v[$]=g[$])}return S[v.protocol]&&v.hostname&&!v.pathname&&(v.pathname="/",v.path=v.pathname),v.href=v.format(),v}if(g.protocol&&g.protocol!==v.protocol){if(!S[g.protocol]){for(var G=Object.keys(g),J=0;J<G.length;J++){var ee=G[J];v[ee]=g[ee]}return v.href=v.format(),v}if(v.protocol=g.protocol,!g.host&&!I[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(""),v.pathname=ne.join("/")}else v.pathname=g.pathname;if(v.search=g.search,v.query=g.query,v.host=g.host||"",v.auth=g.auth,v.hostname=g.hostname||g.host,v.port=g.port,v.pathname||v.search){var z=v.pathname||"",W=v.search||"";v.path=z+W}return v.slashes=v.slashes||g.slashes,v.href=v.format(),v}var te=v.pathname&&v.pathname.charAt(0)==="/",Y=g.host||g.pathname&&g.pathname.charAt(0)==="/",X=Y||te||v.host&&g.pathname,ce=X,Z=v.pathname&&v.pathname.split("/")||[],ne=g.pathname&&g.pathname.split("/")||[],de=v.protocol&&!S[v.protocol];if(de&&(v.hostname="",v.port=null,v.host&&(Z[0]===""?Z[0]=v.host:Z.unshift(v.host)),v.host="",g.protocol&&(g.hostname=null,g.port=null,g.host&&(ne[0]===""?ne[0]=g.host:ne.unshift(g.host)),g.host=null),X=X&&(ne[0]===""||Z[0]==="")),Y)v.host=g.host||g.host===""?g.host:v.host,v.hostname=g.hostname||g.hostname===""?g.hostname:v.hostname,v.search=g.search,v.query=g.query,Z=ne;else if(ne.length)Z||(Z=[]),Z.pop(),Z=Z.concat(ne),v.search=g.search,v.query=g.query;else if(g.search!=null){if(de){v.host=Z.shift(),v.hostname=v.host;var be=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;be&&(v.auth=be.shift(),v.hostname=be.shift(),v.host=v.hostname)}return v.search=g.search,v.query=g.query,(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.href=v.format(),v}if(!Z.length)return v.pathname=null,v.search?v.path="/"+v.search:v.path=null,v.href=v.format(),v;for(var ge=Z.slice(-1)[0],Ae=(v.host||g.host||Z.length>1)&&(ge==="."||ge==="..")||ge==="",we=0,ve=Z.length;ve>=0;ve--)ge=Z[ve],ge==="."?Z.splice(ve,1):ge===".."?(Z.splice(ve,1),we++):we&&(Z.splice(ve,1),we--);if(!X&&!ce)for(;we--;we)Z.unshift("..");X&&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(de){v.hostname=Oe?"":Z.length?Z.shift():"",v.host=v.hostname;var be=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;be&&(v.auth=be.shift(),v.hostname=be.shift(),v.host=v.hostname)}return X=X||v.host&&Z.length,X&&!Oe&&Z.unshift(""),Z.length>0?v.pathname=Z.join("/"):(v.pathname=null,v.path=null),(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.auth=g.auth||v.auth,v.slashes=v.slashes||g.slashes,v.href=v.format(),v},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)},Or.parse=m,Or.resolve=R,Or.resolveObject=A,Or.format=w,Or.Url=e,Or}function ey(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 Ou?kA(t):CA(t)}function kA(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(IA,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let n=r.codePointAt(1)|32,i=r[2];if(n<EA||n>AA||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function CA(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 ty(t){let e=wu.resolve(t),r=t.charCodeAt(t.length-1);(r===SA||Ou&&r===vA)&&e[e.length-1]!==wu.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(xA,"%25")),!Ou&&e.includes("\\")&&(e=e.replace(TA,"%5C")),e.includes(`
8
+ `)&&(e=e.replace(PA,"%0A")),e.includes("\r")&&(e=e.replace(OA,"%0D")),e.includes(" ")&&(e=e.replace(RA,"%09")),n.pathname=e,n}var aA,vu,Hg,Su,Eu,zg,Au,Gg,Iu,Qg,xu,Kg,Tu,Yg,Pu,Jg,Or,Xg,He,pA,gA,yA,bA,mA,_A,wA,vA,SA,EA,AA,Ou,IA,xA,TA,PA,OA,RA,ny=ze(()=>{x();P();T();gg();Fg();Vg();mu();aA=Object.freeze(Object.create(null)),vu={},Hg=!1,Su=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Eu={},zg=!1;Au={},Gg=!1;Iu={},Qg=!1;xu={},Kg=!1;Tu={},Yg=!1;Pu={},Jg=!1;Or={},Xg=!1;He=hA();He.parse;He.resolve;He.resolveObject;He.format;He.Url;pA=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;He.URL=typeof URL<"u"?URL:null;He.pathToFileURL=ty;He.fileURLToPath=ey;gA=He.Url,yA=He.format,bA=He.resolve,mA=He.resolveObject,_A=He.parse,wA=He.URL,vA=92,SA=47,EA=97,AA=122,Ou=pA==="win32",IA=/\//g,xA=/%/g,TA=/\\/g,PA=/\n/g,OA=/\r/g,RA=/\t/g});var oy=H((d6,iy)=>{"use strict";x();P();T();iy.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var mo=H(ni=>{"use strict";x();P();T();Object.defineProperty(ni,"__esModule",{value:!0});ni.BufferedDuplex=void 0;ni.writev=ay;var MA=Yt(),sy=(ke(),_e(Le));function ay(t,e){let r=new Array(t.length);for(let n=0;n<t.length;n++)typeof t[n].chunk=="string"?r[n]=sy.Buffer.from(t[n].chunk,"utf8"):r[n]=t[n].chunk;this._write(sy.Buffer.concat(r),"binary",e)}var ku=class extends MA.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,r,n){super({objectMode:!0}),this.proxy=r,this.socket=n,this.writeQueue=[],e.objectMode||(this._writev=ay.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)}}};ni.BufferedDuplex=ku});var ii=H(ar=>{"use strict";x();P();T();var Mu=ar&&ar.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.streamBuilder=ar.browserStreamBuilder=void 0;var _o=(ke(),_e(Le)),uy=Mu(oy()),BA=Mu(Xt()),NA=Yt(),LA=Mu(ei()),Cu=mo(),sr=(0,BA.default)("mqttjs:ws"),qA=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function ly(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 cy(t){let e=t;return t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!LA.default&&!t.forceNativeWebSocket&&t.protocol==="wss"&&qA.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function DA(t){let e=cy(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 UA(t,e,r){sr("createWebSocket"),sr(`protocol: ${r.protocolId} ${r.protocolVersion}`);let n=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";sr(`creating new Websocket for url: ${e} and protocol: ${n}`);let i;return r.createWebsocket?i=r.createWebsocket(e,[n],r):i=new uy.default(e,[n],r.wsOptions),i}function FA(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",n=ly(e,t),i;return e.createWebsocket?i=e.createWebsocket(n,[r],e):i=new WebSocket(n,[r]),i.binaryType="arraybuffer",i}var jA=(t,e)=>{sr("streamBuilder");let r=cy(e);r.hostname=r.hostname||r.host||"localhost";let n=ly(r,t),i=UA(t,n,r),s=uy.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy()}),s};ar.streamBuilder=jA;var $A=(t,e)=>{sr("browserStreamBuilder");let r,i=DA(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,u=FA(t,e),c=d(e,S,b);e.objectMode||(c._writev=Cu.writev.bind(c)),c.on("close",()=>{u.close()});let f=typeof u.addEventListener<"u";u.readyState===u.OPEN?(r=c,r.socket=u):(r=new Cu.BufferedDuplex(e,c,u),f?u.addEventListener("open",h):u.onopen=h),f?(u.addEventListener("close",_),u.addEventListener("error",y),u.addEventListener("message",I)):(u.onclose=_,u.onerror=y,u.onmessage=I);function d(m,w,R){let A=new NA.Transform({objectMode:m.objectMode});return A._write=w,A._flush=R,A}function h(){sr("WebSocket onOpen"),r instanceof Cu.BufferedDuplex&&r.socketReady()}function _(m){sr("WebSocket onClose",m),r.end(),r.destroy()}function y(m){sr("WebSocket onError",m);let w=new Error("WebSocket error");w.event=m,r.destroy(w)}async function I(m){if(!c||!c.readable||!c.writable)return;let{data:w}=m;w instanceof ArrayBuffer?w=_o.Buffer.from(w):w instanceof Blob?w=_o.Buffer.from(await new Response(w).arrayBuffer()):w=_o.Buffer.from(w,"utf8"),c.push(w)}function S(m,w,R){if(u.bufferedAmount>i){setTimeout(S,s,m,w,R);return}o&&typeof m=="string"&&(m=_o.Buffer.from(m,"utf8"));try{u.send(m)}catch(A){return R(A)}R()}function b(m){u.close(),m()}return r};ar.browserStreamBuilder=$A});var Bu={};Mr(Bu,{Server:()=>Ye,Socket:()=>Ye,Stream:()=>Ye,_createServerHandle:()=>Ye,_normalizeArgs:()=>Ye,_setSimultaneousAccepts:()=>Ye,connect:()=>Ye,createConnection:()=>Ye,createServer:()=>Ye,default:()=>WA,isIP:()=>Ye,isIPv4:()=>Ye,isIPv6:()=>Ye});function Ye(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var WA,Nu=ze(()=>{x();P();T();WA={_createServerHandle:Ye,_normalizeArgs:Ye,_setSimultaneousAccepts:Ye,connect:Ye,createConnection:Ye,createServer:Ye,isIP:Ye,isIPv4:Ye,isIPv6:Ye,Server:Ye,Socket:Ye,Stream:Ye}});var Lu=H((J6,fy)=>{x();P();T();fy.exports={}});var Du=H(oi=>{"use strict";x();P();T();var qu=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oi,"__esModule",{value:!0});var VA=qu((Nu(),_e(Bu))),HA=qu(Xt()),zA=qu(Lu()),GA=(0,HA.default)("mqttjs:tcp"),QA=(t,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,zA.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:r,path:n}=e,i=e.hostname;return GA("port %d and host %s",r,i),VA.default.createConnection({port:r,host:i,path:n})};oi.default=QA});var dy={};Mr(dy,{default:()=>KA});var KA,hy=ze(()=>{x();P();T();KA={}});var Fu=H(si=>{"use strict";x();P();T();var Uu=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(si,"__esModule",{value:!0});var py=(hy(),_e(dy)),YA=Uu((Nu(),_e(Bu))),JA=Uu(Xt()),XA=Uu(Lu()),ZA=(0,JA.default)("mqttjs:tls");function eI(t){let{host:e,port:r,socksProxy:n,...i}=t;if(n!==void 0){let s=(0,XA.default)(e,r,n,{timeout:t.socksTimeout});return(0,py.connect)({...i,socket:s})}return(0,py.connect)(t)}var tI=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",YA.default.isIP(e.host)===0&&!e.servername&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,ZA("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=eI(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=tI});var Wu=H($u=>{"use strict";x();P();T();Object.defineProperty($u,"__esModule",{value:!0});var gy=(ke(),_e(Le)),rI=Yt(),nI=mo(),vt,ju,Je;function iI(){let t=new rI.Transform;return t._write=(e,r,n)=>{vt.send({data:e.buffer,success(){n()},fail(i){n(new Error(i))}})},t._flush=e=>{vt.close({success(){e()}})},t}function oI(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function sI(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 aI(){vt.onOpen(()=>{Je.socketReady()}),vt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=gy.Buffer.from(e):e=gy.Buffer.from(e,"utf8"),ju.push(e)}),vt.onClose(()=>{Je.emit("close"),Je.end(),Je.destroy()}),vt.onError(t=>{let e=new Error(t.errMsg);Je.destroy(e)})}var uI=(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";oI(e);let n=sI(e,t);vt=wx.connectSocket({url:n,protocols:[r]}),ju=iI(),Je=new nI.BufferedDuplex(e,ju,vt),Je._destroy=(s,o)=>{vt.close({success(){o&&o(s)}})};let i=Je.destroy;return Je.destroy=(s,o)=>(Je.destroy=i,setTimeout(()=>{vt.close({fail(){Je._destroy(s,o)}})},0),Je),aI(),Je};$u.default=uI});var zu=H(Hu=>{"use strict";x();P();T();Object.defineProperty(Hu,"__esModule",{value:!0});var Vu=(ke(),_e(Le)),lI=Yt(),cI=mo(),Ut,ai,un,yy=!1;function fI(){let t=new lI.Transform;return t._write=(e,r,n)=>{Ut.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},t._flush=e=>{Ut.closeSocket({success(){e()}})},t}function dI(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function hI(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 pI(){yy||(yy=!0,Ut.onSocketOpen(()=>{un.socketReady()}),Ut.onSocketMessage(t=>{if(typeof t.data=="string"){let e=Vu.Buffer.from(t.data,"base64");ai.push(e)}else{let e=new FileReader;e.addEventListener("load",()=>{if(e.result instanceof ArrayBuffer){ai.push(Vu.Buffer.from(e.result));return}ai.push(Vu.Buffer.from(e.result,"utf-8"))}),e.readAsArrayBuffer(t.data)}}),Ut.onSocketClose(()=>{un.end(),un.destroy()}),Ut.onSocketError(t=>{un.destroy(t)}))}var gI=(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";dI(e);let n=hI(e,t);return Ut=e.my,Ut.connectSocket({url:n,protocols:r}),ai=fI(),un=new cI.BufferedDuplex(e,ai,Ut),pI(),un};Hu.default=gI});var _y=H(ln=>{"use strict";x();P();T();var wo=ln&&ln.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ln,"__esModule",{value:!0});ln.connectAsync=vI;var yI=wo(Xt()),bI=wo((ny(),_e(ry))),mI=wo(yo()),Gu=wo(ei());typeof q?.nextTick!="function"&&(q.nextTick=setImmediate);var by=(0,yI.default)("mqttjs"),Be=null;function _I(){return typeof location<"u"?location.protocol==="https:"?"wss":"ws":typeof document<"u"&&new URL(document.URL).protocol==="https:"?"wss":"ws"}function wI(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 my(t,e){if(by("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let i=bI.default.parse(t,!0),s={},o=!i.protocol&&!i.hostname&&i.path?.startsWith("/")&&(Gu.default||e.forceNativeWebSocket);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&&!o)throw new Error("Missing protocol");e.protocol=(e.protocol||_I()).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,wI(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),Gu.default||e.unixSocket?e.socksProxy=void 0:e.socksProxy===void 0&&typeof q<"u"&&(e.socksProxy=q.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(Be||(Be={},!Gu.default&&!e.forceNativeWebSocket?(Be.ws=ii().streamBuilder,Be.wss=ii().streamBuilder,Be.mqtt=Du().default,Be.tcp=Du().default,Be.ssl=Fu().default,Be.tls=Be.ssl,Be.mqtts=Fu().default):(Be.ws=ii().browserStreamBuilder,Be.wss=ii().browserStreamBuilder,Be.wx=Wu().default,Be.wxs=Wu().default,Be.ali=zu().default,Be.alis=zu().default)),!Be[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 Be[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++),by("calling streambuilder for",e.protocol),Be[e.protocol](i,e)}let n=new mI.default(r,e);return n.on("error",()=>{}),n}function vI(t,e,r=!0){return new Promise((n,i)=>{let s=my(t,e),o={connect:c=>{u(),n(s)},end:()=>{u(),n(s)},error:c=>{u(),s.end(),i(c)}};r===!1&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))});function u(){Object.keys(o).forEach(c=>{s.off(c,o[c])})}Object.keys(o).forEach(c=>{s.on(c,o[c])})})}ln.default=my});var Ku=H(ye=>{"use strict";x();P();T();var wy=ye&&ye.__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]})),SI=ye&&ye.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EI=ye&&ye.__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"&&wy(r,e,n[i]);return SI(r,e),r}})(),Qu=ye&&ye.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wy(e,t,r)},ui=ye&&ye.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ye,"__esModule",{value:!0});ye.ReasonCodes=ye.KeepaliveManager=ye.UniqueMessageIdProvider=ye.DefaultMessageIdProvider=ye.Store=ye.MqttClient=ye.connectAsync=ye.connect=ye.Client=void 0;var vy=ui(yo());ye.MqttClient=vy.default;var AI=ui(Sa());ye.DefaultMessageIdProvider=AI.default;var II=ui(hg());ye.UniqueMessageIdProvider=II.default;var xI=ui(aa());ye.Store=xI.default;var Sy=EI(_y());ye.connect=Sy.default;Object.defineProperty(ye,"connectAsync",{enumerable:!0,get:function(){return Sy.connectAsync}});var TI=ui(qa());ye.KeepaliveManager=TI.default;ye.Client=vy.default;Qu(yo(),ye);Qu(Ct(),ye);Qu(ia(),ye);var PI=Mn();Object.defineProperty(ye,"ReasonCodes",{enumerable:!0,get:function(){return PI.ReasonCodes}})});var MI=H(nt=>{x();P();T();var Ey=nt&&nt.__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]})),OI=nt&&nt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RI=nt&&nt.__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"&&Ey(r,e,n[i]);return OI(r,e),r}})(),kI=nt&&nt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ey(e,t,r)};Object.defineProperty(nt,"__esModule",{value:!0});var CI=RI(Ku());nt.default=CI;kI(Ku(),nt)});export default MI();
9
9
  /*! Bundled license information:
10
10
 
11
11
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: