bb_component_supermqtt 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/bb_component_supermqtt-1.0.1.tar.gz +0 -0
- package/dist/package.json +7 -0
- package/dist/plugin.min.js +2 -0
- package/dist/schema.json +148 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SuperMQTT
|
|
2
|
+
|
|
3
|
+
Super MQTT
|
|
4
|
+
|
|
5
|
+
An MQTT messaging component for real-time communication with MQTT brokers, supporting publish and subscribe operations with topic filtering.
|
|
6
|
+
|
|
7
|
+
## Metadata
|
|
8
|
+
|
|
9
|
+
| | |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **Type** | Budibase Component |
|
|
12
|
+
| **Category** | communication |
|
|
13
|
+
| **Topics** | `budibase`, `component`, `communication` |
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun install
|
|
19
|
+
bun link @poirazis/superlib
|
|
20
|
+
bun run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Schema
|
|
24
|
+
|
|
25
|
+
See `schema.json` for the component definition.
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(){try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".super-mqtt.svelte-1l9u2si{justify-items:space-between;color:var(--spectrum-global-color-gray-500);align-items:center;gap:.5rem;font-size:13px;display:flex}.super-mqtt.connected.svelte-1l9u2si{color:var(--spectrum-global-color-green-500)}.super-mqtt-test.svelte-1l9u2si{justify-items:space-between;flex-direction:column;padding-left:2rem;display:flex}.super-mqtt-status.svelte-1l9u2si{justify-items:space-between;color:var(--spectrum-global-color-gray-500);flex-direction:column;padding-right:3rem;display:flex}.plugin-error.svelte-1q1ah0h{border:1px solid var(--spectrum-global-color-red-400);background:var(--spectrum-global-color-red-100);color:var(--spectrum-global-color-red-800);box-sizing:border-box;border-radius:4px;flex-direction:column;gap:.25rem;width:100%;padding:.5rem .75rem;font-size:13px;display:flex}.plugin-error-title.svelte-1q1ah0h{font-weight:600}.plugin-error-detail.svelte-1q1ah0h{color:var(--spectrum-global-color-red-700);word-break:break-word;font-size:12px}\n/*$vite$:1*/")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
var plugin=function(e,t,r){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,i,o,s=Object.create,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,c=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;o=null!=(n=t)?s(c(n)):{},t=((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,o=u(t),s=0,c=o.length;s<c;s++)i=o[s],h.call(e,i)||i===r||a(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(n=l(t,i))||n.enumerable});return e})(!i&&n&&n.__esModule?o:a(o,"default",{value:n,enumerable:!0}),n);var f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,y=(e,t)=>()=>(e&&(t=e(e=0)),t),b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),m=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},w=e=>((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of d(t))!g.call(e,i)&&i!==r&&f(e,i,{get:()=>t[i],enumerable:!(n=p(t,i))||n.enumerable});return e})(f({},"__esModule",{value:!0}),e),v=y(()=>{}),_={};function S(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function E(){!D||!F||(D=!1,F.length?L=F.concat(L):W=-1,L.length&&A())}function A(){if(!D){var e=setTimeout(E,0);D=!0;for(var t=L.length;t;){for(F=L,L=[];++W<t;)F&&F[W].run();W=-1,t=L.length}F=null,D=!1,clearTimeout(e)}}function I(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];L.push(new k(e,t)),1===L.length&&!D&&setTimeout(A,0)}function k(e,t){this.fun=e,this.array=t}function O(){}function x(e){S("_linkedBinding")}function P(e){S("dlopen")}function T(){return[]}function R(){return[]}function C(e,t){if(!e)throw new Error(t||"assertion error")}function j(){return!1}function M(){return Ne.now()/1e3}function B(e){var t=Math.floor(.001*(Date.now()-Ne.now())),r=.001*Ne.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=Le)),[n,i]}function N(){return Ye}function U(e){return[]}m(_,{_debugEnd:()=>Se,_debugProcess:()=>_e,_events:()=>Fe,_eventsCount:()=>We,_exiting:()=>se,_fatalExceptions:()=>me,_getActiveHandles:()=>R,_getActiveRequests:()=>T,_kill:()=>ue,_linkedBinding:()=>x,_maxListeners:()=>De,_preload_modules:()=>Me,_rawDebug:()=>ne,_startProfilerIdleNotifier:()=>Ee,_stopProfilerIdleNotifier:()=>Ae,_tickCallback:()=>ve,abort:()=>xe,addListener:()=>$e,allowedNodeEnvironmentFlags:()=>ye,arch:()=>q,argv:()=>z,argv0:()=>je,assert:()=>C,binding:()=>J,browser:()=>re,chdir:()=>ee,config:()=>ae,cpuUsage:()=>ce,cwd:()=>Z,debugPort:()=>Ce,default:()=>Ye,dlopen:()=>P,domain:()=>oe,emit:()=>Ke,emitWarning:()=>Y,env:()=>V,execArgv:()=>K,execPath:()=>Re,exit:()=>de,features:()=>be,hasUncaughtExceptionCaptureCallback:()=>j,hrtime:()=>B,kill:()=>pe,listeners:()=>U,memoryUsage:()=>fe,moduleLoadList:()=>ie,nextTick:()=>I,off:()=>He,on:()=>N,once:()=>qe,openStdin:()=>ge,pid:()=>Pe,platform:()=>H,ppid:()=>Te,prependListener:()=>Ge,prependOnceListener:()=>Qe,reallyExit:()=>le,release:()=>te,removeAllListeners:()=>ze,removeListener:()=>Ve,resourceUsage:()=>he,setSourceMapsEnabled:()=>Be,setUncaughtExceptionCaptureCallback:()=>we,stderr:()=>ke,stdin:()=>Oe,stdout:()=>Ie,title:()=>$,umask:()=>X,uptime:()=>M,version:()=>G,versions:()=>Q});var L,D,F,W,$,q,H,V,z,K,G,Q,Y,J,X,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,he,fe,pe,de,ge,ye,be,me,we,ve,_e,Se,Ee,Ae,Ie,ke,Oe,xe,Pe,Te,Re,Ce,je,Me,Be,Ne,Ue,Le,De,Fe,We,$e,qe,He,Ve,ze,Ke,Ge,Qe,Ye,Je=y(()=>{v(),pt(),Xe(),L=[],D=!1,W=-1,k.prototype.run=function(){this.fun.apply(null,this.array)},$="browser",q="x64",H="browser",V={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},z=["/usr/bin/node"],K=[],G="v16.8.0",Q={},Y=function(e,t){console.warn((t?t+": ":"")+e)},J=function(e){S("binding")},X=function(e){return 0},Z=function(){return"/"},ee=function(e){},te={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},re=!0,ne=O,ie=[],oe={},se=!1,ae={},le=O,ue=O,he=ce=function(){return{}},fe=ce,pe=O,de=O,ge=O,ye={},be={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},me=O,we=O,ve=O,_e=O,Se=O,Ee=O,Ae=O,Ie=void 0,ke=void 0,Oe=void 0,xe=O,Pe=2,Te=1,Re="/bin/usr/node",Ce=9229,je="node",Me=[],Be=O,void 0===(Ne={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Ue=Date.now(),Ne.timing&&Ne.timing.navigationStart&&(Ue=Ne.timing.navigationStart),Ne.now=()=>Date.now()-Ue),Le=1e9,B.bigint=function(e){var t=B(e);return typeof BigInt>"u"?t[0]*Le+t[1]:BigInt(t[0]*Le)+BigInt(t[1])},Ye={version:G,versions:Q,arch:q,platform:H,browser:re,release:te,_rawDebug:ne,moduleLoadList:ie,binding:J,_linkedBinding:x,_events:Fe={},_eventsCount:We=0,_maxListeners:De=10,on:N,addListener:$e=N,once:qe=N,off:He=N,removeListener:Ve=N,removeAllListeners:ze=N,emit:Ke=O,prependListener:Ge=N,prependOnceListener:Qe=N,listeners:U,domain:oe,_exiting:se,config:ae,dlopen:P,uptime:M,_getActiveRequests:T,_getActiveHandles:R,reallyExit:le,_kill:ue,cpuUsage:ce,resourceUsage:he,memoryUsage:fe,kill:pe,exit:de,openStdin:ge,allowedNodeEnvironmentFlags:ye,assert:C,features:be,_fatalExceptions:me,setUncaughtExceptionCaptureCallback:we,hasUncaughtExceptionCaptureCallback:j,emitWarning:Y,nextTick:I,_tickCallback:ve,_debugProcess:_e,_debugEnd:Se,_startProfilerIdleNotifier:Ee,_stopProfilerIdleNotifier:Ae,stdout:Ie,stdin:Oe,stderr:ke,abort:xe,umask:X,chdir:ee,cwd:Z,env:V,title:$,argv:z,execArgv:K,pid:Pe,ppid:Te,execPath:Re,debugPort:Ce,hrtime:B,argv0:je,_preload_modules:Me,setSourceMapsEnabled:Be}}),Xe=y(()=>{Je()});function Ze(){if(ot)return it;ot=!0;let e=function(){if(tt)return et;tt=!0,et.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},et.toByteArray=function(e){var n,i,s=o(e),a=s[0],l=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),c=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=255&n;return 2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n),1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n),u},et.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,l=0,u=n-i;l<u;l+=s)o.push(a(t,l,l+s>u?u:l+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t[45]=62,t[95]=63,et}(),t=(nt||(nt=!0,rt.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},rt.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=d,s/=256,u-=8);e[r+p-d]|=128*g}),rt),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;it.Buffer=o,it.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},it.INSPECT_MAX_BYTES=50;let n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|f(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){let t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let s=function(e){if(o.isBuffer(e)){let t=0|h(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?i(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),i(e<0?0:0|h(e))}function u(e){let t=e.length<0?0:0|h(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function c(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function h(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function b(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let o,s=t.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(K(n))return o;e[r+o]=n}return o}function m(e,t,r,n){return V(q(t,e.length-r),e,r,n)}function w(e,t,r,n){return V(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function v(e,t,r,n){return V(H(t),e,r,n)}function _(e,t,r,n){return V(function(e,t){let r,n,i,o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function E(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}it.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(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}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).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(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(z(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)d(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",t=it.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r);for(let o=0;o<l;++o)if(u[o]!==c[o]){s=u[o],a=c[o];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let A=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=G[e[o]];return i}function x(e,t,r){let n=e.slice(t,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,r,n,i,o){return r=+r,n>>>=0,o||j(e,0,n,4),t.write(e,r,n,i,23,4),n+4}function B(e,r,n,i,o){return r=+r,n>>>=0,o||j(e,0,n,8),t.write(e,r,n,i,52,8),n+8}o.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),o.prototype.readBigInt64BE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),o.prototype.readFloatLE=function(e,r){return e>>>=0,r||P(e,4,this.length),t.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,r){return e>>>=0,r||P(e,4,this.length),t.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,r){return e>>>=0,r||P(e,8,this.length),t.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,r){return e>>>=0,r||P(e,8,this.length),t.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Q(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Q(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Q(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Q(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};let N={};function U(e,t,r){N[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function L(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){let r,n="bigint"==typeof t?"n":"";throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new N.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,r){F(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&W(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new N.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){throw Math.floor(e)!==e?(F(e,r),new N.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=L(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=L(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);let $=/[^+/0-9A-Za-z-_]/g;function q(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}let G=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return typeof BigInt>"u"?Y:e}function Y(){throw new Error("BigInt not supported")}return it}var et,tt,rt,nt,it,ot,st=y(()=>{v(),pt(),Xe(),et={},tt=!1,rt={},nt=!1,it={},ot=!1}),at={};m(at,{Buffer:()=>ut,INSPECT_MAX_BYTES:()=>ct,default:()=>lt,kMaxLength:()=>ht});var lt,ut,ct,ht,ft=y(()=>{v(),pt(),Xe(),st(),(lt=Ze()).Buffer,lt.SlowBuffer,lt.INSPECT_MAX_BYTES,lt.kMaxLength,ut=lt.Buffer,ct=lt.INSPECT_MAX_BYTES,ht=lt.kMaxLength}),pt=y(()=>{ft()}),dt=b((e,t)=>{"use strict";v(),pt(),Xe();var r=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:r,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error:Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number: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:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise:Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String:String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol: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:(e,t,r)=>e.set(t,r),Boolean:Boolean,Uint8Array:Uint8Array}}),gt=b((e,t)=>{"use strict";v(),pt(),Xe(),t.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}}),yt=b((e,t)=>{"use strict";v(),pt(),Xe();var{format:r,inspect:n}=gt(),{AggregateError:i}=dt(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u={};function c(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return c(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let i=(t.match(/%[dfijoOs]/g)||[]).length;return c(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,u[e]=i}function p(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var d=class extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",(e,t,r)=>{c("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let o=[],s=[],u=[];for(let n of t)c("string"==typeof n,"All expected entries have to be of type string"),a.includes(n)?o.push(n.toLowerCase()):l.test(n)?s.push(n):(c("object"!==n,'The value "object" should be written as "Object"'),u.push(n));if(s.length>0){let e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||u.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}u.length>0&&(i+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(i+="an "),i+=`${u[0]}`;break;case 2:i+=`one of ${u[0]} or ${u[1]}`;break;default:{let e=u.pop();i+=`one of ${u.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var h;if(null!==(h=r.constructor)&&void 0!==h&&h.name)i+=`. Received an instance of ${r.constructor.name}`;else{i+=`. Received ${n(r,{depth:-1})}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i},TypeError),f("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=n(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError),f("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),f("ERR_MISSING_ARGS",(...e)=>{c(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),f("ERR_OUT_OF_RANGE",(e,t,r)=>{let i;if(c(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)i=h(String(r));else if("bigint"==typeof r){i=String(r);let e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(i=h(i)),i+="n"}else i=n(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:d,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}}),bt=b((e,t)=>{"use strict";v(),pt(),Xe();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}),mt={};function wt(){if(_t)return vt;_t=!0;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}(vt=i).once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}d(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&d(e,"error",t,r)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,l;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),l=o[t]),void 0===l)l=o[t]=r,++e._eventsCount;else if("function"==typeof l?l=o[t]=n?[r,l]:[l,r]:n?l.unshift(r):l.push(r),(i=a(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var u=l.length,c=p(l,u);for(n=0;n<u;++n)r(c[n],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,c(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,c(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},vt}m(mt,{EventEmitter:()=>Et,default:()=>St,defaultMaxListeners:()=>At,init:()=>It,listenerCount:()=>kt,on:()=>Ot,once:()=>xt});var vt,_t,St,Et,At,It,kt,Ot,xt,Pt=y(()=>{v(),pt(),Xe(),vt={},_t=!1,(St=wt()).once,St.once=function(e,t){return new Promise((r,n)=>{function i(...t){void 0!==o&&e.removeListener("error",o),r(t)}let o;"error"!==t&&(o=t=>{e.removeListener(name,i),n(t)},e.once("error",o)),e.once(t,i)})},St.on=function(e,t){let r=[],n=[],i=null,o=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(i){let e=Promise.reject(i);return i=null,e}return o?createIterResult(void 0,!0):new Promise((e,t)=>n.push({resolve:e,reject:t}))},async return(){e.removeListener(t,a),e.removeListener("error",l),o=!0;for(let e of n)e.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){i=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){o=!0;let t=n.shift();t?t.reject(e):i=e,s.return()}},({EventEmitter:Et,defaultMaxListeners:At,init:It,listenerCount:kt,on:Ot,once:xt}=St)}),Tt=b((e,t)=>{"use strict";v(),pt(),Xe();var r=(ft(),w(at)),{format:n,inspect:i}=gt(),{codes:{ERR_INVALID_ARG_TYPE:o}}=yt(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:l}=dt(),u=globalThis.AbortSignal||bt().AbortSignal,c=globalThis.AbortController||bt().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||r.Blob,p=typeof f<"u"?function(e){return e instanceof f}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new o(t,"AbortSignal",e)};t.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:n,inspect:i,types:{isAsyncFunction:e=>e instanceof h,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:(Pt(),w(mt)).addAbortListener||function(e,t){if(void 0===e)throw new o("signal","AbortSignal",e);let r;return d(e,"signal"),((e,t)=>{if("function"!=typeof e)throw new o(t,"Function",e)})(t,"listener"),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[s]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[l](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];let t=new c,r=()=>t.abort();return e.forEach(e=>{d(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Rt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:i,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:d,StringPrototypeTrim:g}=dt(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:S}}=yt(),{normalizeEncoding:E}=Tt(),{isAsyncFunction:A,isArrayBufferView:I}=Tt().types,k={};var O=/^[0-7]+$/;var x=y((e,t,r=u,n=l)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)}),P=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new _(t,`>= ${n} && <= ${i}`,e)});function R(e,t){if("string"!=typeof e)throw new m(t,"string",e)}var C=y((e,t,r)=>{if(!n(r,e))throw new w(t,e,"must be one of: "+i(o(r,e=>"string"==typeof e?`'${e}'`:p(e)),", "))});function j(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function M(e,t,r){return null!=e&&h(e,t)?e[t]:r}var B=y((e,t,n=null)=>{let i=M(n,"allowArray",!1),o=M(n,"allowFunction",!1);if(!M(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)}),N=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)}),U=y((e,t,n=0)=>{if(!r(e))throw new m(t,"Array",e);if(e.length<n)throw new w(t,e,`must be longer than ${n}`)});var L=y((e,t="buffer")=>{if(!I(e))throw new m(t,["Buffer","TypedArray","DataView"],e)});var D=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)}),F=y((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)}),W=y((e,t)=>{if("function"!=typeof e||A(e))throw new m(t,"Function",e)}),$=y((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)});var q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(typeof e>"u"||!f(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===f(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=c(e,8)}return T(e,t),e},validateArray:U,validateStringArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)R(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++){let n=e[r],i=`${t}[${r}]`;if(null==n)throw new m(i,"AbortSignal",n);D(n,i)}},validateBoolean:j,validateBuffer:L,validateDictionary:N,validateEncoding:function(e,t){let r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:P,validateInteger:x,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:B,validateOneOf:C,validatePlainFunction:W,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new b(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(R(e,t),void 0===k[e])throw void 0!==k[d(e)]?new S(e+" (signals must use all capital letters)"):new S(e)},validateString:R,validateUint32:T,validateUndefined:$,validateUnion:function(e,t,r){if(!n(r,e))throw new m(t,`('${i(r,"|")}')`,e)},validateAbortSignal:D,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let i=e[n];H(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}}),Ct=b((e,t)=>{v(),pt(),Xe();var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch{r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var l,u=[],c=!1,h=-1;function f(){!c||!l||(c=!1,l.length?u=l.concat(u):h=-1,u.length&&p())}function p(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1===u.length&&!c&&a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}),jt=b((e,t)=>{"use strict";v(),pt(),Xe();var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:i}=dt(),o=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),a=i("nodejs.stream.readable"),l=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),c=i("nodejs.webstream.isClosedPromise"),h=i("nodejs.webstream.controllerErrorFunction");function f(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function d(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||d(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||d(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||d(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!d(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[o]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function _(e,t){if(!f(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[a]?e[a]:"boolean"!=typeof e?.readable?null:!m(e)&&(f(e)&&e.readable&&!_(e))}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof e?.writable?null:!m(e)&&(p(e)&&e.writable&&!w(e))}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&A(e)}t.exports={isDestroyed:m,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,a,l,u,c,h;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null!==(h=e._writableState)&&void 0!==h&&h.errored))},kIsErrored:s,isReadable:S,kIsReadable:a,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:l,isClosed:function(e){if(!d(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return d(e)?!!m(e)||!(!1!==t?.readable&&S(e)||!1!==t?.writable&&E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[n]:"function"==typeof e[r]||"function"==typeof e[n])},isReadableNodeStream:f,isReadableStream:g,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return d(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:d,isWebStream:function(e){return g(e)||y(e)||b(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return d(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!d(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&I(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}}),Mt=b((e,t)=>{"use strict";v(),pt(),Xe();var r,n=Ct(),{AbortError:i,codes:o}=yt(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:u}=Tt(),{validateAbortSignal:c,validateFunction:h,validateObject:f,validateBoolean:p}=Rt(),{Promise:d,PromisePrototypeThen:g,SymbolDispose:y}=dt(),{isClosed:b,isReadable:m,isReadableNodeStream:w,isReadableStream:_,isReadableFinished:S,isReadableErrored:E,isWritable:A,isWritableNodeStream:I,isWritableStream:k,isWritableFinished:O,isWritableErrored:x,isNodeStream:P,willEmitClose:T,kIsClosedPromise:R}=jt();var C=()=>{};function j(e,t,o){var p,d;if(2===arguments.length?(o=t,t=l):null==t?t=l:f(t,"options"),h(o,"callback"),c(t.signal,"options.signal"),o=u(o),_(e)||k(e))return function(e,t,o){let s=!1,a=C;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{let n=(r=r||Tt().addAbortListener)(t.signal,a),i=o;o=u((...t)=>{n[y](),i.apply(e,t)})}let l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[R].promise,l,l),C}(e,t,o);if(!P(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);let v=null!==(p=t.readable)&&void 0!==p?p:w(e),j=null!==(d=t.writable)&&void 0!==d?d:I(e),M=e._writableState,B=e._readableState,N=()=>{e.writable||D()},U=T(e)&&w(e)===v&&I(e)===j,L=O(e,!1),D=()=>{L=!0,e.destroyed&&(U=!1),(!U||e.readable&&!v)&&(!v||F)&&o.call(e)},F=S(e,!1),W=()=>{F=!0,e.destroyed&&(U=!1),(!U||e.writable&&!j)&&(!j||L)&&o.call(e)},$=t=>{o.call(e,t)},q=b(e),H=()=>{q=!0;let t=x(e)||E(e);return t&&"boolean"!=typeof t?o.call(e,t):v&&!F&&w(e,!0)&&!S(e,!1)?o.call(e,new a):!j||L||O(e,!1)?void o.call(e):o.call(e,new a)},V=()=>{q=!0;let t=x(e)||E(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},z=()=>{e.req.on("finish",D)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!M&&(e.on("end",N),e.on("close",N)):(e.on("complete",D),U||e.on("abort",H),e.req?z():e.on("request",z)),!U&&"boolean"==typeof e.aborted&&e.on("aborted",H),e.on("end",W),e.on("finish",D),!1!==t.error&&e.on("error",$),e.on("close",H),q?n.nextTick(H):null!=M&&M.errorEmitted||null!=B&&B.errorEmitted?U||n.nextTick(V):(!v&&(!U||m(e))&&(L||!1===A(e))||!j&&(!U||A(e))&&(F||!1===m(e))||B&&e.req&&e.aborted)&&n.nextTick(V);let K=()=>{o=C,e.removeListener("aborted",H),e.removeListener("complete",D),e.removeListener("abort",H),e.removeListener("request",z),e.req&&e.req.removeListener("finish",D),e.removeListener("end",N),e.removeListener("close",N),e.removeListener("finish",D),e.removeListener("end",W),e.removeListener("error",$),e.removeListener("close",H)};if(t.signal&&!q){let s=()=>{let r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{let n=(r=r||Tt().addAbortListener)(t.signal,s),i=o;o=u((...t)=>{n[y](),i.apply(e,t)})}}return K}t.exports=j,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(p(t.cleanup,"cleanup"),n=t.cleanup),new d((r,i)=>{let o=j(e,t,e=>{n&&o(),e?i(e):r()})})}}),Bt=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Ct(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:o}=yt(),{Symbol:s}=dt(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:c}=jt(),h=s("kDestroy"),f=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function d(e,t,n){let i=!1;function o(t){if(i)return;i=!0;let o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(g,e,t):r.nextTick(y,e)}try{e._destroy(t||null,o)}catch(s){o(s)}}function g(e,t){b(e,t),y(e)}function y(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,n){let i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function n(n){if(t)return void m(e,n??new i);t=!0;let o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?m(e,n,!0):r.nextTick(_,e)}try{e._construct(e=>{r.nextTick(n,e)})}catch(o){r.nextTick(n,o)}}function _(e){e.emit(f)}function S(e){return e?.setHeader&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),r.nextTick(E,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),!(e.listenerCount(f)>1)&&r.nextTick(w,e)},destroyer:function(e,t){!e||l(e)||(!t&&!u(e)&&(t=new o),c(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(A,e,t):r.nextTick(E,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?d(this,e,t):this.once(h,function(r){d(this,n(r,e),t)}),this)},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}}),Nt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=dt(),{EventEmitter:i}=(Pt(),w(mt));function o(e){i.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(o.prototype,i.prototype),n(o,i),o.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),!e._isStdio&&(!t||!1!==t.end)&&(r.on("end",l),r.on("close",u));let a=!1;function l(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){h(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return s(r,"error",c),s(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},t.exports={Stream:o,prependListener:s}}),Ut=b((e,t)=>{"use strict";v(),pt(),Xe();var r,{SymbolDispose:n}=dt(),{AbortError:i,codes:o}=yt(),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=jt(),u=Mt(),{ERR_INVALID_ARG_TYPE:c}=o;t.exports.addAbortSignal=function(e,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new c(t,"AbortSignal",e)})(e,"signal"),!s(r)&&!a(r))throw new c("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};return e.aborted?o():(r=r||Tt().addAbortListener,u(t,r(e,o)[n])),t}}),Lt=b((e,t)=>{"use strict";v(),pt(),Xe();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:i,Uint8Array:o}=dt(),{Buffer:s}=(ft(),w(at)),{inspect:a}=Tt();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?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(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{let o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a(this,{...t,depth:0,customInspect:!1})}}}),Dt=b((e,t)=>{"use strict";v(),pt(),Xe();var{MathFloor:r,NumberIsInteger:n}=dt(),{validateInteger:i}=Rt(),{ERR_INVALID_ARG_VALUE:o}=yt().codes,s=16384,a=16;function l(e){return e?a:s}t.exports={getHighWaterMark:function(e,t,i,s){let a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,s,i);if(null!=a){if(!n(a)||a<0)throw new o(s?`options.${i}`:"options.highWaterMark",a);return r(a)}return l(e.objectMode)},getDefaultHighWaterMark:l,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?a=t:s=t}}}),Ft=b((e,t)=>{v(),pt(),Xe();var r=(ft(),w(at)),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}),Wt=b(e=>{"use strict";v(),pt(),Xe();var t=Ft().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var n;switch(this.encoding=function(e){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof n&&(t.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=s,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=l,this.end=u,n=3;break;default:return this.write=c,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=i(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=i(t[n]),o>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0))}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}),$t=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Ct(),{PromisePrototypeThen:n,SymbolAsyncIterator:i,SymbolIterator:o}=dt(),{Buffer:s}=(ft(),w(at)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=yt().codes;t.exports=function(e,t,u){let c,h;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...u,read(){this.push(t),this.push(null)}});if(t&&t[i])h=!0,c=t[i]();else{if(!t||!t[o])throw new a("iterable",["Iterable"],t);h=!1,c=t[o]()}let f=new e({objectMode:!0,highWaterMark:1,...u}),p=!1;return f._read=function(){p||(p=!0,async function(){for(;;){try{let{value:e,done:t}=h?await c.next():c.next();if(t)f.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw p=!1,new l;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}())},f._destroy=function(e,t){n(async function(e){let t=null!=e,r="function"==typeof c.throw;if(t&&r){let{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"==typeof c.return){let{value:e}=await c.return();await e}}(e),()=>r.nextTick(t,e),n=>r.nextTick(t,n||e))},f}}),qt=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Ct(),{ArrayPrototypeIndexOf:n,NumberIsInteger:i,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:c,SafeSet:h,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:d}=dt();t.exports=G,G.ReadableState=K;var{EventEmitter:g}=(Pt(),w(mt)),{Stream:y,prependListener:b}=Nt(),{Buffer:m}=(ft(),w(at)),{addAbortSignal:_}=Ut(),S=Mt(),E=Tt().debuglog("stream",e=>{E=e}),A=Lt(),I=Bt(),{getHighWaterMark:k,getDefaultHighWaterMark:O}=Dt(),{aggregateTwoErrors:x,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:R,ERR_STREAM_PUSH_AFTER_EOF:C,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:M}=yt(),{validateObject:B}=Rt(),N=d("kPaused"),{StringDecoder:U}=Wt(),L=$t();u(G.prototype,y.prototype),u(G,y);var D=()=>{},{errorOrDestroy:F}=I,W=1,$=16,q=32,H=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function K(e,t,r){"boolean"!=typeof r&&(r=t instanceof zt()),this.state=H|V|$|q,e&&e.objectMode&&(this.state|=W),r&&e&&e.readableObjectMode&&(this.state|=W),this.highWaterMark=e?k(this,e,"readableHighWaterMark",r):O(!1),this.buffer=new A,this.length=0,this.pipes=[],this.flowing=null,this[N]=null,e&&!1===e.emitClose&&(this.state&=~H),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new U(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);let t=this instanceof zt();this._readableState=new K(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),y.call(this,e),I.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}function Q(e,t,r,n){E("readableAddChunk",t);let i,o=e._readableState;if(0===(o.state&W)&&("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=m.from(t,r).toString(o.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new P("chunk",["string","Buffer","Uint8Array"],t))),i)F(e,i);else if(null===t)o.state&=-9,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,o);else if(0!==(o.state&W)||t&&t.length>0)if(n)if(4&o.state)F(e,new j);else{if(o.destroyed||o.errored)return!1;Y(e,o,t,!0)}else if(o.ended)F(e,new C);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?Y(e,o,t,!1):te(e,o)):Y(e,o,t,!1)}else n||(o.state&=-9,te(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function Y(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),!!(64&t.state)&&Z(e)),te(e,t)}a(K.prototype,{objectMode:z(W),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z($),sync:z(q),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(H),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=I.destroy,G.prototype._undestroy=I.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new M,this.destroy(e)),new c((t,r)=>S(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return Q(this,e,t,!1)},G.prototype.unshift=function(e,t){return Q(this,e,t,!0)},G.prototype.isPaused=function(){let e=this._readableState;return!0===e[N]||!1===e.flowing},G.prototype.setEncoding=function(e){let t=new U(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=t.write(i);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this};var J;function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&W)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){let t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(ee,e))}function ee(e){let t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,se(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function ne(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[N]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ie(e){E("readable nexttick read 0"),e.read(0)}function oe(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),se(e),t.flowing&&!t.reading&&e.read(0)}function se(e){let t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function ae(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));let r=async function*(e,t){let r=D;function n(t){this===e?(r(),r=D):r=t}e.on("readable",n);let i,o=S(e,{writable:!1},e=>{i=e?x(i,e):null,r(),r=D});try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(i)throw i;if(null===i)return;await new c(n)}}}catch(s){throw i=x(i,s),i}finally{!i&&!1===t?.destroyOnReturn||void 0!==i&&!e._readableState.autoDestroy?(e.off("readable",n),o()):I.destroyer(e,null)}}(e,t);return r.stream=e,r}function le(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ue(e){let t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(ce,t,e))}function ce(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(he,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function he(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}function fe(){return void 0===J&&(J={}),J}G.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new R("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ue(this):Z(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ue(this),null;let n,o=!!(64&t.state);if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.state|=8|q,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(a){F(this,a)}t.state&=~q,t.reading||(e=X(r,t))}return n=e>0?le(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ue(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){let n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),E("pipe count=%d opts=%j",i.pipes.length,t);let o=t&&!1===t.end||e===r.stdout||e===r.stderr?y:a;function s(t,r){E("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,E("cleanup"),e.removeListener("close",d),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",y),n.removeListener("data",f),u=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l())}function a(){E("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);let l,u=!1;function c(){u||(1===i.pipes.length&&i.pipes[0]===e?(E("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(E("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){let r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(n,e),e.on("drain",l))}function f(t){E("ondata");let r=e.write(t);E("dest.write",r),!1===r&&c()}function p(t){if(E("onerror",t),y(),e.removeListener("error",p),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",g),y()}function g(){E("onfinish"),e.removeListener("close",d),y()}function y(){E("unpipe"),n.unpipe(e)}return n.on("data",f),b(e,"error",p),e.once("close",d),e.once("finish",g),e.emit("pipe",n),!0===e.writableNeedDrain?c():i.flowing||(E("pipe resume"),n.resume()),e},G.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=n(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){let n=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,E("on readable",i.length,i.reading),i.length?Z(this):i.reading||r.nextTick(ie,this)),n},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){let n=y.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(ne,this),n},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){let t=y.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&r.nextTick(ne,this),t},G.prototype.resume=function(){let e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(oe,e,t))}(this,e)),e[N]=!1,this},G.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[N]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{F(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=l(e);for(let n=1;n<r.length;n++){let t=r[n];void 0===this[t]&&"function"==typeof e[t]&&(this[t]=e[t].bind(e))}return this},G.prototype[p]=function(){return ae(this)},G.prototype.iterator=function(e){return void 0!==e&&B(e,"options"),ae(this,e)},a(G.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!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(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},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}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),a(K.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[N]},set(e){this[N]=!!e}}}),G._fromList=le,G.from=function(e,t){return L(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){I.destroyer(e,t),r(t)}}).wrap(e)}}),Ht=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Ct(),{ArrayPrototypeSlice:n,Error:i,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:c,SymbolHasInstance:h}=dt();t.exports=B,B.WritableState=j;var{EventEmitter:f}=(Pt(),w(mt)),p=Nt().Stream,{Buffer:d}=(ft(),w(at)),g=Bt(),{addAbortSignal:y}=Ut(),{getHighWaterMark:b,getDefaultHighWaterMark:m}=Dt(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:A,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:O,ERR_STREAM_WRITE_AFTER_END:x,ERR_UNKNOWN_ENCODING:P}=yt().codes,{errorOrDestroy:T}=g;function R(){}l(B.prototype,p.prototype),l(B,p);var C=c("kOnFinished");function j(e,t,r){"boolean"!=typeof r&&(r=t instanceof zt()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",r):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!(!e||!1!==e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,M(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function M(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function B(e){let t=this instanceof zt();if(!t&&!o(B,this))return new B(e);this._writableState=new j(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),g.construct(this,()=>{let e=this._writableState;e.writing||q(this,e),z(this,e)})}function N(e,t,n,i){let o,s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!d.isEncoding(n))throw new P(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=R)}if(null===t)throw new O;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=d.from(t,n),n="buffer");else if(t instanceof d)n="buffer";else{if(!p._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}return s.ending?o=new x:s.destroyed&&(o=new I("write")),o?(r.nextTick(i,o),T(e,o,!0),o):(s.pendingcb++,function(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==R&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function U(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new I("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),$(t),T(e,r)}function D(e,t){let n=e._writableState,i=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(L,e,n,t,o):L(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&q(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick(F,n.afterWriteTickInfo)):W(e,n,1,o))):T(e,new E)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,W(e,t,r,n)}function W(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&$(t),z(e,t)}function $(e){if(e.writing)return;for(let i=e.bufferedIndex;i<e.buffered.length;++i){var t;let{chunk:r,callback:n}=e.buffered[i],o=e.objectMode?1:r.length;e.length-=o,n(null!==(t=e.errored)&&void 0!==t?t:new I("write"))}let r=e[C].splice(0);for(let i=0;i<r.length;i++){var n;r[i](null!==(n=e.errored)&&void 0!==n?n:new I("end"))}M(e)}function q(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:o}=t,s=r.length-i;if(!s)return;let a=i;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let i=t.allNoop?R:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:n(r,a);o.allBuffers=t.allBuffers,U(e,t,!0,t.length,o,"",i),M(t)}else{do{let{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,U(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?M(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)T(e,i??E());else if(n=!0,t.pendingcb--,i){let r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(o){i(o)}t.sync=!1}(e,t)))}function z(e,t,n){H(t)&&(V(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick((e,t)=>{H(t)?K(e,t):t.pendingcb--},e,t)):H(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[C].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}j.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},s(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(B,h,{__proto__:null,value:function(e){return!!o(this,e)||this===B&&(e&&e._writableState instanceof j)}}),B.prototype.pipe=function(){T(this,new A)},B.prototype.write=function(e,t,r){return!0===N(this,e,t,r)},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||q(this,e))},B.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!d.isEncoding(e))throw new P(e);return this._writableState.defaultEncoding=e,this},B.prototype._write=function(e,t,r){if(!this._writev)throw new S("_write()");this._writev([{chunk:e,encoding:t}],r)},B.prototype._writev=null,B.prototype.end=function(e,t,n){let o,s=this._writableState;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){let r=N(this,e,t);r instanceof i&&(o=r)}return s.corked&&(s.corked=1,this.uncork()),o||(s.errored||s.ending?s.finished?o=new k("end"):s.destroyed&&(o=new I("end")):(s.ending=!0,z(this,s,!0),s.ended=!0)),"function"==typeof n&&(o||s.finished?r.nextTick(n,o):s[C].push(n)),this},a(B.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},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!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});var G,Q=g.destroy;function Y(){return void 0===G&&(G={}),G}B.prototype.destroy=function(e,t){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[C].length)&&r.nextTick($,n),Q.call(this,e,t),this},B.prototype._undestroy=g.undestroy,B.prototype._destroy=function(e,t){t(e)},B.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},B.fromWeb=function(e,t){return Y().newStreamWritableFromWritableStream(e,t)},B.toWeb=function(e){return Y().newWritableStreamFromStreamWritable(e)}}),Vt=b((e,t)=>{v(),pt(),Xe();var r=Ct(),n=(ft(),w(at)),{isReadable:i,isWritable:o,isIterable:s,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c,isReadableStream:h,isWritableStream:f}=jt(),p=Mt(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=yt(),{destroyer:b}=Bt(),m=zt(),_=qt(),S=Ht(),{createDeferredPromise:E}=Tt(),A=$t(),I=globalThis.Blob||n.Blob,k=typeof I<"u"?function(e){return e instanceof I}:function(e){return!1},O=globalThis.AbortController||bt().AbortController,{FunctionPrototypeCall:x}=dt(),P=class extends m{constructor(e){super(e),!1===e?.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e?.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};function T(e){let t,r,n,s,a,l=e.readable&&"function"!=typeof e.readable.read?_.wrap(e.readable):e.readable,u=e.writable,c=!!i(l),h=!!o(u);function f(e){let t=s;s=null,t?t(e):e&&a.destroy(e)}return a=new P({readableObjectMode:!(null==l||!l.readableObjectMode),writableObjectMode:!(null==u||!u.writableObjectMode),readable:c,writable:h}),h&&(p(u,e=>{h=!1,e&&b(l,e),f(e)}),a._write=function(e,r,n){u.write(e,r)?n():t=n},a._final=function(e){u.end(),r=e},u.on("drain",function(){if(t){let e=t;t=null,e()}}),u.on("finish",function(){if(r){let e=r;r=null,e()}})),c&&(p(l,e=>{c=!1,e&&b(l,e),f(e)}),l.on("readable",function(){if(n){let e=n;n=null,e()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let e=l.read();if(null===e)return void(n=a._read);if(!a.push(e))return}}),a._destroy=function(e,i){!e&&null!==s&&(e=new d),n=null,t=null,r=null,null===s?i(e):(s=i,b(u,e),b(l,e))},a}t.exports=function e(t,n){if(c(t))return t;if(l(t))return T({readable:t});if(u(t))return T({writable:t});if(a(t))return T({writable:!1,readable:!1});if(h(t))return T({readable:_.fromWeb(t)});if(f(t))return T({writable:S.fromWeb(t)});if("function"==typeof t){let{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=E(),i=new O,o=i.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new d(void 0,{cause:o.reason});({promise:t,resolve:n}=E()),yield i}}(),{signal:o}),write(e,t,r){let i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return A(P,e,{objectMode:!0,write:i,final:o,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=x(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{b(t,e)});return t=new P({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}})},destroy:a})}throw new y("Iterable, AsyncIterable or AsyncFunction",n,e)}if(k(t))return e(t.arrayBuffer());if(s(t))return A(P,t,{objectMode:!0,writable:!1});if(h(t?.readable)&&f(t?.writable))return P.fromWeb(t);if("object"==typeof t?.writable||"object"==typeof t?.readable)return T({readable:null!=t&&t.readable?l(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if("function"==typeof i){let e;return x(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{b(e,t)}),e=new P({objectMode:!0,writable:!1,read(){}})}throw new g(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}),zt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:i,ObjectSetPrototypeOf:o}=dt();t.exports=c;var s,a,l=qt(),u=Ht();o(c.prototype,l.prototype),o(c,l);{let e=i(u.prototype);for(let t=0;t<e.length;t++){let r=e[t];c.prototype[r]||(c.prototype[r]=u.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),u.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function h(){return void 0===s&&(s={}),s}r(c.prototype,{writable:{__proto__:null,...n(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(u.prototype,"writableLength")},writableFinished:{__proto__:null,...n(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return a||(a=Vt()),a(e,"body")}}),Kt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ObjectSetPrototypeOf:r,Symbol:n}=dt();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:i}=yt().codes,o=zt(),{getHighWaterMark:s}=Dt();r(l.prototype,o.prototype),r(l,o);var a=n("kCallback");function l(e){if(!(this instanceof l))return new l(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(e,t,r){throw new i("_transform()")},l.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[a]=r)})},l.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}}),Gt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ObjectSetPrototypeOf:r}=dt();t.exports=i;var n=Kt();function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(i.prototype,n.prototype),r(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}),Qt=b((e,t)=>{v(),pt(),Xe();var r,n,i,o=Ct(),{ArrayIsArray:s,Promise:a,SymbolAsyncIterator:l,SymbolDispose:u}=dt(),c=Mt(),{once:h}=Tt(),f=Bt(),p=zt(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:w},AbortError:_}=yt(),{validateFunction:S,validateAbortSignal:E}=Rt(),{isIterable:A,isReadable:I,isReadableNodeStream:k,isNodeStream:O,isTransformStream:x,isWebStream:P,isReadableStream:T,isReadableFinished:R}=jt(),C=globalThis.AbortController||bt().AbortController;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,f.destroyer(e,t||new m("pipe")))},cleanup:c(e,{readable:t,writable:r},e=>{n=!e})}}function M(e){if(A(e))return e;if(k(e))return async function*(e){n||(n=qt()),yield*n.prototype[l].call(e)}(e);throw new g("val",["Readable","Iterable","AsyncIterable"],e)}async function B(e,t,r,{end:n}){let i,o=null,s=e=>{if(e&&(i=e),o){let e=o;o=null,e()}},l=()=>new a((e,t)=>{i?t(i):o=()=>{i?t(i):e()}});t.on("drain",s);let u=c(t,{readable:!1},s);try{t.writableNeedDrain&&await l();for await(let r of e)t.write(r)||await l();n&&(t.end(),await l()),r()}catch(h){r(i!==h?d(i,h):h)}finally{u(),t.off("drain",s)}}async function N(e,t,r,{end:n}){x(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function U(e,t,n){if(1===e.length&&s(e[0])&&(e=e[0]),e.length<2)throw new b("streams");let a,l=new C,c=l.signal,h=n?.signal,f=[];function d(){D(new _)}E(h,"options.signal"),i=i||Tt().addAbortListener,h&&(a=i(h,d));let m,w,v,S=[],R=0;function U(e){D(e,0===--R)}function D(e,r){var n;if(e&&(!m||"ERR_STREAM_PREMATURE_CLOSE"===m.code)&&(m=e),m||r){for(;S.length;)S.shift()(m);null===(n=a)||void 0===n||n[u](),l.abort(),r&&(m||f.forEach(e=>e()),o.nextTick(t,m,w))}}for(let i=0;i<e.length;i++){let t=e[i],s=i<e.length-1,a=i>0,l=s||!1!==n?.end,u=i===e.length-1;if(O(t)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&U(e)};if(l){let{destroy:e,cleanup:r}=j(t,s,a);S.push(e),I(t)&&u&&f.push(r)}t.on("error",e),I(t)&&u&&f.push(()=>{t.removeListener("error",e)})}if(0===i)if("function"==typeof t){if(v=t({signal:c}),!A(v))throw new y("Iterable, AsyncIterable or Stream","source",v)}else v=A(t)||k(t)||x(t)?t:p.from(t);else if("function"==typeof t){var F;if(x(v))v=M(null===(F=v)||void 0===F?void 0:F.readable);else v=M(v);if(v=t(v,{signal:c}),s){if(!A(v,!0))throw new y("AsyncIterable",`transform[${i-1}]`,v)}else{var W;r||(r=Gt());let e=new r({objectMode:!0}),t=null===(W=v)||void 0===W?void 0:W.then;if("function"==typeof t)R++,t.call(v,t=>{w=t,null!=t&&e.write(t),l&&e.end(),o.nextTick(U)},t=>{e.destroy(t),o.nextTick(U,t)});else if(A(v,!0))R++,B(v,e,U,{end:l});else{if(!T(v)&&!x(v))throw new y("AsyncIterable or Promise","destination",v);{let t=v.readable||v;R++,B(t,e,U,{end:l})}}v=e;let{destroy:n,cleanup:i}=j(v,!1,!0);S.push(n),u&&f.push(i)}}else if(O(t)){if(k(v)){R+=2;let e=L(v,t,U,{end:l});I(t)&&u&&f.push(e)}else if(x(v)||T(v)){let e=v.readable||v;R++,B(e,t,U,{end:l})}else{if(!A(v))throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);R++,B(v,t,U,{end:l})}v=t}else if(P(t)){if(k(v))R++,N(M(v),t,U,{end:l});else if(T(v)||A(v))R++,N(v,t,U,{end:l});else{if(!x(v))throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);R++,N(v.readable,t,U,{end:l})}v=t}else v=p.from(t)}return(null!=c&&c.aborted||null!=h&&h.aborted)&&o.nextTick(d),v}function L(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new w)}),e.pipe(t,{end:!1}),n){let r=function(){i=!0,t.end()};R(e)?o.nextTick(r):e.once("end",r)}else r();return c(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),c(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:U,pipeline:function(...e){return U(e,h(function(e){return S(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}}),Yt=b((e,t)=>{"use strict";v(),pt(),Xe();var{pipeline:r}=Qt(),n=zt(),{destroyer:i}=Bt(),{isNodeStream:o,isReadable:s,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:h}=jt(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:d}}=yt(),g=Mt();t.exports=function(...e){if(0===e.length)throw new d("streams");if(1===e.length)return n.from(e[0]);let t,y,b,m,w,v=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let r=0;r<e.length;++r)if(o(e[r])||l(e[r])){if(r<e.length-1&&!(s(e[r])||h(e[r])||u(e[r])))throw new p(`streams[${r}]`,v[r],"must be readable");if(r>0&&!(a(e[r])||c(e[r])||u(e[r])))throw new p(`streams[${r}]`,v[r],"must be writable")}let _=e[0],S=r(e,function(e){let t=m;m=null,t?t(e):e?w.destroy(e):!A&&!E&&w.destroy()}),E=!!(a(_)||c(_)||u(_)),A=!!(s(S)||h(S)||u(S));if(w=new n({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(o(_))w._write=function(e,r,n){_.write(e,r)?n():t=n},w._final=function(e){_.end(),y=e},_.on("drain",function(){if(t){let e=t;t=null,e()}});else if(l(_)){let e=(u(_)?_.writable:_).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(i){n(i)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(r){t(r)}}}g(u(S)?S.readable:S,()=>{if(y){let e=y;y=null,e()}})}if(A)if(o(S))S.on("readable",function(){if(b){let e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){let e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(l(S)){let e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,r){!e&&null!==m&&(e=new f),b=null,t=null,y=null,null===m?r(e):(m=r,o(S)&&i(S,e))},w}}),Jt=b((e,t)=>{"use strict";v(),pt(),Xe();var r=globalThis.AbortController||bt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:a}=yt(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=Rt(),h=dt().Symbol("kWeak"),f=dt().Symbol("kResistStopPropagation"),{finished:p}=Mt(),d=Yt(),{addAbortSignalNoValidate:g}=Ut(),{isWritable:y,isNodeStream:b}=jt(),{deprecate:m}=Tt(),{ArrayPrototypePush:w,Boolean:_,MathFloor:S,Number:E,NumberIsNaN:A,Promise:I,PromiseReject:k,PromiseResolve:O,PromisePrototypeThen:x,Symbol:P}=dt(),T=P("kEmpty"),R=P("kEof");function C(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal");let r=1;null!=t?.concurrency&&(r=S(t.concurrency));let n=r-1;return null!=t?.highWaterMark&&(n=S(t.highWaterMark)),u(r,"options.concurrency",1),u(n,"options.highWaterMark",0),n+=r,async function*(){let i,o,s=Tt().AbortSignalAny([t?.signal].filter(_)),l=this,u=[],c={signal:s},h=!1,f=0;function p(){h=!0,d()}function d(){f-=1,g()}function g(){o&&!h&&f<r&&u.length<n&&(o(),o=null)}!async function(){try{for await(let g of l){if(h)return;if(s.aborted)throw new a;try{if(g=e(g,c),g===T)continue;g=O(g)}catch(t){g=k(t)}f+=1,x(g,d,p),u.push(g),i&&(i(),i=null),!h&&(u.length>=n||f>=r)&&await new I(e=>{o=e})}u.push(R)}catch(g){let e=k(g);x(e,d,p),u.push(e)}finally{h=!0,i&&(i(),i=null)}}();try{for(;;){for(;u.length>0;){let e=await u[0];if(e===R)return;if(s.aborted)throw new a;e!==T&&(yield e),u.shift(),g()}await new I(e=>{i=e})}}finally{h=!0,o&&(o(),o=null)}}.call(this)}async function j(e,t=void 0){for await(let r of M.call(this,e,t))return!0;return!1}function M(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return C.call(this,async function(t,r){return await e(t,r)?t:T},t)}var B=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};function N(e){if(e=E(e),A(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:m(function(e=void 0){return null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal"),async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield i)}}.call(this)},filter:M,flatMap:function(e,t){let r=C.call(this,e,t);return async function*(){for await(let e of r)yield*e}.call(this)},map:C,take:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(e-- >0&&(yield i),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),b(e)&&!y(e))throw new n("stream",e,"must be writable");let r=d(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},t.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!(await j.call(this,async(...t)=>!(await e(...t)),t))},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(let r of C.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,n){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=n&&c(n,"options"),null!=n?.signal&&l(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(o=n.signal)&&void 0!==o&&o.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}let u=new r,d=u.signal;if(null!=n&&n.signal){let e={once:!0,[h]:this,[f]:!0};n.signal.addEventListener("abort",()=>u.abort(),e)}let g=!1;try{for await(let r of this){var y;if(g=!0,null!=n&&null!==(y=n.signal)&&void 0!==y&&y.aborted)throw new a;s?t=await e(t,r,{signal:d}):(t=r,s=!0)}if(!g&&!s)throw new B}finally{u.abort()}return t},toArray:async function(e){null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(let r of M.call(this,e,t))return r}}}),Xt=b((e,t)=>{"use strict";v(),pt(),Xe();var{ArrayPrototypePop:r,Promise:n}=dt(),{isIterable:i,isNodeStream:o,isWebStream:s}=jt(),{pipelineImpl:a}=Qt(),{finished:l}=Mt();Zt(),t.exports={finished:l,pipeline:function(...e){return new n((t,n)=>{let l,u,c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!i(c)&&!s(c)){let t=r(e);l=t.signal,u=t.end}a(e,(e,r)=>{e?n(e):t(r)},{signal:l,end:u})})}}}),Zt=b((e,t)=>{"use strict";v(),pt(),Xe();var{Buffer:r}=(ft(),w(at)),{ObjectDefineProperty:n,ObjectKeys:i,ReflectApply:o}=dt(),{promisify:{custom:s}}=Tt(),{streamReturningOperators:a,promiseReturningOperators:l}=Jt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=yt(),c=Yt(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:f}=Dt(),{pipeline:p}=Qt(),{destroyer:d}=Bt(),g=Mt(),y=Xt(),b=jt(),m=t.exports=Nt().Stream;m.isDestroyed=b.isDestroyed,m.isDisturbed=b.isDisturbed,m.isErrored=b.isErrored,m.isReadable=b.isReadable,m.isWritable=b.isWritable,m.Readable=qt();for(let w of i(a)){let e=function(...e){if(new.target)throw u();return m.Readable.from(o(t,this,e))},t=a[w];n(e,"name",{__proto__:null,value:t.name}),n(e,"length",{__proto__:null,value:t.length}),n(m.Readable.prototype,w,{__proto__:null,value:e,enumerable:!1,configurable:!0,writable:!0})}for(let w of i(l)){let e=function(...e){if(new.target)throw u();return o(t,this,e)},t=l[w];n(e,"name",{__proto__:null,value:t.name}),n(e,"length",{__proto__:null,value:t.length}),n(m.Readable.prototype,w,{__proto__:null,value:e,enumerable:!1,configurable:!0,writable:!0})}m.Writable=Ht(),m.Duplex=zt(),m.Transform=Kt(),m.PassThrough=Gt(),m.pipeline=p;var{addAbortSignal:_}=Ut();m.addAbortSignal=_,m.finished=g,m.destroy=d,m.compose=c,m.setDefaultHighWaterMark=h,m.getDefaultHighWaterMark=f,n(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),n(p,s,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),n(g,s,{__proto__:null,enumerable:!0,get:()=>y.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}}),er=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Zt(),n=Xt(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),tr=b((e,t)=>{v(),pt(),Xe(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),rr=b((e,t)=>{"use strict";v(),pt(),Xe();var{Buffer:r}=(ft(),w(at)),n=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},i.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,i){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof i||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||r.alloc(0);let o=!!e,s=this._offset(n),a=i-n,l=a,u=o&&t||0,c=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+l):this._bufs[s[0]].slice(c,c+l);o||(e=r.allocUnsafe(a));for(let r=s[0];r<this._bufs.length;r++){let t=this._bufs[r].length-c;if(!(l>t)){this._bufs[r].copy(e,u,c,c+l),u+=t;break}this._bufs[r].copy(e,u,c),u+=t,l-=t,c&&(c=0)}return e.length>u?e.slice(0,u):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},i.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},i.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)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},i.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){return this._attach(e,i.prototype._appendBuffer)},i.prototype.prepend=function(e){return this._attach(e,i.prototype._prependBuffer,!0)},i.prototype._attach=function(e,t,n){if(null==e)return this;if(e.buffer)t.call(this,r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[r,i]=n?[e.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e.length;o+=i)this._attach(e[o],t,n)}else if(this._isBufferList(e)){let[r,i]=n?[e._bufs.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e._bufs.length;o+=i)this._attach(e._bufs[o],t,n)}else"number"==typeof e&&(e=e.toString()),t.call(this,r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let i=this._offset(t),o=i[0],s=i[1];for(;o<this._bufs.length;o++){let t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={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 t in e)(function(t){i.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[n]},t.exports=i}),nr=b((e,t)=>{"use strict";v(),pt(),Xe();var r=er().Duplex,n=tr(),i=rr();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;let t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}i._init.call(this,e),r.call(this)}n(o,r),Object.assign(o.prototype,i.prototype),o.prototype._new=function(e){return new o(e)},o.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},o.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)},o.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},o.prototype._isBufferList=function(e){return e instanceof o||e instanceof i||o.isBufferList(e)},o.isBufferList=i.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=i}),ir=b((e,t)=>{v(),pt(),Xe();t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}}),or=b((e,t)=>{v(),pt(),Xe();var r=t.exports,{Buffer:n}=(ft(),w(at));r.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"},r.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},r.requiredHeaderFlagsErrors={};for(let o in r.requiredHeaderFlags){let e=r.requiredHeaderFlags[o];r.requiredHeaderFlagsErrors[o]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+r.types[o]+" packet"}r.codes={};for(let o in r.types){let e=r.types[o];r.codes[e]=o}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.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},r.propertiesCodes={};for(let o in r.properties){let e=r.properties[o];r.propertiesCodes[e]=o}function i(e){return[0,1,2].map(t=>[0,1].map(i=>[0,1].map(o=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|t<<r.QOS_SHIFT|o,0,!0),s})))}r.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"},r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map(e=>n.from([e])),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.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"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.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"},r.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"},r.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"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),sr=b((e,t)=>{v(),pt(),Xe();var r=1e3,n=6e4,i=60*n,o=24*i,s=7*o,a=365.25*o;function l(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}t.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var l=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=o?l(e,t,o,"day"):t>=i?l(e,t,i,"hour"):t>=n?l(e,t,n,"minute"):t>=r?l(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}),ar=b((e,t)=>{v(),pt(),Xe(),t.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;let r=a,i=Number(new Date);r.diff=i-(n||i),r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";o++;let s=t.formatters[i];if("function"==typeof s){let t=e[o];n=s.call(r,t),e.splice(o,1),o--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let n of r)"-"===n[0]?t.skips.push(n.slice(1)):t.names.push(n)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=sr(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}}),lr=b((e,t)=>{v(),pt(),Xe(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!t&&typeof _<"u"&&"env"in _&&(t=_.env.DEBUG),t},e.useColors=function(){if(typeof window<"u"&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),e.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"],e.log=console.debug||console.log||(()=>{}),t.exports=ar()(e);var{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}),ur=b((e,t)=>{v(),pt(),Xe();var r=nr(),{EventEmitter:n}=(Pt(),w(mt)),i=ir(),o=or(),s=lr()("mqtt-packet:parser");t.exports=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new e).parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("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),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];let r=15&e,n=o.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&o.RETAIN_MASK),this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=0!==(e&o.DUP_MASK),s("_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)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||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 s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,i={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)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(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(i.will)a.will={},a.will.retain=u,a.will.qos=c;else{if(u)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=0!==(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(new Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let h=this._parseString();if(null===h)return this._emitError(new Error("Packet too short"));if(a.clientId=h,s("_parseConnect: packet.clientId: %s",a.clientId),i.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&o.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)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(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e,t,r,n,i,a,l,u=this.packet;if(u.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(u.properties=e)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(r=t&o.SUBSCRIBE_OPTIONS_QOS_MASK,r>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=0!==(t>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK),i=0!==(t>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK),n=t>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:e,qos:r},5===this.settings.protocolVersion?(l.nl=a,l.rap=i,l.rh=n):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",l),u.subscriptions.push(l)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)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(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_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,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t,r=0,n=1,i=0,a=!1,l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&o.VARBYTEINT_MASK),n*=128,0===(t&o.VARBYTEINT_FIN_MASK)){a=!0;break}if(this._list.length<=r)break}return!a&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),a=!!a&&(e?{bytes:r,value:i}:i),s("_parseVarByteNum: result: %o",a),a}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();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(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;let t=o.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));let e=this._parseByType(o.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(o.propertiesTypes[t]))):r[t]=this._parseByType(o.propertiesTypes[t])}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_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)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}}}),cr=b((e,t)=>{v(),pt(),Xe();var{Buffer:r}=(ft(),w(at)),n={},i=r.isBuffer(r.from([1,2]).subarray(0,1));function o(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=o(e)},generateNumber:o,genBufVariableByteInt:function(e){let t=0,n=0,o=r.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,n++)}while(e>0&&n<4);return e>0&&(n=0),i?o.subarray(0,n):o.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}}),hr=b((e,t)=>{"use strict";v(),pt(),Xe(),typeof _>"u"||!_.version||0===_.version.indexOf("v0.")||0===_.version.indexOf("v1.")&&0!==_.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return _.nextTick(e);case 2:return _.nextTick(function(){e.call(null,t)});case 3:return _.nextTick(function(){e.call(null,t,r)});case 4:return _.nextTick(function(){e.call(null,t,r,n)});default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return _.nextTick(function(){e.apply(null,i)})}}}:t.exports=_}),fr=b((e,t)=>{v(),pt(),Xe();var r=or(),{Buffer:n}=(ft(),w(at)),i=n.allocUnsafe(0),o=n.from([0]),s=cr(),a=hr().nextTick,l=lr()("mqtt-packet:writeToStream"),u=s.cache,c=s.generateNumber,h=s.generateCache,f=s.genBufVariableByteInt,p=s.generate4ByteBuffer,d=A,g=!0;function y(e,t,s){switch(l("generate called"),t.cork&&(t.cork(),a(b,t)),g&&(g=!1,h()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){let i=e||{},o=i.protocolId||"MQTT",s=i.protocolVersion||4,a=i.will,l=i.clean,u=i.keepalive||0,c=i.clientId||"",h=i.username,f=i.password,p=i.properties;void 0===l&&(l=!0);let g,y,b=0;if(!o||"string"!=typeof o&&!n.isBuffer(o))return t.destroy(new Error("Invalid protocolId")),!1;if(b+=o.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(b+=1,("string"==typeof c||n.isBuffer(c))&&(c||s>=4)&&(c||l))b+=n.byteLength(c)+2;else{if(s<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof u||u<0||u>65535||u%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(b+=2,b+=1,5===s){if(g=O(t,p),!g)return!1;b+=g.length}if(a){if("object"!=typeof a)return t.destroy(new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.destroy(new Error("Invalid will topic")),!1;if(b+=n.byteLength(a.topic)+2,b+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?b+=n.byteLength(a.payload):b+=a.payload.length}if(y={},5===s){if(y=O(t,a.properties),!y)return!1;b+=y.length}}let m=!1;if(null!=h){if(!C(h))return t.destroy(new Error("Invalid username")),!1;m=!0,b+=n.byteLength(h)+2}if(null!=f){if(!m)return t.destroy(new Error("Username is required to use password")),!1;if(!C(f))return t.destroy(new Error("Invalid password")),!1;b+=R(f)+2}t.write(r.CONNECT_HEADER),_(t,b),k(t,o),i.bridgeMode&&(s+=128),t.write(131===s?r.VERSION131:132===s?r.VERSION132:4===s?r.VERSION4:5===s?r.VERSION5:r.VERSION3);let w=0;return w|=null!=h?r.USERNAME_MASK:0,w|=null!=f?r.PASSWORD_MASK:0,w|=a&&a.retain?r.WILL_RETAIN_MASK:0,w|=a&&a.qos?a.qos<<r.WILL_QOS_SHIFT:0,w|=a?r.WILL_FLAG_MASK:0,w|=l?r.CLEAN_SESSION_MASK:0,t.write(n.from([w])),d(t,u),5===s&&g.write(),k(t,c),a&&(5===s&&y.write(),S(t,a.topic),k(t,a.payload)),null!=h&&k(t,h),null!=f&&k(t,f),!0}(e,t);case"connack":return function(e,t,i){let s=i?i.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,u=a.properties,c=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let h=null;if(5===s){if(h=O(t,u),!h)return!1;c+=h.length}return t.write(r.CONNACK_HEADER),_(t,c),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:o),t.write(n.from([l])),h?.write(),!0}(e,t,s);case"publish":return function(e,t,o){l("publish: packet: %o",e);let s=o?o.protocolVersion:4,a=e||{},u=a.qos||0,c=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||i,p=a.messageId,g=a.properties,y=0;if("string"==typeof h)y+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.destroy(new Error("Invalid topic")),!1;y+=h.length+2}if(n.isBuffer(f)?y+=f.length:y+=n.byteLength(f),u&&"number"!=typeof p)return t.destroy(new Error("Invalid messageId")),!1;u&&(y+=2);let b=null;if(5===s){if(b=O(t,g),!b)return!1;y+=b.length}return t.write(r.PUBLISH_HEADER[u][a.dup?1:0][c?1:0]),_(t,y),d(t,R(h)),t.write(h),u>0&&d(t,p),b?.write(),l("publish: payload: %o",f),t.write(f)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,u=s.dup&&"pubrel"===a?r.DUP_MASK:0,c=0,h=s.reasonCode,f=s.properties,p=5===o?3:2;if("pubrel"===a&&(c=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let g=null;if(5===o&&"object"==typeof f){if(g=x(t,f,i,p),!g)return!1;p+=g.length}return t.write(r.ACKS[a][c][u][0]),3===p&&(p+=0!==h?1:-1),_(t,p),d(t,l),5===o&&2!==p&&t.write(n.from([h])),null!==g?g.write():4===p&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,i){l("subscribe: packet: ");let o=i?i.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,u=s.messageId,c=s.subscriptions,h=s.properties,f=0;if("number"!=typeof u)return t.destroy(new Error("Invalid messageId")),!1;f+=2;let p=null;if(5===o){if(p=O(t,h),!p)return!1;f+=p.length}if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let r=0;r<c.length;r+=1){let e=c[r].topic,i=c[r].qos;if("string"!=typeof e)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(c[r].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(c[r].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let e=c[r].rh||0;if("number"!=typeof e||e>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(e)+2+1}l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),_(t,f),d(t,u),null!==p&&p.write();let g=!0;for(let l of c){let e,i=l.topic,s=l.qos,a=+l.nl,u=+l.rap,c=l.rh;S(t,i),e=r.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(e|=a?r.SUBSCRIBE_OPTIONS_NL:0,e|=u?r.SUBSCRIBE_OPTIONS_RAP:0,e|=c?r.SUBSCRIBE_OPTIONS_RH[c]:0),g=t.write(n.from([e]))}return g}(e,t,s);case"suback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,u=s.properties,c=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let r=0;r<l.length;r+=1){if("number"!=typeof l[r])return t.destroy(new Error("Invalid qos vector")),!1;c+=1}let h=null;if(5===o){if(h=x(t,u,i,c),!h)return!1;c+=h.length}return t.write(r.SUBACK_HEADER),_(t,c),d(t,a),null!==h&&h.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.unsubscriptions,c=s.properties,h=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof u||!u.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let r=0;r<u.length;r+=1){if("string"!=typeof u[r])return t.destroy(new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(u[r])+2}let f=null;if(5===o){if(f=O(t,c),!f)return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),_(t,h),d(t,a),null!==f&&f.write();let p=!0;for(let r=0;r<u.length;r++)p=S(t,u[r]);return p}(e,t,s);case"unsuback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.granted,c=s.properties,h=s.cmd,f=0,p=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<u.length;e+=1){if("number"!=typeof u[e])return t.destroy(new Error("Invalid qos vector")),!1;p+=1}}let g=null;if(5===o){if(g=x(t,c,i,p),!g)return!1;p+=g.length}return t.write(r.ACKS[h][f][l][0]),_(t,p),d(t,a),null!==g&&g.write(),5===o&&t.write(n.from(u)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t){return t.write(r.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0,c=null;if(5===o){if(c=x(t,l,i,u),!c)return!1;u+=c.length}return t.write(n.from([r.codes.disconnect<<4])),_(t,u),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,s);case"auth":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));let c=x(t,l,i,u);return!!c&&(u+=c.length,t.write(n.from([r.codes.auth<<4])),_(t,u),t.write(n.from([a])),null!==c&&c.write(),!0)}(e,t,s);default:return t.destroy(new Error("Unknown command")),!1}}function b(e){e.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>d===A,set(e){e?((!u||0===Object.keys(u).length)&&(g=!0),d=A):(g=!1,d=I)}});var m={};function _(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let n=m[t];return n||(n=f(t),t<16384&&(m[t]=n)),l("writeVarByteInt: writing to stream: %o",n),e.write(n)}function S(e,t){let r=n.byteLength(t);return d(e,r),l("writeString: %s",t),e.write(t,"utf8")}function E(e,t,r){S(e,t),S(e,r)}function A(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",u[t]),e.write(u[t])}function I(e,t){let r=c(t);return l("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?S(e,t):t?(d(e,t.length),e.write(t)):d(e,0)}function O(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){T(e,{},0)}};let i=0;function o(t,i){let o=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"binary":if(i&&null===i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(f(i));break;case"string":if("string"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3+n.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=Object.getOwnPropertyNames(i).reduce((e,t)=>{let r=i[t];return Array.isArray(r)?e+=r.reduce((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString()),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(i[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${i}`)),!1}return o}if(t)for(let r in t){let e=0,n=0,s=t[r];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(n=o(r,s[t]),!n)return!1;e+=n}else{if(n=o(r,s),!n)return!1;e=n}if(!e)return!1;i+=e}}return{length:n.byteLength(f(i))+i,write(){T(e,t,i)}}}function x(e,t,r,n){let i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=O(e,t);if(o)for(;n+s.length>o;){let r=i.shift();if(!r||!t[r])return!1;delete t[r],s=O(e,t)}return s}function P(e,t,i){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+i]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([i]));break;case"binary":e.write(n.from([r.properties[t]])),k(e,i);break;case"int16":e.write(n.from([r.properties[t]])),d(e,i);break;case"int32":e.write(n.from([r.properties[t]])),function(e,t){let r=p(t);l("write4ByteNumber: %o",r),e.write(r)}(e,i);break;case"var":e.write(n.from([r.properties[t]])),_(e,i);break;case"string":e.write(n.from([r.properties[t]])),S(e,i);break;case"pair":Object.getOwnPropertyNames(i).forEach(o=>{let s=i[o];Array.isArray(s)?s.forEach(i=>{e.write(n.from([r.properties[t]])),E(e,o.toString(),i.toString())}):(e.write(n.from([r.properties[t]])),E(e,o.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${i}`)),!1}}function T(e,t,r){_(e,r);for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&null!=t[n]){let r=t[n];if(Array.isArray(r))for(let t=0;t<r.length;t++)P(e,n,r[t]);else P(e,n,r)}}function R(e){return e?e instanceof n?e.length:n.byteLength(e):0}function C(e){return"string"==typeof e||e instanceof n}t.exports=y}),pr=b((e,t)=>{v(),pt(),Xe();var r=fr(),{EventEmitter:n}=(Pt(),w(mt)),{Buffer:i}=(ft(),w(at));var o=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e,t=0,r=new Array(this._array.length),n=this._array,o=0;for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?r[e]=n[e].length:r[e]=i.byteLength(n[e]),t+=r[e];let s=i.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(s,o),o+=r[e]):(s.write(n[e],o),o+=r[e]);return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new o;return r(e,n,t),n.concat()}}),dr=b(e=>{v(),pt(),Xe(),e.parser=ur().parser,e.generate=pr(),e.writeToStream=fr()}),gr=b((e,t)=>{"use strict";function r(e){return e instanceof ut?ut.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}v(),pt(),Xe(),t.exports=function(e){if((e=e||{}).circles)return function(e){let t=[],n=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(s(Array.from(e),t))),i.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(let r of e.constructorHandlers)i.set(r[0],r[1]);let o=null;return e.proto?l:a;function s(e,s){let a=Object.keys(e),l=new Array(a.length);for(let u=0;u<a.length;u++){let c=a[u],h=e[c];if("object"!=typeof h||null===h)l[c]=h;else if(h.constructor!==Object&&(o=i.get(h.constructor)))l[c]=o(h,s);else if(ArrayBuffer.isView(h))l[c]=r(h);else{let e=t.indexOf(h);l[c]=-1!==e?n[e]:s(h)}}return l}function a(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return s(e,a);if(e.constructor!==Object&&(o=i.get(e.constructor)))return o(e,a);let l={};t.push(e),n.push(l);for(let s in e){if(!1===Object.hasOwnProperty.call(e,s))continue;let u=e[s];if("object"!=typeof u||null===u)l[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))l[s]=o(u,a);else if(ArrayBuffer.isView(u))l[s]=r(u);else{let e=t.indexOf(u);l[s]=-1!==e?n[e]:a(u)}}return t.pop(),n.pop(),l}function l(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return s(e,l);if(e.constructor!==Object&&(o=i.get(e.constructor)))return o(e,l);let a={};t.push(e),n.push(a);for(let s in e){let u=e[s];if("object"!=typeof u||null===u)a[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))a[s]=o(u,l);else if(ArrayBuffer.isView(u))a[s]=r(u);else{let e=t.indexOf(u);a[s]=-1!==e?n[e]:l(u)}}return t.pop(),n.pop(),a}}(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(i(Array.from(e),t))),t.set(Set,(e,t)=>new Set(i(Array.from(e),t))),e.constructorHandlers)for(let r of e.constructorHandlers)t.set(r[0],r[1]);let n=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){if(!1===Object.hasOwnProperty.call(o,i))continue;let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s};function i(e,i){let o=Object.keys(e),s=new Array(o.length);for(let a=0;a<o.length;a++){let l=o[a],u=e[l];"object"!=typeof u||null===u?s[l]=u:u.constructor!==Object&&(n=t.get(u.constructor))?s[l]=n(u,i):ArrayBuffer.isView(u)?s[l]=r(u):s[l]=i(u)}return s}}}),yr=b((e,t)=>{"use strict";v(),pt(),Xe(),t.exports=gr()()}),br=b(e=>{"use strict";function t(e){let t=e.split("/");for(let r=0;r<t.length;r++)if("+"!==t[r]){if("#"===t[r])return r===t.length-1;if(-1!==t[r].indexOf("+")||-1!==t[r].indexOf("#"))return!1}return!0}v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}),mr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t=er(),r={objectMode:!0},n={clean:!0};e.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...n,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach((e,t)=>{n.push(e)}),e._read=()=>{!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=t=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}}),wr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=(e,r,n)=>{e.log("handlePublish: packet %o",r),n=typeof n<"u"?n:e.noop;let i=r.topic.toString(),o=r.payload,{qos:s}=r,{messageId:a}=r,{options:l}=e;if(5===e.options.protocolVersion){let t;if(r.properties&&(t=r.properties.topicAlias),typeof t<"u")if(0===i.length){if(!(t>0&&t<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));{let r=e.topicAliasRecv.getTopicByAlias(t);if(!r)return e.log("handlePublish :: unregistered topic alias. alias: %d",t),void e.emit("error",new Error("Received unregistered Topic Alias"));i=r,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,t)}}else{if(!e.topicAliasRecv.put(i,t))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,t)}}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(i,o,r,(i,o)=>("number"==typeof i&&(o=i,i=null),i?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",new Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:o},n):e.incomingStore.put(r,()=>{e._sendPacket({cmd:"pubrec",messageId:a},n)}))));break;case 1:l.customHandleAcks(i,o,r,(s,l)=>("number"==typeof s&&(l=s,s=null),s?e.emit("error",s):-1===t.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,o,r),void e.handleMessage(r,t=>{if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},n)}))));break;case 0:e.emit("message",i,o,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}}),vr=b((e,t)=>{t.exports={version:"5.15.1"}}),_r=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=function(e,t,r=!1){let n=[t];for(;;){let e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(let i of n)for(let t of Object.getOwnPropertyNames(i.prototype))(r||"constructor"!==t)&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(i.prototype,t)??Object.create(null))},e.ErrorWithReasonCode=class e extends Error{code;constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}},e.ErrorWithSubackPacket=class e extends Error{packet;constructor(t,r){super(t),this.packet=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}},e.nextTick="function"==typeof _?.nextTick?_.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=vr().version}),Sr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=_r();e.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"};e.default=(r,n)=>{let{messageId:i}=n,o=n.cmd,s=null,a=r.outgoing[i]?r.outgoing[i].cb:null,l=null;if(a){switch(r.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":{let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._removeOutgoingAndStoreMessage(i,a);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:i};let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._sendPacket(s);break}case"suback":{delete r.outgoing[i],r.messageIdProvider.deallocate(i);let t=n.granted;for(let n=0;n<t.length;n++){let o=t[n];if(128&o){l=new Error(`Subscribe error: ${e.ReasonCodes[o]}`),l.code=o;let t=r.messageIdToTopic[i];t&&t.forEach(e=>{delete r._resubscribeTopics[e]})}}delete r.messageIdToTopic[i],r._invokeStoreProcessingQueue(),a(l,n);break}case"unsuback":delete r.outgoing[i],r.messageIdProvider.deallocate(i),r._invokeStoreProcessingQueue(),a(null,n);break;default:r.emit("error",new Error("unrecognized packet type"))}r.disconnecting&&0===Object.keys(r.outgoing).length&&r.emit("outgoingEmpty")}else r.log("_handleAck :: Server sent an ack in error. Ignoring.")}}),Er=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t=_r(),r=Sr();e.default=(e,n)=>{let{options:i}=e,o=i.protocolVersion,s=5===o?n.reasonCode:n.returnCode;if(5!==o){let r=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,s);return void e.emit("error",r)}e.handleAuth(n,(n,i)=>{if(n)e.emit("error",n);else if(24===s)e.reconnecting=!1,e._sendPacket(i);else{let n=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",n)}})}}),Ar=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof _&&_?_:{},i=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},o=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof o>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,i("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",t))}}var a=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>a(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},c=class e{heap;length;static#e=!1;static create(t){let r=l(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#l;#u;#c;#h;#f;#p;#d;#g;#y;#b;#m;#w;#v;#_;#S;static unsafeExposeInternals(e){return{starts:e.#m,ttls:e.#w,sizes:e.#b,keyMap:e.#l,keyList:e.#u,valList:e.#c,next:e.#h,prev:e.#f,get head(){return e.#p},get tail(){return e.#d},free:e.#g,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#A(t,r,n,i),moveToTail:t=>e.#I(t),indexes:t=>e.#k(t),rindexes:t=>e.#O(t),isStale:t=>e.#x(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:u,updateAgeOnGet:h,updateAgeOnHas:f,allowStale:p,dispose:d,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:b,maxSize:m=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:_,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:k,ignoreFetchAbort:O}=t;if(0!==n&&!a(n))throw new TypeError("max option must be a nonnegative integer");let x=n?l(n):Array;if(!x)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=m,this.maxEntrySize=w||this.#t,this.sizeCalculation=v,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#o=S,void 0!==_&&"function"!=typeof _)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#_=!!_,this.#l=new Map,this.#u=new Array(n).fill(void 0),this.#c=new Array(n).fill(void 0),this.#h=new x(n),this.#f=new x(n),this.#p=0,this.#d=0,this.#g=c.create(n),this.#s=0,this.#a=0,"function"==typeof d&&(this.#r=d),"function"==typeof g?(this.#n=g,this.#y=[]):(this.#n=void 0,this.#y=void 0),this.#v=!!this.#r,this.#S=!!this.#n,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#t&&!a(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!f,this.ttlResolution=a(s)||0===s?s:1,this.ttlAutopurge=!!u,this.ttl=o||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!r.has(e))(t)&&(r.add(t),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#T(){let e=new u(this.#e),r=new u(this.#e);this.#w=e,this.#m=r,this.#R=(n,i,o=t.now())=>{if(r[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){let e=setTimeout(()=>{this.#x(n)&&this.#C(this.#u[n],"expire")},i+1);e.unref&&e.unref()}},this.#j=n=>{r[n]=0!==e[n]?t.now():0},this.#M=(t,o)=>{if(e[o]){let s=e[o],a=r[o];if(!s||!a)return;t.ttl=s,t.start=a,t.now=n||i(),t.remainingTTL=s-(t.now-a)}};let n=0,i=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let o=this.#l.get(t);if(void 0===o)return 0;let s=e[o],a=r[o];return s&&a?s-((n||i())-a):1/0},this.#x=t=>{let o=r[t],s=e[t];return!!s&&!!o&&(n||i())-o>s}}#j=()=>{};#M=()=>{};#R=()=>{};#x=()=>!1;#P(){let e=new u(this.#e);this.#a=0,this.#b=e,this.#B=t=>{this.#a-=e[t],e[t]=0},this.#N=(e,t,r,n)=>{if(this.#E(t))return 0;if(!a(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#U=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#a>r;)this.#L(!0)}this.#a+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#a)}}#B=e=>{};#U=(e,t,r)=>{};#N=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#d;this.#D(t)&&((e||!this.#x(t))&&(yield t),t!==this.#p);)t=this.#f[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#p;this.#D(t)&&((e||!this.#x(t))&&(yield t),t!==this.#d);)t=this.#h[t]}#D(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(let e of this.#k())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*rentries(){for(let e of this.#O())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*keys(){for(let e of this.#k()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*values(){for(let e of this.#k())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}*rvalues(){for(let e of this.#O())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}rforEach(e,t=this){for(let r of this.#O()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#x(t)&&(this.#C(this.#u[t],"expire"),e=!0);return e}info(e){let r=this.#l.get(e);if(void 0===r)return;let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0===i)return;let o={value:i};if(this.#w&&this.#m){let e=this.#w[r],n=this.#m[r];e&&n&&(o.ttl=e-(t.now()-n),o.start=Date.now())}return this.#b&&(o.size=this.#b[r]),o}dump(){let e=[];for(let r of this.#k({allowStale:!0})){let n=this.#u[r],i=this.#c[r],o=this.#E(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;let s={value:o};if(this.#w&&this.#m){s.ttl=this.#w[r];let e=t.now()-this.#m[r];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#N(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let c=0===this.#s?void 0:this.#l.get(e);if(void 0===c)c=0===this.#s?this.#d:0!==this.#g.length?this.#g.pop():this.#s===this.#e?this.#L(!1):this.#s,this.#u[c]=e,this.#c[c]=t,this.#l.set(e,c),this.#h[this.#d]=c,this.#f[c]=this.#d,this.#d=c,this.#s++,this.#U(c,u,a),a&&(a.set="add"),l=!1;else{this.#I(c);let r=this.#c[c];if(t!==r){if(this.#_&&this.#E(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#v&&this.#r?.(t,e,"set"),this.#S&&this.#y?.push([t,e,"set"]))}else o||(this.#v&&this.#r?.(r,e,"set"),this.#S&&this.#y?.push([r,e,"set"]));if(this.#B(c),this.#U(c,u,a),this.#c[c]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0!==n&&!this.#w&&this.#T(),this.#w&&(l||this.#R(c,n,i),a&&this.#M(a,c)),!o&&this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#s;){let e=this.#c[this.#p];if(this.#L(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}}#L(e){let t=this.#p,r=this.#u[t],n=this.#c[t];return this.#_&&this.#E(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(n,r,"evict"),this.#S&&this.#y?.push([n,r,"evict"])),this.#B(t),e&&(this.#u[t]=void 0,this.#c[t]=void 0,this.#g.push(t)),1===this.#s?(this.#p=this.#d=0,this.#g.length=0):this.#p=this.#h[t],this.#l.delete(r),this.#s--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#l.get(e);if(void 0!==i){let e=this.#c[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#x(i))return r&&this.#j(i),n&&(n.has="hit",this.#M(n,i)),!0;n&&(n.has="stale",this.#M(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#x(n))return;let i=this.#c[n];return this.#E(i)?i.__staleWhileFetching:i}#A(e,t,r,n){let i=void 0===t?void 0:this.#c[t];if(this.#E(i))return i;let s=new o,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:r,context:n},u=(n,i=!1)=>{let{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!i)return c(s.signal.reason);let u=h;return this.#c[t]===h&&(void 0===n?u.__staleWhileFetching?this.#c[t]=u.__staleWhileFetching:this.#C(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n},c=n=>{let{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,u=h;if(this.#c[t]===h&&(l&&void 0!==u.__staleWhileFetching?o||(this.#c[t]=u.__staleWhileFetching):this.#C(e,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);let h=new Promise((t,n)=>{let o=this.#i?.(e,i,l);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))})}).then(u,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e))),f=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=this.#l.get(e)):this.#c[t]=f,f}#E(e){if(!this.#_)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:g=!1,status:y,signal:b}=t;if(!this.#_)return y&&(y.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:y});let m={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:y,signal:b},w=this.#l.get(e);if(void 0===w){y&&(y.fetch="miss");let t=this.#A(e,w,m,d);return t.__returned=t}{let t=this.#c[w];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#x(w);if(!g&&!i)return y&&(y.fetch="hit"),this.#I(w),n&&this.#j(w),y&&this.#M(y,w),t;let o=this.#A(e,w,m,d),s=void 0!==o.__staleWhileFetching&&r;return y&&(y.fetch=i?"stale":"refresh",s&&i&&(y.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#o;if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:i,...o}=t,s=this.get(e,o);if(!i&&void 0!==s)return s;let a=r(e,s,{options:o,context:n});return this.set(e,a,o),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#l.get(e);if(void 0!==s){let t=this.#c[s],a=this.#E(t);return o&&this.#M(o,s),this.#x(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#C(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#j(s),t))}o&&(o.get="miss")}#F(e,t){this.#f[t]=e,this.#h[e]=t}#I(e){e!==this.#d&&(e===this.#p?this.#p=this.#h[e]:this.#F(this.#f[e],this.#h[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let r=!1;if(0!==this.#s){let n=this.#l.get(e);if(void 0!==n)if(r=!0,1===this.#s)this.#W(t);else{this.#B(n);let r=this.#c[n];if(this.#E(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(r,e,t),this.#S&&this.#y?.push([r,e,t])),this.#l.delete(e),this.#u[n]=void 0,this.#c[n]=void 0,n===this.#d)this.#d=this.#f[n];else if(n===this.#p)this.#p=this.#h[n];else{let e=this.#f[n];this.#h[e]=this.#h[n];let t=this.#h[n];this.#f[t]=this.#f[n]}this.#s--,this.#g.push(n)}}if(this.#S&&this.#y?.length){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return r}clear(){return this.#W("delete")}#W(e){for(let t of this.#O({allowStale:!0})){let r=this.#c[t];if(this.#E(r))r.__abortController.abort(new Error("deleted"));else{let n=this.#u[t];this.#v&&this.#r?.(r,n,e),this.#S&&this.#y?.push([r,n,e])}}if(this.#l.clear(),this.#c.fill(void 0),this.#u.fill(void 0),this.#w&&this.#m&&(this.#w.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#p=0,this.#d=0,this.#g.length=0,this.#a=0,this.#s=0,this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}}}),Ir=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;e.ContainerIterator=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return 0===this.i}};e.Base=t;e.Container=class extends t{}}),kr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ir(),r=class extends t.Base{constructor(e=[]){super(),this.S=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(0!==this.i)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}};e.default=r}),Or=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ir(),r=class extends t.Base{constructor(e=[]){super(),this.j=0,this.q=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.q=[],this.i=this.j=0}push(e){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let t=this.i;for(let e=0;e<t;++e)this.q[e]=this.q[this.j+e];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(0===this.i)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(0!==this.i)return this.q[this.j]}};e.default=r}),xr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ir(),r=class extends t.Base{constructor(e=[],t=function(e,t){return e>t?-1:e<t?1:0},r=!0){if(super(),this.v=t,Array.isArray(e))this.C=r?[...e]:e;else{this.C=[];let t=this;e.forEach(function(e){t.C.push(e)})}this.i=this.C.length;let n=this.i>>1;for(let i=this.i-1>>1;i>=0;--i)this.k(i,n)}m(e){let t=this.C[e];for(;e>0;){let r=e-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[e]=n,e=r}this.C[e]=t}k(e,t){let r=this.C[e];for(;e<t;){let t=e<<1|1,n=t+1,i=this.C[t];if(n<this.i&&this.v(i,this.C[n])>0&&(t=n,i=this.C[n]),this.v(i,r)>=0)break;this.C[e]=i,e=t}this.C[e]=r}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(0===this.i)return;let e=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let t=this.C.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(e){let t=this.C.indexOf(e);return!(t<0)&&(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}};e.default=r}),Pr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ir(),r=class extends t.Container{};e.default=r}),Tr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw new RangeError("Iterator access denied!")}}),Rr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=Ir(),r=Tr(),n=class extends t.ContainerIterator{constructor(e,t){super(t),this.o=e,0===this.iteratorType?(this.pre=function(){return 0===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return-1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};e.RandomIterator=n}),Cr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Pr())&&t.t?t:{default:t},n=Rr();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=!0){if(super(),Array.isArray(e))this.J=t?[...e]:e,this.i=e.length;else{this.J=[];let t=this;e.forEach(function(e){t.pushBack(e)})}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-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 t=0;for(let r=0;r<this.i;++r)this.J[r]!==e&&(this.J[t++]=this.J[r]);return this.i=this.J.length=t,this.i}eraseElementByIterator(e){let t=e.o;return e=e.next(),this.eraseElementByPos(t),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(0!==this.i)return this.i-=1,this.J.pop()}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(r).fill(t)),this.i+=r,this.i}find(e){for(let t=0;t<this.i;++t)if(this.J[t]===e)return new i(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let t=0;t<this.i;++t)e(this.J[t],t,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}};e.default=o}),jr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Pr())&&t.t?t:{default:t},n=Ir(),i=Tr();var o=class e extends n.ContainerIterator{constructor(e,t,r,n){super(n),this.o=e,this.h=t,this.container=r,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let t=this;e.forEach(function(e){t.pushBack(e)})}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}G(e,t){let r=t.B,n={l:e,L:t,B:r};t.B=n,r.L=n,t===this.h&&(this.p=n),r===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(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 t=this.p;for(;e--;)t=t.B;return t.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}eraseElementByValue(e){let t=this.p;for(;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(0===this.i)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(0===this.i)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;r.l=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(r<=0)return this.i;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=this.p;for(let t=1;t<e;++t)n=n.B;let i=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=i,i.L=n}return this.i}find(e){let t=this.p;for(;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,t=this._,r=0;for(;r<<1<this.i;){let n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let t=e;for(;t.B!==this.h&&t.l===t.B.l;)t=t.B,this.i-=1;e.B=t.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let t=[];this.forEach(function(e){t.push(e)}),t.sort(e);let r=this.p;t.forEach(function(e){r.l=e,r=r.B})}merge(e){let t=this;if(0===this.i)e.forEach(function(e){t.pushBack(e)});else{let r=this.p;e.forEach(function(e){for(;r!==t.h&&r.l<=e;)r=r.B;t.G(e,r.L)})}return this.i}forEach(e){let t=this.p,r=0;for(;t!==this.h;)e(t.l,r++,this),t=t.B}[Symbol.iterator](){return function*(){if(0===this.i)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}};e.default=s}),Mr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Pr())&&t.t?t:{default:t},n=Rr();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("function"==typeof e.size)return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(r/this.F),1);for(let o=0;o<this.P;++o)this.A.push(new Array(this.F));let n=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-r%this.F>>1;let i=this;e.forEach(function(e){i.pushBack(e)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let r=0;r<t;++r)e[r]=new Array(this.F);for(let r=this.j;r<this.P;++r)e[e.length]=this.A[r];for(let r=0;r<this.R;++r)e[e.length]=this.A[r];e[e.length]=[...this.A[this.R]],this.j=t,this.R=e.length-1;for(let r=0;r<t;++r)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let t=this.D+e+1,r=t%this.F,n=r-1,i=this.j+(t-r)/this.F;return 0===r&&(i-=1),i%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:i,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(0!==this.i)return this.A[this.j][this.D]}back(){if(0!==this.i)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(0===this.i)return;let e=this.A[this.R][this.N];return 1!==this.i&&(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(0===this.i)return;let e=this.A[this.j][this.D];return 1!==this.i&&(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:t,curNodePointerIndex:r}=this.O(e);return this.A[t][r]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);this.A[r][n]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=[];for(let t=e;t<this.i;++t)n.push(this.getElementByPos(t));this.cut(e-1);for(let e=0;e<r;++e)this.pushBack(t);for(let e=0;e<n.length;++e)this.pushBack(n[e])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.R=t,this.N=r,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(0===e)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let n=e+1;n<this.i;++n)t.push(this.getElementByPos(n));this.cut(e),this.popBack();let r=this;t.forEach(function(e){r.pushBack(e)})}return this.i}eraseElementByValue(e){if(0===this.i)return 0;let t=[];for(let n=0;n<this.i;++n){let r=this.getElementByPos(n);r!==e&&t.push(r)}let r=t.length;for(let n=0;n<r;++n)this.setElementByPos(n,t[n]);return this.cut(r-1)}eraseElementByIterator(e){let t=e.o;return this.eraseElementByPos(t),e=e.next()}find(e){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new i(t,this);return this.end()}reverse(){let e=0,t=this.i-1;for(;e<t;){let r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}unique(){if(this.i<=1)return this.i;let e=1,t=this.getElementByPos(0);for(let r=1;r<this.i;++r){let n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let t=[];for(let r=0;r<this.i;++r)t.push(this.getElementByPos(r));t.sort(e);for(let r=0;r<this.i;++r)this.setElementByPos(r,t[r])}shrinkToFit(){if(0===this.i)return;let e=[];this.forEach(function(t){e.push(t)}),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 t=0;t<this.P;++t)this.A.push(new Array(this.F));for(let t=0;t<e.length;++t)this.pushBack(e[t])}forEach(e){for(let t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}};e.default=o}),Br=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(e,t){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=t}L(){let e=this;if(1===e.ee&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let t=e.tt;for(;t.U===e;)e=t,t=e.tt;e=t}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}{let t=e.tt;for(;t.W===e;)e=t,t=e.tt;return e.W!==t?t:e}}te(){let e=this.tt,t=this.W,r=t.U;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.U=this,this.tt=t,this.W=r,r&&(r.tt=this),t}se(){let e=this.tt,t=this.U,r=t.W;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.W=this,this.tt=t,this.U=r,r&&(r.tt=this),t}};e.TreeNode=t;e.TreeNodeEnableIndex=class extends t{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)}}}),Nr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Br(),r=Ir(),n=Tr(),i=class extends r.Container{constructor(e=function(e,t){return e<t?-1:e>t?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=t.TreeNodeEnableIndex,this.M=function(e,t,r){let n=this.ne(e,t,r);if(n){let e=n.tt;for(;e!==this.h;)e.rt+=1,e=e.tt;let t=this.he(n);if(t){let{parentNode:e,grandParent:r,curNode:n}=t;e.ie(),r.ie(),n.ie()}}return this.i},this.V=function(e){let t=this.fe(e);for(;t!==this.h;)t.rt-=1,t=t.tt}):(this.re=t.TreeNode,this.M=function(e,t,r){let n=this.ne(e,t,r);return n&&this.he(n),this.i},this.V=this.fe),this.h=new this.re}X(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)e=e.W;else{if(!(n>0))return e;r=e,e=e.U}}return r}Z(e,t){let r=this.h;for(;e;)this.v(e.u,t)<=0?e=e.W:(r=e,e=e.U);return r}$(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)r=e,e=e.W;else{if(!(n>0))return e;e=e.U}}return r}rr(e,t){let r=this.h;for(;e;)this.v(e.u,t)<0?(r=e,e=e.W):e=e.U;return r}ue(e){for(;;){let t=e.tt;if(t===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===t.U){let r=t.W;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.te():t.te();else{if(r.W&&1===r.W.ee)return r.ee=t.ee,t.ee=0,r.W.ee=0,void(t===this.Y?this.Y=t.te():t.te());r.U&&1===r.U.ee?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,e=t)}}else{let r=t.U;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else{if(r.U&&1===r.U.ee)return r.ee=t.ee,t.ee=0,r.U.ee=0,void(t===this.Y?this.Y=t.se():t.se());r.W&&1===r.W.ee?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,e=t)}}}}fe(e){if(1===this.i)return this.clear(),this.h;let t=e;for(;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;[e.u,t.u]=[t.u,e.u],[e.l,t.l]=[t.l,e.l],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);let r=t.tt;return t===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(e,t){return void 0!==e&&(!(!this.oe(e.U,t)&&!t(e))||this.oe(e.W,t))}he(e){for(;;){let t=e.tt;if(0===t.ee)return;let r=t.tt;if(t===r.U){let n=r.W;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.W){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=r),t.W=e.U,r.U=e.W,e.U=t,e.W=r,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let n=r.U;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.U){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=t),r.W=e.U,t.U=e.W,e.U=r,e.W=t,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(e,t,r){if(void 0===this.Y)return this.i+=1,this.Y=new this.re(e,t),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,void(this.h.W=this.Y);let n,i=this.h.U,o=this.v(i.u,e);if(0!==o){if(o>0)i.U=new this.re(e,t),i.U.tt=i,n=i.U,this.h.U=n;else{let i=this.h.W,o=this.v(i.u,e);if(0===o)return void(i.l=t);if(o<0)i.W=new this.re(e,t),i.W.tt=i,n=i.W,this.h.W=n;else{if(void 0!==r){let i=r.o;if(i!==this.h){let r=this.v(i.u,e);if(0===r)return void(i.l=t);if(r>0){let r=i.L(),o=this.v(r.u,e);if(0===o)return void(r.l=t);o<0&&(n=new this.re(e,t),void 0===r.W?(r.W=n,n.tt=r):(i.U=n,n.tt=i))}}}if(void 0===n)for(n=this.Y;;){let r=this.v(n.u,e);if(r>0){if(void 0===n.U){n.U=new this.re(e,t),n.U.tt=n,n=n.U;break}n=n.U}else{if(!(r<0))return void(n.l=t);if(void 0===n.W){n.W=new this.re(e,t),n.W.tt=n,n=n.W;break}n=n.W}}}}return this.i+=1,n}i.l=t}I(e,t){for(;e;){let r=this.v(e.u,t);if(r<0)e=e.W;else{if(!(r>0))return e;e=e.U}}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,t){let r=e.o;if(r===this.h&&(0,n.throwIteratorAccessError)(),1===this.i)return r.u=t,!0;if(r===this.h.U)return this.v(r.B().u,t)>0&&(r.u=t,!0);if(r===this.h.W)return this.v(r.L().u,t)<0&&(r.u=t,!0);let i=r.L().u;if(this.v(i,t)>=0)return!1;let o=r.B().u;return!(this.v(o,t)<=0)&&(r.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=0,r=this;return this.oe(this.Y,function(n){return e===t?(r.V(n),!0):(t+=1,!1)}),this.i}eraseElementByKey(e){if(0===this.i)return!1;let t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}eraseElementByIterator(e){let t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();let r=void 0===t.W;return 0===e.iteratorType?r&&e.next():(!r||void 0===t.U)&&e.next(),this.V(t),e}forEach(e){let t=0;for(let r of this)e(r,t++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t,r=0;for(let n of this){if(r===e){t=n;break}r+=1}return t}getHeight(){if(0===this.i)return 0;let e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}};e.default=i}),Ur=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ir(),r=Tr(),n=class extends t.ContainerIterator{constructor(e,t,n){super(n),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;let r=0;for(e.U&&(r+=e.U.rt);e!==t;){let t=e.tt;e===t.W&&(r+=1,t.U&&(r+=t.U.rt)),e=t}return r}};e.default=n}),Lr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Nr()),r=i(Ur()),n=Tr();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.insert(e)})}*K(e){void 0!==e&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(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,t){return this.M(e,void 0,t)}find(e){return new o(this.I(this.Y,e),this.h,this)}lowerBound(e){return new o(this.X(this.Y,e),this.h,this)}upperBound(e){return new o(this.Z(this.Y,e),this.h,this)}reverseLowerBound(e){return new o(this.$(this.Y,e),this.h,this)}reverseUpperBound(e){return new o(this.rr(this.Y,e),this.h,this)}union(e){let t=this;return e.forEach(function(e){t.insert(e)}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),Dr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Nr()),r=i(Ur()),n=Tr();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.setElement(e[0],e[1])})}*K(e){void 0!==e&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0===this.i)return;let e=this.h.U;return[e.u,e.l]}back(){if(0===this.i)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){return new o(this.X(this.Y,e),this.h,this)}upperBound(e){return new o(this.Z(this.Y,e),this.h,this)}reverseLowerBound(e){return new o(this.$(this.Y,e),this.h,this)}reverseUpperBound(e){return new o(this.rr(this.Y,e),this.h,this)}setElement(e,t,r){return this.M(e,t,r)}find(e){return new o(this.I(this.Y,e),this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),Fr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){let t=typeof e;return"object"===t&&null!==e||"function"===t}}),Wr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=Ir(),n=(t=Fr())&&t.t?t:{default:t},i=Tr();var o=class extends r.ContainerIterator{constructor(e,t,r){super(r),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var s=class extends r.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:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}M(e,t,r){let i;if(void 0===r&&(r=(0,n.default)(e)),r){let r=e[this.HASH_TAG];if(void 0!==r)return this.H[r].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:t,L:this._,B:this.h},this.H.push(i)}else{let r=this.g[e];if(r)return r.l=t,this.i;i={u:e,l:t,L:this._,B:this.h},this.g[e]=i}return 0===this.i?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0===t?this.h:this.H[t]}return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.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,t){let r;if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];if(void 0===t)return!1;delete e[this.HASH_TAG],r=this.H[t],delete this.H[t]}else{if(r=this.g[e],void 0===r)return!1;delete this.g[e]}return this.V(r),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}};e.HashContainer=s}),$r=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Wr(),r=Tr(),n=class e extends t.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.insert(e)})}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,t){return this.M(e,void 0,t)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.u}find(e,t){return new n(this.I(e,t),this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e(r.u,t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}};e.default=i}),qr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=Wr(),n=(t=Fr())&&t.t?t:{default:t},i=Tr();var o=class e extends r.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.setElement(e[0],e[1])})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0!==this.i)return[this.p.u,this.p.l]}back(){if(0!==this.i)return[this._.u,this._.l]}setElement(e,t,r){return this.M(e,t,r)}getElementByKey(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0!==t?this.H[t].l:void 0}let r=this.g[e];return r?r.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return[t.u,t.l]}find(e,t){return new o(this.I(e,t),this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}};e.default=s}),Hr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=h(kr()),r=h(Or()),n=h(xr()),i=h(Cr()),o=h(jr()),s=h(Mr()),a=h(Lr()),l=h(Dr()),u=h($r()),c=h(qr());function h(e){return e&&e.t?e:{default:e}}}),Vr=b((e,t)=>{"use strict";v(),pt(),Xe();var r=Hr().OrderedSet,n=lr()("number-allocator:trace"),i=lr()("number-allocator:error");function o(e,t){this.low=e,this.high=t}function s(e,t){if(!(this instanceof s))return new s(e,t);this.min=e,this.max=t,this.ss=new r([],(e,t)=>e.compare(t)),n("Create"),this.clear()}o.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},o.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},s.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},s.prototype.alloc=function(){if(0===this.ss.size())return n("alloc():empty"),null;let e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high,i=t;return i+1<=r?this.ss.updateKeyByIterator(e,new o(t+1,r)):this.ss.eraseElementByPos(0),n("alloc():"+i),i},s.prototype.use=function(e){let t=new o(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){let i=r.pointer.low,s=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),n("use():"+e),!0):!(i>e)&&(i===e?(this.ss.updateKeyByIterator(r,new o(i+1,s)),n("use():"+e),!0):s===e?(this.ss.updateKeyByIterator(r,new o(i,s-1)),n("use():"+e),!0):(this.ss.updateKeyByIterator(r,new o(e+1,s)),this.ss.insert(new o(i,e-1)),n("use():"+e),!0))}return n("use():failed"),!1},s.prototype.free=function(e){if(e<this.min||e>this.max)return void i("free():"+e+" is out of range");let t=new o(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin()))return void this.ss.insert(t);r.pre();let n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new o(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin()))if(e+1===r.pointer.low){let t=r.pointer.high;this.ss.updateKeyByIterator(r,new o(e,t))}else this.ss.insert(t);else{let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new o(s,i))):this.ss.updateKeyByIterator(r,new o(s,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new o(e,i))):this.ss.insert(t)}n("free():"+e)},s.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let e of this.ss)console.log(e)},t.exports=s}),zr=b((e,t)=>{v(),pt(),Xe();var r=Vr();t.exports.NumberAllocator=r}),Kr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t=Ar(),r=zr();e.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}}),Gr=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=Sr(),n=t(Kr()),i=_r();e.default=(e,t)=>{e.log("_handleConnack");let{options:o}=e,s=5===o.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=t.properties.serverKeepAlive),t.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===s)e.reconnecting=!1,e._onConnect(t);else if(s>0){let t=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",t),e.options.reconnectOnConnackError&&e._cleanUp(!0)}}}),Qr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=(e,t,r)=>{e.log("handling pubrel packet");let n=typeof r<"u"?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(o,n)}))})}}),Yr=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(wr()),n=t(Er()),i=t(Gr()),o=t(Sr()),s=t(Qr());e.default=(e,t,a)=>{let{options:l}=e;if(5===l.protocolVersion&&l.properties&&l.properties.maximumPacketSize&&l.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,a);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),a();break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,a);break;case"connack":(0,i.default)(e,t),a();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),a();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),a();break;case"disconnect":e.emit("disconnect",t),a();break;default:e.log("_handlePacket :: unknown command"),a()}}}),Jr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}}),Xr=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}}),Zr=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((Pt(),w(mt))),n=_r(),i=class{};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)}),en=b((e,t)=>{var r,n;v(),pt(),Xe(),r=e,n=function(e){"use strict";var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=2*n,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o);e.addUniqueNumber=function(e){return function(t){var r=e(t);return t.add(r),r}}(s),e.generateUniqueNumber=s},"object"==typeof e&&typeof t<"u"?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((r=typeof globalThis<"u"?globalThis:r||self).fastUniqueNumbers={})}),tn=b((e,t)=>{function r(e){return t.exports=r="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},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}v(),pt(),Xe(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),rn=b((e,t)=>{v(),pt(),Xe();var r=tn().default;t.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},t.exports.__esModule=!0,t.exports.default=t.exports}),nn=b((e,t)=>{v(),pt(),Xe();var r=tn().default,n=rn();t.exports=function(e){var t=n(e,"string");return"symbol"==r(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports}),on=b((e,t)=>{v(),pt(),Xe();var r=nn();t.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t.exports.__esModule=!0,t.exports.default=t.exports}),sn=b((e,t)=>{v(),pt(),Xe(),t.exports=function(e){if(Array.isArray(e))return e},t.exports.__esModule=!0,t.exports.default=t.exports}),an=b((e,t)=>{v(),pt(),Xe(),t.exports=function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports}),ln=b((e,t)=>{v(),pt(),Xe(),t.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},t.exports.__esModule=!0,t.exports.default=t.exports}),un=b((e,t)=>{v(),pt(),Xe();var r=ln();t.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}),cn=b((e,t)=>{v(),pt(),Xe(),t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports}),hn=b((e,t)=>{v(),pt(),Xe();var r=sn(),n=an(),i=un(),o=cn();t.exports=function(e,t){return r(e)||n(e,t)||i(e,t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports}),fn=b((e,t)=>{function r(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(u){return void r(u)}a.done?t(l):Promise.resolve(l).then(n,i)}v(),pt(),Xe(),t.exports=function(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}),pn=b((e,t)=>{v(),pt(),Xe(),t.exports=function(e,t){this.v=e,this.k=t},t.exports.__esModule=!0,t.exports.default=t.exports}),dn=b((e,t)=>{function r(e,n,i,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}t.exports=r=function(e,t,n,i){function o(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n,i,o)}v(),pt(),Xe(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),gn=b((e,t)=>{v(),pt(),Xe();var r=dn();function n(){var e,i,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function l(t,n,o,s){var a=n&&n.prototype instanceof c?n:c,l=Object.create(a.prototype);return r(l,"_invoke",function(t,r,n){var o,s,a,l=0,c=n||[],h=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,s=0,a=e,f.n=r,u}};function p(t,r){for(s=t,a=r,i=0;!h&&l&&!n&&i<c.length;i++){var n,o=c[i],p=f.p,d=o[2];t>3?(n=d===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((n=t<2&&p<o[1])?(s=0,f.v=r,f.n=o[1]):p<d&&(n=t<3||o[0]>r||r>d)&&(o[4]=t,o[5]=r,f.n=d,s=0))}if(n||t>1)return u;throw h=!0,r}return function(n,c,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&p(c,d),s=c,a=d;(i=s<2?e:a)||!h;){o||(s?s<3?(s>1&&(f.n=-1),p(s,a)):f.n=a:f.v=a);try{if(l=2,o){if(s||(n="next"),i=o[n]){if(!(i=i.call(o,a)))throw TypeError("iterator result is not an object");if(!i.done)return i;a=i.value,s<2&&(s=0)}else 1===s&&(i=o.return)&&i.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((i=(h=f.n<0)?a:t.call(r,f))!==u)break}catch(g){o=e,s=1,a=g}finally{l=1}}return{value:i,done:h}}}(t,o,s),!0),l}var u={};function c(){}function h(){}function f(){}i=Object.getPrototypeOf;var p=[][s]?i(i([][s]())):(r(i={},s,function(){return this}),i),d=f.prototype=c.prototype=Object.create(p);function g(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return h.prototype=f,r(d,"constructor",f),r(f,"constructor",h),h.displayName="GeneratorFunction",r(f,a,"GeneratorFunction"),r(d),r(d,a,"Generator"),r(d,s,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),yn=b((e,t)=>{v(),pt(),Xe();var r=pn(),n=dn();t.exports=function e(t,i){function o(e,n,s,a){try{var l=t[e](n),u=l.value;return u instanceof r?i.resolve(u.v).then(function(e){o("next",e,s,a)},function(e){o("throw",e,s,a)}):i.resolve(u).then(function(e){l.value=e,s(l)},function(e){return o("throw",e,s,a)})}catch(c){a(c)}}var s;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(e,t,r){function n(){return new i(function(t,n){o(e,r,t,n)})}return s=s?s.then(n,n):n()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports}),bn=b((e,t)=>{v(),pt(),Xe();var r=gn(),n=yn();t.exports=function(e,t,i,o,s){return new n(r().w(e,t,i,o),s||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports}),mn=b((e,t)=>{v(),pt(),Xe();var r=bn();t.exports=function(e,t,n,i,o){var s=r(e,t,n,i,o);return s.next().then(function(e){return e.done?e.value:s.next()})},t.exports.__esModule=!0,t.exports.default=t.exports}),wn=b((e,t)=>{v(),pt(),Xe(),t.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}},t.exports.__esModule=!0,t.exports.default=t.exports}),vn=b((e,t)=>{v(),pt(),Xe();var r=tn().default;t.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports}),_n=b((e,t)=>{v(),pt(),Xe();var r=pn(),n=gn(),i=mn(),o=bn(),s=yn(),a=wn(),l=vn();function u(){"use strict";var e=n(),c=e.m(u),h=(Object.getPrototypeOf?Object.getPrototypeOf(c):c.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function d(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,p[e],t)},delegateYield:function(e,i,o){return t.resultName=i,r(n.d,l(e),o)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}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(t.exports=u=function(){return{wrap:function(t,r,n,i){return e.w(d(t),r,n,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,r,n,s){return(f(t)?o:i)(d(e),t,r,n,s)},keys:a,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}),Sn=b((e,t)=>{v(),pt(),Xe();var r=_n()();t.exports=r;try{regeneratorRuntime=r}catch{"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),En=b((e,t)=>{var r,n;v(),pt(),Xe(),r=e,n=function(e,t,r,n,i,o){"use strict";function s(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(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 u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c;e.createBroker=function(e,t,i,o){return function(s){var l=t(s);return function(t){var s=e(t);t.addEventListener("message",function(e){var t=e.data,r=t.id;if(null!==r&&s.has(r)){var n=s.get(r),i=n.reject,o=n.resolve;s.delete(r),void 0===t.error?o(t.result):i(new Error(t.error.message))}}),o(t)&&t.start();for(var u=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(function(o,a){var l=i(s);s.set(l,{reject:a,resolve:o}),null===r?t.postMessage({id:l,method:e},n):t.postMessage({id:l,method:e,params:r},n)})},c=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t.postMessage({id:null,method:e,params:r},n)},h={},f=0,p=Object.entries(l);f<p.length;f++){var d=n(p[f],2),g=d[0],y=d[1];h=a(a({},h),{},r({},g,y({call:u,notify:c})))}return a({},h)}}}((c=new WeakMap,function(e){if(c.has(e))return c.get(e);var t=new Map;return c.set(e,t),t}),function(e){return function(t){return u(u({},t),{},{connect:function(t){var r=t.call;return i(o.mark(function t(){var n,i,s,a;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=new MessageChannel,i=n.port1,s=n.port2,t.next=1,r("connect",{port:i},[i]);case 1:return a=t.sent,e.set(s,a),t.abrupt("return",s);case 2:case"end":return t.stop()}},t)}))},disconnect:function(t){var r,n=t.call;return r=i(o.mark(function t(r){var i;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(i=e.get(r))){t.next=1;break}throw new Error("The given port is not connected.");case 1:return t.next=2,n("disconnect",{portId:i});case 2:case"end":return t.stop()}},t)})),function(e){return r.apply(this,arguments)}},isSupported:function(e){var t=e.call;return function(){return t("isSupported")}}})}}(new WeakMap),t.generateUniqueNumber,function(e){return"function"==typeof e.start})},"object"==typeof e&&typeof t<"u"?n(e,en(),on(),hn(),fn(),Sn()):"function"==typeof define&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],n):n((r=typeof globalThis<"u"?globalThis:r||self).brokerFactory={},r.fastUniqueNumbers,r._defineProperty,r._slicedToArray,r._asyncToGenerator,r._regeneratorRuntime)}),An=b((e,t)=>{var r,n;v(),pt(),Xe(),r=e,n=function(e,t,r,n){"use strict";var i,o=new Map([[0,null]]),s=new Map([[0,null]]),a=(i=o,function(e){return function(t){"symbol"===n(i.get(t))&&(i.set(t,null),e(t).then(function(){i.delete(t)}))}}),l=function(e){return function(t){return function(r){"symbol"===n(e.get(r))&&(e.set(r,null),t(r).then(function(){e.delete(r)}))}}}(s),u=function(e,t){return function(r){return function(n){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];var l=Symbol(),u=e(t);t.set(u,l);var c=function(){return r(i,u).then(function(){var e=t.get(u);if(void 0===e)throw new Error("The timer is in an undefined state.");e===l&&(n.apply(void 0,s),t.get(u)===l&&c())})};return c(),u}}}(r.generateUniqueNumber,o),c=function(e,t){return function(r){return function(n){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];var l=Symbol(),u=e(t);return t.set(u,l),r(i,u).then(function(){var e=t.get(u);if(void 0===e)throw new Error("The timer is in an undefined state.");e===l&&(t.delete(u),n.apply(void 0,s))}),u}}}(r.generateUniqueNumber,s),h=t.createBroker({clearInterval:function(e){var t=e.call;return a(function(e){return t("clear",{timerId:e,timerType:"interval"})})},clearTimeout:function(e){var t=e.call;return l(function(e){return t("clear",{timerId:e,timerType:"timeout"})})},setInterval:function(e){var t=e.call;return u(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})})},setTimeout:function(e){var t=e.call;return c(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"})})}});e.load=function(e){return h(new Worker(e))},e.wrap=h},"object"==typeof e&&typeof t<"u"?n(e,En(),en(),tn()):"function"==typeof define&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],n):n((r=typeof globalThis<"u"?globalThis:r||self).workerTimersBroker={},r.brokerFactory,r.fastUniqueNumbers,r._typeof)}),In=b((e,t)=>{var r,n;v(),pt(),Xe(),r=e,n=function(e,t){"use strict";var r,n,i,o=(r=t.load,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=null,function(){if(null!==i)return i;var e=new Blob([n],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return i=r(t),setTimeout(function(){return URL.revokeObjectURL(t)}),i});e.clearInterval=function(e){return o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&typeof t<"u"?n(e,An()):"function"==typeof define&&define.amd?define(["exports","worker-timers-broker"],n):n((r=typeof globalThis<"u"?globalThis:r||self).workerTimers={},r.workerTimersBroker)}),kn=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>!!("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),r=()=>typeof navigator<"u"&&"ReactNative"===navigator.product,n=typeof window<"u"&&(typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&_?.versions?!Object.prototype.hasOwnProperty.call(_.versions,"electron"):typeof window.document<"u")||t()||r();e.isWebWorker=t(),e.isReactNativeBrowser=r(),e.default=n}),On=b(e=>{"use strict";v(),pt(),Xe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i});Object.defineProperty(e,"__esModule",{value:!0});var o=In(),s=i(kn()),a={set:o.setInterval,clear:o.clearInterval},l={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return l;case"worker":return a;default:return!s.default||s.isWebWorker||s.isReactNativeBrowser?l:a}}}),xn=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(On());e.default=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,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,r.default)(t),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(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}}}),Pn=b(e=>{"use strict";v(),pt(),Xe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var s=o(dr()),a=er(),l=o(yr()),u=o(lr()),c=i(br()),h=o(mr()),f=o(Yr()),p=o(Jr()),d=o(Xr()),g=_r(),y=Zr(),b=o(xn()),m=i(kn()),w=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,g.nextTick)(()=>{t(...e)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"};e.default=class e extends y.TypedEventEmitter{static VERSION=g.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(t,r){super(),this.options=r||{};for(let e in _)typeof this.options[e]>"u"?this.options[e]=_[e]:this.options[e]=r[e];this.log=this.options.log||(0,u.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),m.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",m.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="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new p.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new h.default,this.incomingStore=r.incomingStore||new h.default,this.queueQoSZero=void 0===r.queueQoSZero||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 d.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),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,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let e=new a.Writable,t=s.default.parser(this.options),r=null,n=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});let i=()=>{this.log("work :: getting next packet in queue");let e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,f.default)(this,e,o);else{this.log("work :: no packets in queue");let e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},o=()=>{if(n.length)(0,g.nextTick)(i);else{let e=r;r=null,e()}};e._write=(e,n,o)=>{r=o,this.log("writable stream :: parsing buffer"),t.parse(e),i()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),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 l={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&&(l.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(l.properties||(l.properties={}),this.topicAliasRecv&&(l.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(l),t.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&&"object"==typeof this.options.authPacket){let e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}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,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};let{qos:o,retain:s,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;let c=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;let c={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,i)=>{this.publish(e,t,r,(e,t)=>{e?i(e):n(t)})})}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let s=c.validateTopics(o);if(null!==s)return w(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};let{properties:l}=t,u=[],h=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),h(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),h(t,e[t])}),!u.length)return r(null,[]),this;let f=(e,t)=>{let r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){let r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}let i=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cb(r,i){if(!r){let{granted:t}=i;for(let r=0;r<t.length;r+=1)e[r].qos=t[r]}r?n(new g.ErrorWithSubackPacket(r.message,i)):t(i)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),i},p=()=>{let e=this.options.subscribeBatchSize??u.length,t=[];for(let r=0;r<u.length;r+=e){let n=u.slice(r,r+e),i=this._nextId();if(null===i)return this.log("No messageId left"),!1;t.push(f(n,i))}return Promise.all(t).then(e=>{r(null,u,e.at(-1))}).catch(e=>{r(e,u,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!p())&&this._storeProcessingQueue.push({invoke:p,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=c.validateTopics(e);if(null!==n)return w(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let i=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),(!r||"function"!=typeof r)&&(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},i=()=>{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,g.nextTick)(n)},t)};return this.disconnecting?(r(),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,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let t=()=>{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 h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),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&&"function"==typeof this.outgoing[e].cb&&(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=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),typeof r>"u")return new Error("Unregistered Topic Alias");e.topic=r}t&&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,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),w(()=>{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(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,l.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,l.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,e=>{if(e)return t&&t(e);r()})):t&&t(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new b.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(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});let o=()=>{if(!r)return;let e,t=r.read(1);t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,r){e&&e(t,r),o()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):r.once("readable",o)};r.on("end",()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),o()};t()}_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,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}}}),Tn=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t=zr();e.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new t.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()}}});var Rn,Cn,jn,Mn=y(()=>{v(),pt(),Xe(),Rn={},Cn=!1,(jn=function(){if(Cn)return Rn;Cn=!0;let e=2147483647,t=36,r=/^xn--/,n=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},s=Math.floor,a=String.fromCharCode;function l(e){throw new RangeError(o[e])}function u(e,t){let r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);let o=function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(i,".")).split("."),t).join(".");return n+o}function c(e){let t=[],r=0,n=e.length;for(;r<n;){let i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){let n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}let h=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},f=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},p=function(e,r,n){let i=0;for(e=n?s(e/700):e>>1,e+=s(e/r);e>455;i+=t)e=s(e/35);return s(i+36*e/(e+38))},d=function(r){let n=[],i=r.length,o=0,a=128,u=72,c=r.lastIndexOf("-");c<0&&(c=0);for(let e=0;e<c;++e)r.charCodeAt(e)>=128&&l("not-basic"),n.push(r.charCodeAt(e));for(let f=c>0?c+1:0;f<i;){let c=o;for(let n=1,a=t;;a+=t){f>=i&&l("invalid-input");let c=h(r.charCodeAt(f++));c>=t&&l("invalid-input"),c>s((e-o)/n)&&l("overflow"),o+=c*n;let p=a<=u?1:a>=u+26?26:a-u;if(c<p)break;let d=t-p;n>s(e/d)&&l("overflow"),n*=d}let d=n.length+1;u=p(o-c,d,0==c),s(o/d)>e-a&&l("overflow"),a+=s(o/d),o%=d,n.splice(o++,0,a)}return String.fromCodePoint(...n)},g=function(r){let n=[],i=(r=c(r)).length,o=128,u=0,h=72;for(let e of r)e<128&&n.push(a(e));let d=n.length,g=d;for(d&&n.push("-");g<i;){let i=e;for(let e of r)e>=o&&e<i&&(i=e);let c=g+1;i-o>s((e-u)/c)&&l("overflow"),u+=(i-o)*c,o=i;for(let y of r)if(y<o&&++u>e&&l("overflow"),y===o){let e=u;for(let r=t;;r+=t){let i=r<=h?1:r>=h+26?26:r-h;if(e<i)break;let o=e-i,l=t-i;n.push(a(f(i+o%l,0))),e=s(o/l)}n.push(a(f(e,0))),h=p(u,c,g===d),u=0,++g}++u,++o}return n.join("")};return Rn={version:"2.3.1",ucs2:{decode:c,encode:e=>String.fromCodePoint(...e)},decode:d,encode:g,toASCII:function(e){return u(e,function(e){return n.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return u(e,function(e){return r.test(e)?d(e.slice(4).toLowerCase()):e})}}}()).decode,jn.encode,jn.toASCII,jn.toUnicode,jn.ucs2,jn.version});function Bn(){return ti||(ti=!0,ei=SyntaxError),ei}function Nn(){return ni||(ni=!0,ri=TypeError),ri}function Un(){if(ai)return si;ai=!0;var e=typeof Symbol<"u"&&Symbol,t=(Vn||(Vn=!0,Hn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),Hn);return si=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}}function Ln(){if(pi)return fi;pi=!0;var e=function(){if(hi)return ci;hi=!0;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};return ci=function(n){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=t(0,i.length-s.length),l=[],u=0;u<a;u++)l[u]="$"+u;if(o=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var e=i.apply(this,r(s,arguments));return Object(e)===e?e:this}return i.apply(n,r(s,arguments))}),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o},ci}();return fi=Function.prototype.bind||e}function Dn(){if(bi)return yi;bi=!0;var e,t=(Kn||(Kn=!0,zn=Error),zn),r=(Qn||(Qn=!0,Gn=EvalError),Gn),n=(Jn||(Jn=!0,Yn=RangeError),Yn),i=(Zn||(Zn=!0,Xn=ReferenceError),Xn),o=Bn(),s=Nn(),a=(oi||(oi=!0,ii=URIError),ii),l=Function,u=function(e){try{return l('"use strict"; return ('+e+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new s},f=c?function(){try{return h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,p=Un()(),d=function(){if(ui)return li;ui=!0;var e={__proto__:null,foo:{}},t=Object;return li=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)}}()(),g=Object.getPrototypeOf||(d?function(e){return e.__proto__}:null),y={},b=typeof Uint8Array>"u"||!g?e:g(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&g?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&g?g(g([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!g?e:g((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!g?e:g((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&g?g(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":b,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(g)try{null.error}catch(R){m["%Error.prototype%"]=g(g(R))}var w=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&g&&(r=g(i.prototype))}return m[t]=r,r},v={__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"]},_=Ln(),S=function(){if(gi)return di;gi=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty;return di=Ln().call(e,t)}(),E=_.call(Function.call,Array.prototype.concat),A=_.call(Function.apply,Array.prototype.splice),I=_.call(Function.call,String.prototype.replace),k=_.call(Function.call,String.prototype.slice),O=_.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,T=function(e,t){var r,n=e;if(S(v,n)&&(n="%"+(r=v[n])[0]+"%"),S(m,n)){var i=m[n];if(i===y&&(i=w(n)),typeof i>"u"&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};return yi=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=k(e,0,1),r=k(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return I(e,x,function(e,t,r,i){n[n.length]=r?I(i,P,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=T("%"+n+"%",t),a=i.name,l=i.value,u=!1,h=i.alias;h&&(n=h[0],A(r,E([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],g=k(d,0,1),y=k(d,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new o("property names with quotes must have matching quotes");if(("constructor"===d||!p)&&(u=!0),S(m,a="%"+(n+="."+d)+"%"))l=m[a];else if(null!=l){if(!(d in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var b=c(l,d);l=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[d]}else p=S(l,d),l=l[d];p&&!u&&(m[a]=l)}}return l},yi}function Fn(){if(wi)return mi;wi=!0;var e=Dn()("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return mi=e}function Wn(){if(_i)return vi;_i=!0;var e=Dn()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return vi=e}function $n(){if(Oi)return ki;Oi=!0;var e=Dn(),t=function(){if(Ei)return Si;Ei=!0;var e=Fn(),t=Bn(),r=Nn(),n=Wn();return Si=function(i,o,s){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!n&&n(i,o);if(e)e(i,o,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:s,writable:null===l&&h?h.writable:!l});else{if(!c&&(a||l||u))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");i[o]=s}},Si}(),r=function(){if(Ii)return Ai;Ii=!0;var e=Fn(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch{return!0}},Ai=t}()(),n=Wn(),i=Nn(),o=e("%Math.floor%");return ki=function(e,s){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&n){var c=n(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},ki}function qn(){if(Ri)return Ti;Ri=!0;var e=Dn(),t=function(){if(Pi)return xi;Pi=!0;var e=Ln(),t=Dn(),r=$n(),n=Nn(),i=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(o,i),a=Fn(),l=t("%Math.max%");xi=function(t){if("function"!=typeof t)throw new n("a function is required");return r(s(e,o,arguments),1+l(0,t.length-(arguments.length-1)),!0)};var u=function(){return s(e,i,arguments)};return a?a(xi,"apply",{value:u}):xi.apply=u,xi}(),r=t(e("String.prototype.indexOf"));return Ti=function(n,i){var o=e(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?t(o):o}}var Hn,Vn,zn,Kn,Gn,Qn,Yn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,ui,ci,hi,fi,pi,di,gi,yi,bi,mi,wi,vi,_i,Si,Ei,Ai,Ii,ki,Oi,xi,Pi,Ti,Ri,Ci=y(()=>{v(),pt(),Xe(),Hn={},Vn=!1,zn={},Kn=!1,Gn={},Qn=!1,Yn={},Jn=!1,Xn={},Zn=!1,ei={},ti=!1,ri={},ni=!1,ii={},oi=!1,si={},ai=!1,li={},ui=!1,ci={},hi=!1,fi={},pi=!1,di={},gi=!1,yi={},bi=!1,mi={},wi=!1,vi={},_i=!1,Si={},Ei=!1,Ai={},Ii=!1,ki={},Oi=!1,xi={},Pi=!1,Ti={},Ri=!1});function ji(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Mi(){!Yi||!Ji||(Yi=!1,Ji.length?Qi=Ji.concat(Qi):Xi=-1,Qi.length&&Bi())}function Bi(){if(!Yi){var e=setTimeout(Mi,0);Yi=!0;for(var t=Qi.length;t;){for(Ji=Qi,Qi=[];++Xi<t;)Ji&&Ji[Xi].run();Xi=-1,t=Qi.length}Ji=null,Yi=!1,clearTimeout(e)}}function Ni(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Qi.push(new Ui(e,t)),1===Qi.length&&!Yi&&setTimeout(Bi,0)}function Ui(e,t){this.fun=e,this.array=t}function Li(){}function Di(e){ji("_linkedBinding")}function Fi(e){ji("dlopen")}function Wi(){return[]}function $i(){return[]}function qi(e,t){if(!e)throw new Error(t||"assertion error")}function Hi(){return!1}function Vi(){return Mo.now()/1e3}function zi(e){var t=Math.floor(.001*(Date.now()-Mo.now())),r=.001*Mo.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=No)),[n,i]}function Ki(){return Uo}function Gi(e){return[]}var Qi,Yi,Ji,Xi,Zi,eo,to,ro,no,io,oo,so,ao,lo,uo,co,ho,fo,po,go,yo,bo,mo,wo,vo,_o,So,Eo,Ao,Io,ko,Oo,xo,Po,To,Ro,Co,jo,Mo,Bo,No,Uo,Lo=y(()=>{v(),pt(),Xe(),Qi=[],Yi=!1,Xi=-1,Ui.prototype.run=function(){this.fun.apply(null,this.array)},Zi={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},eo=["/usr/bin/node"],to=[],ro={},no=function(e,t){console.warn((t?t+": ":"")+e)},io=function(e){ji("binding")},oo=function(e){return 0},so=function(){return"/"},ao=function(e){},lo={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},uo=Li,co=[],ho={},fo={},po=Li,go=Li,bo=yo=function(){return{}},mo=yo,wo=Li,vo=Li,_o=Li,So={},Eo={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Ao=Li,Io=Li,ko=Li,Oo=Li,xo=Li,Po=Li,To=Li,Ro=Li,Co=[],jo=Li,void 0===(Mo={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Bo=Date.now(),Mo.timing&&Mo.timing.navigationStart&&(Bo=Mo.timing.navigationStart),Mo.now=()=>Date.now()-Bo),No=1e9,zi.bigint=function(e){var t=zi(e);return typeof BigInt>"u"?t[0]*No+t[1]:BigInt(t[0]*No)+BigInt(t[1])},Uo={version:"v16.8.0",versions:ro,arch:"x64",platform:"browser",release:lo,_rawDebug:uo,moduleLoadList:co,binding:io,_linkedBinding:Di,_events:{},_eventsCount:0,_maxListeners:10,on:Ki,addListener:Ki,once:Ki,off:Ki,removeListener:Ki,removeAllListeners:Ki,emit:Li,prependListener:Ki,prependOnceListener:Ki,listeners:Gi,domain:ho,_exiting:false,config:fo,dlopen:Fi,uptime:Vi,_getActiveRequests:Wi,_getActiveHandles:$i,reallyExit:po,_kill:go,cpuUsage:yo,resourceUsage:bo,memoryUsage:mo,kill:wo,exit:vo,openStdin:_o,allowedNodeEnvironmentFlags:So,assert:qi,features:Eo,_fatalExceptions:Ao,setUncaughtExceptionCaptureCallback:Io,hasUncaughtExceptionCaptureCallback:Hi,emitWarning:no,nextTick:Ni,_tickCallback:ko,_debugProcess:Oo,_debugEnd:xo,_startProfilerIdleNotifier:Po,_stopProfilerIdleNotifier:To,stdout:void 0,stdin:void 0,stderr:void 0,abort:Ro,umask:oo,chdir:ao,cwd:so,env:Zi,title:"browser",argv:eo,execArgv:to,pid:2,ppid:1,execPath:"/bin/usr/node",debugPort:9229,hrtime:zi,argv0:"node",_preload_modules:Co,setSourceMapsEnabled:jo}});var Do,Fo,Wo,$o=y(()=>{v(),pt(),Xe(),Lo(),Do={},Fo=!1,Wo=function(){if(Fo)return Do;Fo=!0;var e=Uo;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var p="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1===--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Do=n}()}),qo={};function Ho(){if(ts)return es;ts=!0;var e="function"==typeof Map&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&"function"==typeof t.get?t.get:null,n=e&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&"function"==typeof o.get?o.get:null,a=i&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,u="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,c="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,f=Object.prototype.toString,p=Function.prototype.toString,d=String.prototype.match,g=String.prototype.slice,y=String.prototype.replace,b=String.prototype.toUpperCase,m=String.prototype.toLowerCase,w=RegExp.prototype.test,v=Array.prototype.concat,_=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,x="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-E(-e):E(e);if(n!==e){var i=String(n),o=g.call(t,i.length+1);return y.call(i,r,"$&_")+"."+y.call(y.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(t,r,"$&_")}var C=Zo,j=C.custom,M=D(j)?j:null;function B(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function N(e){return y.call(String(e),/"/g,""")}function U(e){return!("[object Array]"!==$(e)||x&&"object"==typeof e&&x in e)}function L(e){return!("[object RegExp]"!==$(e)||x&&"object"==typeof e&&x in e)}function D(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch{}return!1}es=function e(t,i,o,f){var b=i||{};if(W(b,"quoteStyle")&&"single"!==b.quoteStyle&&"double"!==b.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(b,"maxStringLength")&&("number"==typeof b.maxStringLength?b.maxStringLength<0&&b.maxStringLength!==1/0:null!==b.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var w=!W(b,"customInspect")||b.customInspect;if("boolean"!=typeof w&&"symbol"!==w)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(b,"indent")&&null!==b.indent&&"\t"!==b.indent&&!(parseInt(b.indent,10)===b.indent&&b.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(b,"numericSeparator")&&"boolean"!=typeof b.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=b.numericSeparator;if(typeof t>"u")return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return H(t,b);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var I=String(t);return E?R(t,I):I}if("bigint"==typeof t){var j=String(t)+"n";return E?R(t,j):j}var F=typeof b.depth>"u"?5:b.depth;if(typeof o>"u"&&(o=0),o>=F&&F>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var V=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=_.call(Array(e.indent+1)," ")}return{base:r,prev:_.call(Array(t+1),r)}}(b,o);if(typeof f>"u")f=[];else if(q(f,t)>=0)return"[Circular]";function J(t,r,n){if(r&&(f=S.call(f)).push(r),n){var i={depth:b.depth};return W(b,"quoteStyle")&&(i.quoteStyle=b.quoteStyle),e(t,i,o+1,f)}return e(t,b,o+1,f)}if("function"==typeof t&&!L(t)){var X=function(e){if(e.name)return e.name;var t=d.call(p.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Z=Y(t,J);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(Z.length>0?" { "+_.call(Z,", ")+" }":"")}if(D(t)){var ee=O?y.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(t);return"object"!=typeof t||O?ee:z(ee)}if(function(e){return!(!e||"object"!=typeof e)&&(typeof HTMLElement<"u"&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(t)){for(var te="<"+m.call(String(t.nodeName)),re=t.attributes||[],ne=0;ne<re.length;ne++)te+=" "+re[ne].name+"="+B(N(re[ne].value),"double",b);return te+=">",t.childNodes&&t.childNodes.length&&(te+="..."),te+="</"+m.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var ie=Y(t,J);return V&&!function(e){for(var t=0;t<e.length;t++)if(q(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Q(ie,V)+"]":"[ "+_.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==$(e)||x&&"object"==typeof e&&x in e)}(t)){var oe=Y(t,J);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===oe.length?"["+String(t)+"]":"{ ["+String(t)+"] "+_.call(oe,", ")+" }":"{ ["+String(t)+"] "+_.call(v.call("[cause]: "+J(t.cause),oe),", ")+" }"}if("object"==typeof t&&w){if(M&&"function"==typeof t[M]&&C)return C(t,{depth:F-o});if("symbol"!==w&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!r||!e||"object"!=typeof e)return!1;try{r.call(e);try{s.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}(t)){var se=[];return n&&n.call(t,function(e,r){se.push(J(r,t,!0)+" => "+J(e,t))}),G("Map",r.call(t),se,V)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{r.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}(t)){var ae=[];return a&&a.call(t,function(e){ae.push(J(e,t))}),G("Set",s.call(t),ae,V)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{u.call(e,u)}catch{return!0}return e instanceof WeakMap}catch{}return!1}(t))return K("WeakMap");if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e,u);try{l.call(e,l)}catch{return!0}return e instanceof WeakSet}catch{}return!1}(t))return K("WeakSet");if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{return c.call(e),!0}catch{}return!1}(t))return K("WeakRef");if(function(e){return!("[object Number]"!==$(e)||x&&"object"==typeof e&&x in e)}(t))return z(J(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch{}return!1}(t))return z(J(A.call(t)));if(function(e){return!("[object Boolean]"!==$(e)||x&&"object"==typeof e&&x in e)}(t))return z(h.call(t));if(function(e){return!("[object String]"!==$(e)||x&&"object"==typeof e&&x in e)}(t))return z(J(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof rs<"u"&&t===rs)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==$(e)||x&&"object"==typeof e&&x in e)}(t)&&!L(t)){var le=Y(t,J),ue=T?T(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",he=!ue&&x&&Object(t)===t&&x in t?g.call($(t),8,-1):ce?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||ce?"["+_.call(v.call([],he||[],ce||[]),": ")+"] ":"");return 0===le.length?fe+"{}":V?fe+"{"+Q(le,V)+"}":fe+"{ "+_.call(le,", ")+" }"}return String(t)};var F=Object.prototype.hasOwnProperty||function(e){return e in(this||rs)};function W(e,t){return F.call(e,t)}function $(e){return f.call(e)}function q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function H(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(g.call(e,0,t.maxStringLength),t)+n}return B(y.call(y.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,V),"single",t)}function V(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function z(e){return"Object("+e+")"}function K(e){return e+" { ? }"}function G(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):_.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+_.call(e,","+r)+"\n"+t.prev}function Y(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=W(e,i)?t(e[i],e):""}var o,s="function"==typeof I?I(e):[];if(O){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)W(e,l)&&(r&&String(Number(l))===l&&l<e.length||O&&o["$"+l]instanceof Symbol||(w.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof I)for(var u=0;u<s.length;u++)P.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}return es}function Vo(){if(is)return ns;is=!0;var e=Dn(),t=qn(),r=Ho(),n=Nn(),i=e("%WeakMap%",!0),o=e("%Map%",!0),s=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),h=t("Map.prototype.has",!0),f=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};return ns=function(){var e,t,p,d={assert:function(e){if(!d.has(e))throw new n("Side channel does not contain "+r(e))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return s(e,r)}else if(o){if(t)return u(t,r)}else if(p)return function(e,t){var r=f(e,t);return r&&r.value}(p,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(o){if(t)return h(t,r)}else if(p)return function(e,t){return!!f(e,t)}(p,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new i),a(e,r,n)):o?(t||(t=new o),c(t,r,n)):(p||(p={key:{},next:null}),function(e,t,r){var n=f(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(p,r,n))}};return d}}function zo(){if(ss)return os;ss=!0;var e=String.prototype.replace,t=/%20/g,r="RFC3986";return os={default:r,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}}function Ko(){if(ls)return as;ls=!0;var e=zo(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(r[n]=e[n]);return r},o=1024;return as={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var o=t[i],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var u=a[l],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:s,prop:u}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);t.obj[t.prop]=i}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},encode:function(t,r,i,s,a){if(0===t.length)return t;var l=t;if("symbol"==typeof t?l=Symbol.prototype.toString.call(t):"string"!=typeof t&&(l=String(t)),"iso-8859-1"===i)return escape(l).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var u="",c=0;c<l.length;c+=o){for(var h=l.length>=o?l.slice(c,c+o):l,f=[],p=0;p<h.length;++p){var d=h.charCodeAt(p);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===e.RFC1738&&(40===d||41===d)?f[f.length]=h.charAt(p):d<128?f[f.length]=n[d]:d<2048?f[f.length]=n[192|d>>6]+n[128|63&d]:d<55296||d>=57344?f[f.length]=n[224|d>>12]+n[128|d>>6&63]+n[128|63&d]:(p+=1,d=65536+((1023&d)<<10|1023&h.charCodeAt(p)),f[f.length]=n[240|d>>18]+n[128|d>>12&63]+n[128|d>>6&63]+n[128|63&d])}u+=f.join("")}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},merge:function e(n,o,s){if(!o)return n;if("object"!=typeof o){if(r(n))n.push(o);else{if(!n||"object"!=typeof n)return[n,o];(s&&(s.plainObjects||s.allowPrototypes)||!t.call(Object.prototype,o))&&(n[o]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(o);var a=n;return r(n)&&!r(o)&&(a=i(n,s)),r(n)&&r(o)?(o.forEach(function(r,i){if(t.call(n,i)){var o=n[i];o&&"object"==typeof o&&r&&"object"==typeof r?n[i]=e(o,r,s):n.push(r)}else n[i]=r}),n):Object.keys(o).reduce(function(r,n){var i=o[n];return t.call(r,n)?r[n]=e(r[n],i,s):r[n]=i,r},a)}}}function Go(){if(cs)return us;cs=!0;var e=Vo(),t=Ko(),r=zo(),n=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Array.isArray,s=Array.prototype.push,a=function(e,t){s.apply(e,o(t)?t:[t])},l=Date.prototype.toISOString,u=r.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:u,formatter:r.formatters[u],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},h={},f=function r(n,i,s,l,u,f,p,d,g,y,b,m,w,v,_,S,E,A){for(var I=n,k=A,O=0,x=!1;void 0!==(k=k.get(h))&&!x;){var P=k.get(n);if(O+=1,typeof P<"u"){if(P===O)throw new RangeError("Cyclic object value");x=!0}typeof k.get(h)>"u"&&(O=0)}if("function"==typeof y?I=y(i,I):I instanceof Date?I=w(I):"comma"===s&&o(I)&&(I=t.maybeMap(I,function(e){return e instanceof Date?w(e):e})),null===I){if(f)return g&&!S?g(i,c.encoder,E,"key",v):i;I=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(I)||t.isBuffer(I))return g?[_(S?i:g(i,c.encoder,E,"key",v))+"="+_(g(I,c.encoder,E,"value",v))]:[_(i)+"="+_(String(I))];var T,R=[];if(typeof I>"u")return R;if("comma"===s&&o(I))S&&g&&(I=t.maybeMap(I,g)),T=[{value:I.length>0?I.join(",")||null:void 0}];else if(o(y))T=y;else{var C=Object.keys(I);T=b?C.sort(b):C}var j=d?i.replace(/\./g,"%2E"):i,M=l&&o(I)&&1===I.length?j+"[]":j;if(u&&o(I)&&0===I.length)return M+"[]";for(var B=0;B<T.length;++B){var N=T[B],U="object"==typeof N&&typeof N.value<"u"?N.value:I[N];if(!p||null!==U){var L=m&&d?N.replace(/\./g,"%2E"):N,D=o(I)?"function"==typeof s?s(M,L):M:M+(m?"."+L:"["+L+"]");A.set(n,O);var F=e();F.set(h,A),a(R,r(U,D,s,l,u,f,p,d,"comma"===s&&S&&o(I)?null:g,y,b,m,w,v,_,S,E,F))}}return R};return us=function(t,s){var l,u=t,h=function(e){if(!e)return c;if(typeof e.allowEmptyArrays<"u"&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&typeof e.encoder<"u"&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||c.charset;if(typeof e.charset<"u"&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=r.default;if(typeof e.format<"u"){if(!n.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");s=e.format}var a,l=r.formatters[s],u=c.filter;if(("function"==typeof e.filter||o(e.filter))&&(u=e.filter),a=e.arrayFormat in i?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":c.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=typeof e.allowDots>"u"?!0===e.encodeDotInKeys||c.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:c.addQueryPrefix,allowDots:h,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?c.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:c.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:c.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:c.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:c.encodeValuesOnly,filter:u,format:s,formatter:l,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:c.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:c.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:c.strictNullHandling}}(s);"function"==typeof h.filter?u=(0,h.filter)("",u):o(h.filter)&&(l=h.filter);var p=[];if("object"!=typeof u||null===u)return"";var d=i[h.arrayFormat],g="comma"===d&&h.commaRoundTrip;l||(l=Object.keys(u)),h.sort&&l.sort(h.sort);for(var y=e(),b=0;b<l.length;++b){var m=l[b];h.skipNulls&&null===u[m]||a(p,f(u[m],m,d,g,h.allowEmptyArrays,h.strictNullHandling,h.skipNulls,h.encodeDotInKeys,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,y))}var w=p.join(h.delimiter),v=!0===h.addQueryPrefix?"?":"";return h.charsetSentinel&&("iso-8859-1"===h.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}}function Qo(){if(fs)return hs;fs=!0;var e=Ko(),t=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:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},o=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(s),u=l?s.slice(0,l.index):s,c=[];if(u){if(!n.plainObjects&&t.call(Object.prototype,u)&&!n.allowPrototypes)return;c.push(u)}for(var h=0;n.depth>0&&null!==(l=a.exec(s))&&h<n.depth;){if(h+=1,!n.plainObjects&&t.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}if(l){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");c.push("["+s.slice(l.index)+"]")}return function(e,t,r,n){for(var i=n?t:o(t,r),s=e.length-1;s>=0;--s){var a,l=e[s];if("[]"===l&&r.parseArrays)a=r.allowEmptyArrays&&(""===i||r.strictNullHandling&&null===i)?[]:[].concat(i);else{a=r.plainObjects?Object.create(null):{};var u="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,h=parseInt(c,10);r.parseArrays||""!==c?!isNaN(h)&&l!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[])[h]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i}(c,r,n,i)}};return hs=function(a,l){var u=function(t){if(!t)return n;if(typeof t.allowEmptyArrays<"u"&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&typeof t.decoder<"u"&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?n.charset:t.charset,i=typeof t.duplicates>"u"?n.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:typeof t.allowDots>"u"?!0===t.decodeDotInKeys||n.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:n.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:n.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:n.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:n.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:n.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:n.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:n.decoder,delimiter:"string"==typeof t.delimiter||e.isRegExp(t.delimiter)?t.delimiter:n.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:n.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:n.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:n.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:n.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:n.strictNullHandling}}(l);if(""===a||null===a||typeof a>"u")return u.plainObjects?Object.create(null):{};for(var c="string"==typeof a?function(s,a){var l={__proto__:null},u=a.ignoreQueryPrefix?s.replace(/^\?/,""):s;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c,h=a.parameterLimit===1/0?void 0:a.parameterLimit,f=u.split(a.delimiter,h),p=-1,d=a.charset;if(a.charsetSentinel)for(c=0;c<f.length;++c)0===f[c].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[c]?d="utf-8":"utf8=%26%2310003%3B"===f[c]&&(d="iso-8859-1"),p=c,c=f.length);for(c=0;c<f.length;++c)if(c!==p){var g,y,b=f[c],m=b.indexOf("]="),w=-1===m?b.indexOf("="):m+1;-1===w?(g=a.decoder(b,n.decoder,d,"key"),y=a.strictNullHandling?null:""):(g=a.decoder(b.slice(0,w),n.decoder,d,"key"),y=e.maybeMap(o(b.slice(w+1),a),function(e){return a.decoder(e,n.decoder,d,"value")})),y&&a.interpretNumericEntities&&"iso-8859-1"===d&&(y=i(y)),b.indexOf("[]=")>-1&&(y=r(y)?[y]:y);var v=t.call(l,g);v&&"combine"===a.duplicates?l[g]=e.combine(l[g],y):(!v||"last"===a.duplicates)&&(l[g]=y)}return l}(a,u):a,h=u.plainObjects?Object.create(null):{},f=Object.keys(c),p=0;p<f.length;++p){var d=f[p],g=s(d,c[d],u,"string"==typeof a);h=e.merge(h,g,u)}return!0===u.allowSparse?h:e.compact(h)}}function Yo(){if(ys)return gs;ys=!0;var e=jn;function t(){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]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),s=["'"].concat(o),a=["%","/","?",";","#"].concat(s),l=["/","?","#"],u=/^[+a-z0-9A-Z_-]{0,63}$/,c=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},d=function(){if(ds)return ps;ds=!0;var e=Go(),t=Qo();return ps={formats:zo(),parse:t,stringify:e}}();function g(e,r,n){if(e&&"object"==typeof e&&e instanceof t)return e;var i=new t;return i.parse(e,r,n),i}return t.prototype.parse=function(t,n,o){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var g=t.indexOf("?"),y=-1!==g&&g<t.indexOf("#")?"?":"#",b=t.split(y);b[0]=b[0].replace(/\\/g,"/");var m=t=b.join(y);if(m=m.trim(),!o&&1===t.split("#").length){var w=i.exec(m);if(w)return this.path=m,this.href=m,this.pathname=w[1],w[2]?(this.search=w[2],this.query=n?d.parse(this.search.substr(1)):this.search.substr(1)):n&&(this.search="",this.query={}),this}var v=r.exec(m);if(v){var _=(v=v[0]).toLowerCase();this.protocol=_,m=m.substr(v.length)}if(o||v||m.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===m.substr(0,2);S&&(!v||!f[v])&&(m=m.substr(2),this.slashes=!0)}if(!f[v]&&(S||v&&!p[v])){for(var E=-1,A=0;A<l.length;A++){-1!==(O=m.indexOf(l[A]))&&(-1===E||O<E)&&(E=O)}var I,k;-1!==(k=-1===E?m.lastIndexOf("@"):m.lastIndexOf("@",E))&&(I=m.slice(0,k),m=m.slice(k+1),this.auth=decodeURIComponent(I)),E=-1;for(A=0;A<a.length;A++){var O;-1!==(O=m.indexOf(a[A]))&&(-1===E||O<E)&&(E=O)}-1===E&&(E=m.length),this.host=m.slice(0,E),m=m.slice(E),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var P=this.hostname.split(/\./),T=(A=0,P.length);A<T;A++){var R=P[A];if(R&&!R.match(u)){for(var C="",j=0,M=R.length;j<M;j++)R.charCodeAt(j)>127?C+="x":C+=R[j];if(!C.match(u)){var B=P.slice(0,A),N=P.slice(A+1),U=R.match(c);U&&(B.push(U[1]),N.unshift(U[2])),N.length&&(m="/"+N.join(".")+m),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=e.toASCII(this.hostname));var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!h[_])for(A=0,T=s.length;A<T;A++){var F=s[A];if(-1!==m.indexOf(F)){var W=encodeURIComponent(F);W===F&&(W=escape(F)),m=m.split(F).join(W)}}var $=m.indexOf("#");-1!==$&&(this.hash=m.substr($),m=m.slice(0,$));var q=m.indexOf("?");if(-1!==q?(this.search=m.substr(q),this.query=m.substr(q+1),n&&(this.query=d.parse(this.query)),m=m.slice(0,q)):n&&(this.search="",this.query={}),m&&(this.pathname=m),p[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var H=this.search||"";this.path=L+H}return this.href=this.format(),this},t.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=d.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||p[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},t.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},t.prototype.resolveObject=function(e){if("string"==typeof e){var r=new t;r.parse(e,!1,!0),e=r}for(var n=new t,i=Object.keys(this),o=0;o<i.length;o++){var s=i[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var u=a[l];"protocol"!==u&&(n[u]=e[u])}return p[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!p[e.protocol]){for(var c=Object.keys(e),h=0;h<c.length;h++){var d=c[h];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||f[e.protocol])n.pathname=e.pathname;else{for(var g=(e.pathname||"").split("/");g.length&&!(e.host=g.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==g[0]&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}return n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,(n.pathname||n.search)&&(n.path=(n.pathname||"")+(n.search||"")),n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),m=b||y||n.host&&e.pathname,w=m,v=n.pathname&&n.pathname.split("/")||[],_=(g=e.pathname&&e.pathname.split("/")||[],n.protocol&&!p[n.protocol]);if(_&&(n.hostname="",n.port=null,n.host&&(""===v[0]?v[0]=n.host:v.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===g[0]?g[0]=e.host:g.unshift(e.host)),e.host=null),m=m&&(""===g[0]||""===v[0])),b)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,v=g;else if(g.length)v||(v=[]),v.pop(),v=v.concat(g),n.search=e.search,n.query=e.query;else if(null!=e.search){if(_)n.host=v.shift(),n.hostname=n.host,(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname);return n.search=e.search,n.query=e.query,(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!v.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=v.slice(-1)[0],E=(n.host||e.host||v.length>1)&&("."===S||".."===S)||""===S,A=0,I=v.length;I>=0;I--)"."===(S=v[I])?v.splice(I,1):".."===S?(v.splice(I,1),A++):A&&(v.splice(I,1),A--);if(!m&&!w)for(;A--;)v.unshift("..");m&&""!==v[0]&&(!v[0]||"/"!==v[0].charAt(0))&&v.unshift(""),E&&"/"!==v.join("/").substr(-1)&&v.push("");var k,O=""===v[0]||v[0]&&"/"===v[0].charAt(0);_&&(n.hostname=O?"":v.length?v.shift():"",n.host=n.hostname,(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname));return(m=m||n.host&&v.length)&&!O&&v.unshift(""),v.length>0?n.pathname=v.join("/"):(n.pathname=null,n.path=null),(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},t.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},gs.parse=g,gs.resolve=function(e,t){return g(e,!1,!0).resolve(t)},gs.resolveObject=function(e,t){return e?g(e,!1,!0).resolveObject(t):t},gs.format=function(e){return"string"==typeof e&&(e=g(e)),e instanceof t?e.format():t.prototype.format.call(e)},gs.Url=t,gs}function Jo(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return Ps?function(e){let t=e.hostname,r=e.pathname;for(let n=0;n<r.length;n++)if("%"===r[n]){let e=r.codePointAt(n+2)||32;if("2"===r[n+1]&&102===e||"5"===r[n+1]&&99===e)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Ts,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<Os||e>xs||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let r=0;r<t.length;r++)if("%"===t[r]){let e=t.codePointAt(r+2)||32;if("2"===t[r+1]&&102===e)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function Xo(e){let t=Wo.resolve(e),r=e.charCodeAt(e.length-1);(r===ks||Ps&&r===Is)&&t[t.length-1]!==Wo.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Rs,"%25")),!Ps&&t.includes("\\")&&(t=t.replace(Cs,"%5C")),t.includes("\n")&&(t=t.replace(js,"%0A")),t.includes("\r")&&(t=t.replace(Ms,"%0D")),t.includes("\t")&&(t=t.replace(Bs,"%09")),n.pathname=t,n}m(qo,{URL:()=>As,Url:()=>ws,default:()=>bs,fileURLToPath:()=>Jo,format:()=>vs,parse:()=>Es,pathToFileURL:()=>Xo,resolve:()=>_s,resolveObject:()=>Ss});var Zo,es,ts,rs,ns,is,os,ss,as,ls,us,cs,hs,fs,ps,ds,gs,ys,bs,ms,ws,vs,_s,Ss,Es,As,Is,ks,Os,xs,Ps,Ts,Rs,Cs,js,Ms,Bs,Ns=y(()=>{v(),pt(),Xe(),Mn(),Ci(),$o(),Lo(),Zo=Object.freeze(Object.create(null)),es={},ts=!1,rs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,ns={},is=!1,os={},ss=!1,as={},ls=!1,us={},cs=!1,hs={},fs=!1,ps={},ds=!1,gs={},ys=!1,(bs=Yo()).parse,bs.resolve,bs.resolveObject,bs.format,bs.Url,ms=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,bs.URL=typeof URL<"u"?URL:null,bs.pathToFileURL=Xo,bs.fileURLToPath=Jo,ws=bs.Url,vs=bs.format,_s=bs.resolve,Ss=bs.resolveObject,Es=bs.parse,As=bs.URL,Is=92,ks=47,Os=97,xs=122,Ps="win32"===ms,Ts=/\//g,Rs=/%/g,Cs=/\\/g,js=/\n/g,Ms=/\r/g,Bs=/\t/g}),Us=b((e,t)=>{"use strict";v(),pt(),Xe(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Ls=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=n;var t=er(),r=(ft(),w(at));function n(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)"string"==typeof e[i].chunk?n[i]=r.Buffer.from(e[i].chunk,"utf8"):n[i]=e[i].chunk;this._write(r.Buffer.concat(n),"binary",t)}var i=class extends t.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=i}),Ds=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=(ft(),w(at)),n=t(Us()),i=t(lr()),o=er(),s=t(kn()),a=Ls(),l=(0,i.default)("mqttjs:ws"),u=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function h(e){let t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!s.default&&!e.forceNativeWebSocket&&"wss"===e.protocol&&u.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}e.streamBuilder=(e,t)=>{l("streamBuilder");let r=h(t);r.hostname=r.hostname||r.host||"localhost";let i=c(r,e),o=function(e,t,r){l("createWebSocket"),l(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i,o="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return l(`creating new Websocket for url: ${t} and protocol: ${o}`),i=r.createWebsocket?r.createWebsocket(t,[o],r):new n.default(t,[o],r.wsOptions),i}(0,i,r),s=n.default.createWebSocketStream(o,r.wsOptions);return s.url=i,o.on("close",()=>{s.destroy()}),s};e.browserStreamBuilder=(e,t)=>{l("browserStreamBuilder");let n,i=function(e){let t=h(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,s=t.browserBufferTimeout||1e3,u=!t.objectMode,f=function(e,t){let r,n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",i=c(t,e);return r=t.createWebsocket?t.createWebsocket(i,[n],t):new WebSocket(i,[n]),r.binaryType="arraybuffer",r}(e,t),p=function(e,t,r){let n=new o.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,function e(t,n,o){if(f.bufferedAmount>i)return void setTimeout(e,s,t,n,o);u&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{f.send(t)}catch(a){return o(a)}o()},function(e){f.close(),e()});t.objectMode||(p._writev=a.writev.bind(p)),p.on("close",()=>{f.close()});let d=typeof f.addEventListener<"u";function g(){l("WebSocket onOpen"),n instanceof a.BufferedDuplex&&n.socketReady()}function y(e){l("WebSocket onClose",e),n.end(),n.destroy()}function b(e){l("WebSocket onError",e);let t=new Error("WebSocket error");t.event=e,n.destroy(t)}async function m(e){if(!p||!p.readable||!p.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?r.Buffer.from(t):t instanceof Blob?r.Buffer.from(await new Response(t).arrayBuffer()):r.Buffer.from(t,"utf8"),p.push(t)}return f.readyState===f.OPEN?(n=p,n.socket=f):(n=new a.BufferedDuplex(t,p,f),d?f.addEventListener("open",g):f.onopen=g),d?(f.addEventListener("close",y),f.addEventListener("error",b),f.addEventListener("message",m)):(f.onclose=y,f.onerror=b,f.onmessage=m),n}}),Fs={};function Ws(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}m(Fs,{Server:()=>Ws,Socket:()=>Ws,Stream:()=>Ws,_createServerHandle:()=>Ws,_normalizeArgs:()=>Ws,_setSimultaneousAccepts:()=>Ws,connect:()=>Ws,createConnection:()=>Ws,createServer:()=>Ws,default:()=>$s,isIP:()=>Ws,isIPv4:()=>Ws,isIPv6:()=>Ws});var $s,qs=y(()=>{v(),pt(),Xe(),$s={_createServerHandle:Ws,_normalizeArgs:Ws,_setSimultaneousAccepts:Ws,connect:Ws,createConnection:Ws,createServer:Ws,isIP:Ws,isIPv4:Ws,isIPv6:Ws,Server:Ws,Socket:Ws,Stream:Ws}}),Hs=b((e,t)=>{v(),pt(),Xe(),t.exports={}}),Vs=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((qs(),w(Fs))),n=t(lr()),i=t(Hs()),o=(0,n.default)("mqttjs:tcp");e.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,i.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});let{port:n,path:s}=t,a=t.hostname;return o("port %d and host %s",n,a),r.default.createConnection({port:n,host:a,path:s})}}),zs={};m(zs,{default:()=>Ks});var Ks,Gs=y(()=>{v(),pt(),Xe(),Ks={}}),Qs=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(Gs(),w(zs)),n=t((qs(),w(Fs))),i=t(lr()),o=t(Hs()),s=(0,i.default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,s("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let i=function(e){let{host:t,port:n,socksProxy:i,...s}=e;if(void 0!==i){let a=(0,o.default)(t,n,i,{timeout:e.socksTimeout});return(0,r.connect)({...s,socket:a})}return(0,r.connect)(e)}(t);function a(r){t.rejectUnauthorized&&e.emit("error",r),i.end()}return i.on("secureConnect",()=>{t.rejectUnauthorized&&!i.authorized?i.emit("error",new Error("TLS not authorized")):i.removeListener("error",a)}),i.on("error",a),i}}),Ys=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(ft(),w(at)),o=er(),s=Ls();e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let u=function(e,t){let r="wxs"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);t=wx.connectSocket({url:u,protocols:[l]}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(new Error(e))}})},e._flush=e=>{t.close({success(){e()}})},e}(),(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let c=n.destroy;return n.destroy=(e,r)=>(n.destroy=c,setTimeout(()=>{t.close({fail(){n._destroy(e,r)}})},0),n),t.onOpen(()=>{n.socketReady()}),t.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)}),t.onClose(()=>{n.emit("close"),n.end(),n.destroy()}),t.onError(e=>{let t=new Error(e.errMsg);n.destroy(t)}),n}}),Js=b(e=>{"use strict";v(),pt(),Xe(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(ft(),w(at)),o=er(),s=Ls(),a=!1;e.default=(e,l)=>{if(l.hostname=l.hostname||l.host,!l.hostname)throw new Error("Could not determine host. Specify host manually.");let u="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(l);let c=function(e,t){let r="alis"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(l,e);return(t=l.my).connectSocket({url:c,protocols:u}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},e._flush=e=>{t.closeSocket({success(){e()}})},e}(),n=new s.BufferedDuplex(l,r,t),a||(a=!0,t.onSocketOpen(()=>{n.socketReady()}),t.onSocketMessage(e=>{if("string"==typeof e.data){let t=i.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?r.push(i.Buffer.from(t.result)):r.push(i.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),t.onSocketClose(()=>{n.end(),n.destroy()}),t.onSocketError(e=>{n.destroy(e)})),n}}),Xs=b(e=>{"use strict";v(),pt(),Xe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=function(e,t,r=!0){return new Promise((n,i)=>{let o=l(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach(e=>{o.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{o.on(e,s[e])})})};var r=t(lr()),n=t((Ns(),w(qo))),i=t(Pn()),o=t(kn());"function"!=typeof _?.nextTick&&(_.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),a=null;function l(e,t){if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){let r=n.default.parse(e,!0),i={};if(null!=r.port&&(i.port=Number(r.port)),i.host=r.hostname,i.query=r.query,i.auth=r.auth,i.protocol=r.protocol,i.path=r.path,!(t={...i,...t}).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):!t.protocol?.startsWith("ws")&&!t.protocol?.startsWith("wx")&&delete t.path,function(e){let t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/),t){let[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),o.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&typeof _<"u"&&(t.socksProxy=_.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(a||(a={},o.default||t.forceNativeWebSocket?(a.ws=Ds().browserStreamBuilder,a.wss=Ds().browserStreamBuilder,a.wx=Ys().default,a.wxs=Ys().default,a.ali=Js().default,a.alis=Js().default):(a.ws=Ds().streamBuilder,a.wss=Ds().streamBuilder,a.mqtt=Vs().default,a.tcp=Vs().default,a.ssl=Qs().default,a.tls=a.ssl,a.mqtts=Qs().default)),!a[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof a[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let r=new i.default(function(e){return t.servers&&((!e._reconnectCount||e._reconnectCount===t.servers.length)&&(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),s("calling streambuilder for",t.protocol),a[t.protocol](e,t)},t);return r.on("error",()=>{}),r}e.default=l}),Zs=b(e=>{"use strict";v(),pt(),Xe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)},s=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var a=s(Pn());e.MqttClient=a.default,e.DefaultMessageIdProvider=s(Jr()).default,e.UniqueMessageIdProvider=s(Tn()).default,e.Store=s(mr()).default;var l=i(Xs());e.connect=l.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return l.connectAsync}}),e.KeepaliveManager=s(xn()).default,e.Client=a.default,o(Pn(),e),o(_r(),e),o(br(),e);var u=Sr();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return u.ReasonCodes}})}),ea=b(e=>{v(),pt(),Xe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.default=i(Zs()),o(Zs(),e)})(),ta=t.from_html('<div class="super-mqtt-test svelte-1l9u2si"><span> </span> <span> </span></div>'),ra=t.from_html('<div class="super-mqtt svelte-1l9u2si"><div class="super-mqtt-status svelte-1l9u2si"><span> </span> <span> </span></div> <button class="spectrum-Button spectrum-Button--fill spectrum-Button--accent spectrum-Button--sizeM">Test</button> <!></div>'),na=t.from_html("<span> </span>"),ia=t.from_html('<div><i class="ri-plug-fill"></i> <!></div>'),oa=t.from_html("<div><!> <!></div>");function sa(e,n){t.push(n,!0);const[i,o]=t.setup_stores();let s=t.prop(n,"protocol",3,"wss"),a=t.prop(n,"keepAlive",3,60),l=t.prop(n,"maxReconnect",3,10),u=t.prop(n,"topic",3,"mqtt"),c=t.prop(n,"jsonMessage",3,!1),h=t.prop(n,"showTest",3,!1),f=t.prop(n,"showStatus",3,!0);const{styleable:p,builderStore:d,Provider:g}=(0,r.getContext)("sdk"),y=(0,r.getContext)("component");let b=t.state(void 0),m=t.state("Offline"),w=t.state("Not Subscribed"),v=t.state(void 0),_=t.state(void 0),S=t.state(void 0),E=t.state(void 0),A=t.state(void 0),I=t.state(0),k=t.derived(()=>t.store_get(d,"$builderStore",i)?.inBuilder),O=t.derived(()=>`${s()}://${n.host}`);const x=e=>String(e??"").split(",").map(e=>e.trim()).filter(e=>e.length>0),P=()=>{t.set(_,"Posting..."),t.set(S,"Waiting to receive...");const e=x(u())[0];e&&t.get(v)?.publish(e,JSON.stringify({Budibase:"is awesome !"}),e=>{e||t.set(_,"Posted Successfully - "+(new Date).toUTCString())})},T=()=>{t.get(v)&&(t.get(v).end(),t.set(v,void 0)),t.set(b,void 0)},R=()=>{if(T(),u())try{t.set(v,ea.connect(t.get(O),(()=>{const e={clean:!0,connectTimeout:4e3,keepAlive:a()};return n.clientId&&(e.clientId=n.clientId),n.username&&(e.username=n.username),n.password&&(e.password=n.password),e})()),!0),t.set(m,"Connecting"),t.get(v).on("connect",()=>{t.set(m,"Connected"),t.set(b,!0),t.set(I,0),n.onConnect?.();const e=x(u());e.length>0&&t.get(v).subscribe(e,r=>{r||t.set(w,`Subscribed to ${e.length} topic(s)`)})}),t.get(v).on("message",(e,r)=>{if(t.set(A,new Date,!0),t.get(_)&&t.set(S,"Received Successfully - "+(new Date).toUTCString()),c())try{const e=r?.toString();t.set(E,JSON.parse(e??"{}"),!0)}catch{t.set(E,{},!0)}else t.set(E,r?.toString(),!0);n.onMessage?.({topic:e,message:t.get(E)})}),t.get(v).on("reconnect",()=>{t.update(I),t.get(I)>=l()?(t.set(m,"Error: Max reconnection attempts reached"),T(),t.set(b,!1),n.onDisconnect?.()):(n.onDisconnect?.(),t.set(m,`Reconnecting (${t.get(I)}/${l()})`))}),t.get(v).on("error",e=>{t.update(I),t.get(I)>=l()?(t.set(m,"Error: Max reconnection attempts reached"),T(),t.set(b,!1)):t.set(m,`Connection error: ${e.message}`)})}catch(e){t.set(m,"Error: "+e.message)}else t.set(m,"Invalid Topic")};t.user_effect(()=>{n.host,s(),u(),a(),n.username,n.password,n.clientId,l(),(0,r.untrack)(()=>{t.set(I,0),R()})}),(0,r.onDestroy)(()=>{t.get(b)&&n.onDisconnect?.(),T()});var C=oa(),j=t.child(C);{let e=t.derived(()=>({lastMessage:t.get(E),at:t.get(A),connected:t.get(b),status:t.get(m)}));g(j,{get data(){return t.get(e)}})}var M=t.sibling(j,2),B=e=>{var r=ra(),i=t.child(r),o=t.child(i);let s;var a=t.child(o);t.reset(o);var l=t.sibling(o,2),c=t.child(l);t.reset(l),t.reset(i);var h=t.sibling(i,2),f=t.sibling(h,2),p=e=>{var r=ta(),n=t.child(r),i=t.child(n,!0);t.reset(n);var o=t.sibling(n,2),s=t.child(o,!0);t.reset(o),t.reset(r),t.template_effect(()=>{t.set_text(i,t.get(_)),t.set_text(s,t.get(S))}),t.append(e,r)};t.if(f,e=>{(t.get(_)||t.get(S))&&e(p)}),t.reset(r),t.template_effect(()=>{s=t.set_class(o,1,"",null,s,{connected:t.get(b)}),t.set_text(a,`${t.get(m)??""} - ${n.host??""}`),t.set_text(c,`${t.get(w)??""} - ${u()??""}`)}),t.event("click",h,P),t.append(e,r)},N=e=>{var r=ia();let n;var i=t.sibling(t.child(r),2),o=e=>{var r=na(),n=t.child(r,!0);t.reset(r),t.template_effect(()=>t.set_text(n,t.get(m))),t.append(e,r)};t.if(i,e=>{f()&&e(o)}),t.reset(r),t.template_effect(()=>n=t.set_class(r,1,"super-mqtt svelte-1l9u2si",null,n,{connected:t.get(b)})),t.append(e,r)};t.if(M,e=>{t.get(k)&&h()?e(B):e(N,-1)}),t.reset(C),t.action(C,(e,t)=>p?.(e,t),()=>t.store_get(y,"$component",i).styles),t.append(e,C),t.pop(),o()}var aa=t.from_html('<span class="plugin-error-detail svelte-1q1ah0h"> </span>'),la=t.from_html('<div class="plugin-error svelte-1q1ah0h" role="alert"><span class="plugin-error-title svelte-1q1ah0h">SuperMQTT failed to render</span> <!></div>');function ua(e,r){t.push(r,!0);let n=t.rest_props(r,["$$slots","$$events","$$legacy"]);var i=t.comment(),o=t.first_child(i);{const e=(e,r=t.noop)=>{var n=la(),i=t.sibling(t.child(n),2),o=e=>{var n=aa(),i=t.child(n,!0);t.reset(n),t.template_effect(()=>t.set_text(i,r().message)),t.append(e,n)};t.if(i,e=>{r()instanceof Error&&r().message&&e(o)}),t.reset(n),t.append(e,n)};t.boundary(o,{onerror:e=>{console.error("[SuperMQTT]",e)},failed:e},e=>{sa(e,t.spread_props(()=>n,{children:(e,n)=>{var i=t.comment(),o=t.first_child(i);t.snippet(o,()=>r.children??t.noop),t.append(e,i)},$$slots:{default:!0}}))})}t.append(e,i),t.pop()}var ca={type:"component",metadata:{svelteMajor:5},schema:{name:"bb_component_supermqtt",friendlyName:"Super MQTT",description:"An MQTT client component for Budibase",icon:"EmailOutline",context:{type:"static",scope:"global",values:[{key:"connected",label:"Connected",type:"boolean"},{key:"status",label:"Status",type:"string"},{key:"lastMessage",label:"Last Message"},{key:"at",label:"Last Message At"}]},settings:[{type:"text",key:"host",label:"Host",defaultValue:"localhost"},{type:"select",key:"protocol",label:"Protocol",defaultValue:"wss",options:[{label:"WS",value:"ws"},{label:"WSS",value:"wss"}]},{type:"text",key:"clientId",label:"Client ID",placeholder:"Auto"},{type:"text",key:"username",label:"Username"},{type:"text",key:"password",label:"Password"},{type:"text",key:"topic",label:"Topics",placeholder:"e.g., ops,checks,status",defaultValue:"test",required:!0},{type:"number",key:"keepAlive",label:"Keep Alive",defaultValue:60,min:0},{type:"number",key:"maxReconnect",label:"Max Reconnect",defaultValue:10,min:0},{type:"boolean",key:"jsonMessage",label:"JSON Message"},{type:"boolean",key:"showTest",label:"Show Test Panel",defaultValue:!1},{type:"boolean",key:"showStatus",label:"Show Status",defaultValue:!0},{section:!0,name:"events",settings:[{type:"event",key:"onConnect",label:"On Connect"},{type:"event",key:"onDisconnect",label:"On Disconnect"},{type:"event",key:"onMessage",label:"On Message",context:[{key:"message",label:"message"},{key:"topic",label:"topic"}]}]}]}},ha="1.0.1";if(window){const e={Component:ua,schema:ca,version:ha};window["##BUDIBASE_CUSTOM_COMPONENTS##"]||(window["##BUDIBASE_CUSTOM_COMPONENTS##"]=[]),window["##BUDIBASE_CUSTOM_COMPONENTS##"].push(e),window.registerCustomComponent&&window.registerCustomComponent(e)}var fa=ua,pa=ha;return e.Component=fa,e.schema=ca,e.version=pa,e}({},svelteInternal,svelte);
|
package/dist/schema.json
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "component",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"svelteMajor": 5
|
|
5
|
+
},
|
|
6
|
+
"schema": {
|
|
7
|
+
"name": "bb_component_supermqtt",
|
|
8
|
+
"friendlyName": "Super MQTT",
|
|
9
|
+
"description": "An MQTT client component for Budibase",
|
|
10
|
+
"icon": "EmailOutline",
|
|
11
|
+
"context": {
|
|
12
|
+
"type": "static",
|
|
13
|
+
"scope": "global",
|
|
14
|
+
"values": [
|
|
15
|
+
{
|
|
16
|
+
"key": "connected",
|
|
17
|
+
"label": "Connected",
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"key": "status",
|
|
22
|
+
"label": "Status",
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"key": "lastMessage",
|
|
27
|
+
"label": "Last Message"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"key": "at",
|
|
31
|
+
"label": "Last Message At"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"settings": [
|
|
36
|
+
{
|
|
37
|
+
"type": "text",
|
|
38
|
+
"key": "host",
|
|
39
|
+
"label": "Host",
|
|
40
|
+
"defaultValue": "localhost"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "select",
|
|
44
|
+
"key": "protocol",
|
|
45
|
+
"label": "Protocol",
|
|
46
|
+
"defaultValue": "wss",
|
|
47
|
+
"options": [
|
|
48
|
+
{
|
|
49
|
+
"label": "WS",
|
|
50
|
+
"value": "ws"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"label": "WSS",
|
|
54
|
+
"value": "wss"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "text",
|
|
60
|
+
"key": "clientId",
|
|
61
|
+
"label": "Client ID",
|
|
62
|
+
"placeholder": "Auto"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "text",
|
|
66
|
+
"key": "username",
|
|
67
|
+
"label": "Username"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "text",
|
|
71
|
+
"key": "password",
|
|
72
|
+
"label": "Password"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "text",
|
|
76
|
+
"key": "topic",
|
|
77
|
+
"label": "Topics",
|
|
78
|
+
"placeholder": "e.g., ops,checks,status",
|
|
79
|
+
"defaultValue": "test",
|
|
80
|
+
"required": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "number",
|
|
84
|
+
"key": "keepAlive",
|
|
85
|
+
"label": "Keep Alive",
|
|
86
|
+
"defaultValue": 60,
|
|
87
|
+
"min": 0
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "number",
|
|
91
|
+
"key": "maxReconnect",
|
|
92
|
+
"label": "Max Reconnect",
|
|
93
|
+
"defaultValue": 10,
|
|
94
|
+
"min": 0
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"key": "jsonMessage",
|
|
99
|
+
"label": "JSON Message"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"key": "showTest",
|
|
104
|
+
"label": "Show Test Panel",
|
|
105
|
+
"defaultValue": false
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"key": "showStatus",
|
|
110
|
+
"label": "Show Status",
|
|
111
|
+
"defaultValue": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"section": true,
|
|
115
|
+
"name": "events",
|
|
116
|
+
"settings": [
|
|
117
|
+
{
|
|
118
|
+
"type": "event",
|
|
119
|
+
"key": "onConnect",
|
|
120
|
+
"label": "On Connect"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "event",
|
|
124
|
+
"key": "onDisconnect",
|
|
125
|
+
"label": "On Disconnect"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "event",
|
|
129
|
+
"key": "onMessage",
|
|
130
|
+
"label": "On Message",
|
|
131
|
+
"context": [
|
|
132
|
+
{
|
|
133
|
+
"key": "message",
|
|
134
|
+
"label": "message"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"key": "topic",
|
|
138
|
+
"label": "topic"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"hash": "772be86a936e535bb487452ae2613db3605dd1bc",
|
|
147
|
+
"version": "1.0.1"
|
|
148
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bb_component_supermqtt",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Super MQTT",
|
|
5
|
+
"author": "Michael Poirazi - https://github.com/poirazis",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"svelte": "index.js",
|
|
8
|
+
"module": "dist/plugin.min.js",
|
|
9
|
+
"schema.metadata.svelteMajor": 5,
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "vite build",
|
|
17
|
+
"watch": "NODE_ENV=development vite build --watch --mode development"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"mqtt": "^5.15.1"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/plugin.min.js",
|
|
25
|
+
"require": "./dist/plugin.min.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@budibase/backend-core": "^3.39.22",
|
|
30
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
31
|
+
"tar": "^7.5.16",
|
|
32
|
+
"terser": "^5.48.0",
|
|
33
|
+
"vite": "^8.1.0",
|
|
34
|
+
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
35
|
+
"vite-plugin-singlefile": "^2.3.3",
|
|
36
|
+
"svelte": "5.55.10"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"svelte": "5.55.10"
|
|
40
|
+
},
|
|
41
|
+
"overrides": {
|
|
42
|
+
"svelte": "5.55.10"
|
|
43
|
+
}
|
|
44
|
+
}
|