vrpc 3.12.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/vrpc.js +1 -1
- package/package.json +3 -2
- package/vrpc/VrpcAdapter.js +169 -24
- package/vrpc/VrpcAgent.js +91 -21
- package/vrpc/VrpcBrowserAdapter.js +174 -28
- package/vrpc/VrpcBrowserAgent.js +77 -20
- package/vrpc/VrpcClient.js +21 -1
- package/vrpc/VrpcPersistor.js +15 -2
- package/vrpc/comment-parser/parser.js +11 -0
package/browser/vrpc.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
|| ${a} === "boolean" || ${o} === null`).assign(l,s._`[${o}]`)}}n.else(),p(e),n.endIf(),n.if(s._`${l} !== undefined`,()=>{n.assign(o,l),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,()=>e.assign(s._`${t}[${r}]`,n))}(e,l)})}(e,t,a):p(e)})}return c};const u=new Set(["string","number","integer","boolean","null"]);function f(e,t,r,n=l.Correct){const o=n===l.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return n===l.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function d(e,t,r,n){if(1===e.length)return f(e[0],t,r,n);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,f(e,t,r,n));return o}t.checkDataType=f,t.checkDataTypes=d;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,h)}t.reportTypeError=p},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=256*i+e[t+f],f+=d,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=n;u>0;s=256*s+e[t+f],f+=d,u-=8);if(0===i)i=1-c;else{if(i===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,m=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=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+h]=255&s,h+=p,s/=256,c-=8);e[r+h-p]|=128*m}},343:(e,t,r)=>{"use strict";const{isUUID:n}=r(4834),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function s(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2])}function a(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const c={scheme:"http",domainHost:!0,parse:a,serialize:l},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=s(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(s(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},f={http:c,https:{scheme:"https",domainHost:c.domainHost,parse:a,serialize:l},ws:u,wss:{scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(o);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const o=d(`${n}:${t.nid||e.nid}`);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=d(`${r}:${t.nid||n}`);o&&(e=o.serialize(e,t));const i=e,s=e.nss;return i.path=`${n||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&n(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};function d(e){return e&&(f[e]||f[e.toLowerCase()])||void 0}Object.setPrototypeOf(f,null),e.exports={wsIsSecure:s,SCHEMES:f,isValidSchemeName:function(e){return-1!==i.indexOf(e)},getSchemeHandler:d}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},397:(e,t,r)=>{"use strict";const n=r(8287),o=r(9584),i=r(2635);let s,a,l,c=!1;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const u=function(e,t){const r="alis"===e.protocol?"wss":"ws";let 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}(t,e);return s=t.my,s.connectSocket({url:u,protocols:r}),a=function(){const e=new o.Transform;return e._write=(e,t,r)=>{s.sendSocketMessage({data:e.buffer,success(){r()},fail(){r(new Error)}})},e._flush=e=>{s.closeSocket({success(){e()}})},e}(),l=new i.BufferedDuplex(t,a,s),c||(c=!0,s.onSocketOpen(()=>{l.socketReady()}),s.onSocketMessage(e=>{if("string"==typeof e.data){const t=n.Buffer.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?a.push(n.Buffer.from(t.result)):a.push(n.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),s.onSocketClose(()=>{l.end(),l.destroy()}),s.onSocketError(e=>{l.destroy(e)})),l}},414:e=>{"use strict";e.exports=Math.round},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:i,schemaCode:s,it:a}=e,l=a.opts.unicodeRegExp?"u":"",c=r?o._`(new RegExp(${s}, ${l}))`:(0,n.usePattern)(e,i);e.fail$data(o._`!${c}.test(${t})`)}};t.default=i},453:(e,t,r)=>{"use strict";var n,o=r(9612),i=r(9383),s=r(1237),a=r(9290),l=r(9538),c=r(8068),u=r(9675),f=r(5345),d=r(1514),h=r(8968),p=r(6188),m=r(8002),g=r(5880),y=r(414),b=r(3093),_=Function,w=function(e){try{return _('"use strict"; return ('+e+").constructor;")()}catch(e){}},v=r(5795),S=r(655),E=function(){throw new u},A=v?function(){try{return E}catch(e){try{return v(arguments,"callee").get}catch(e){return E}}}():E,k=r(4039)(),I=r(3628),O=r(1064),R=r(8648),P=r(1002),T=r(76),$={},x="undefined"!=typeof Uint8Array&&I?I(Uint8Array):n,j={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&I?I([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":$,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&I?I(I([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&I?I((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&I?I((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&I?I(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":A,"%TypedArray%":x,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":P,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":O,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":b,"%Reflect.getPrototypeOf%":R};if(I)try{null.error}catch(e){var N=I(I(e));j["%Error.prototype%"]=N}var C=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&I&&(r=I(o.prototype))}return j[t]=r,r},M={__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"]},L=r(6743),D=r(9957),F=L.call(T,Array.prototype.concat),B=L.call(P,Array.prototype.splice),U=L.call(T,String.prototype.replace),W=L.call(T,String.prototype.slice),q=L.call(T,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,H=function(e,t){var r,n=e;if(D(M,n)&&(n="%"+(r=M[n])[0]+"%"),D(j,n)){var o=j[n];if(o===$&&(o=C(n)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=W(e,0,1),r=W(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,V,function(e,t,r,o){n[n.length]=r?U(o,z,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=H("%"+n+"%",t),i=o.name,s=o.value,a=!1,l=o.alias;l&&(n=l[0],B(r,F([0,1],l)));for(var f=1,d=!0;f<r.length;f+=1){var h=r[f],p=W(h,0,1),m=W(h,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&d||(a=!0),D(j,i="%"+(n+="."+h)+"%"))s=j[i];else if(null!=s){if(!(h in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&f+1>=r.length){var g=v(s,h);s=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[h]}else d=D(s,h),s=s[h];d&&!a&&(j[i]=s)}}return s}},487:(e,t,r)=>{"use strict";var n=r(6897),o=r(655),i=r(3126),s=r(2205);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:s}):e.exports.apply=s},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),o=r(4227),i=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:i,parentSchema:s,data:a,keyword:l,it:c}=e;!function(e){const{opts:n,errSchemaPath:i}=c,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${l}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(c,e,n.strictTuples)}}(s),c.opts.unevaluated&&r.length&&!0!==c.items&&(c.items=o.mergeEvaluated.items(i,r.length,c.items));const u=i.name("valid"),f=i.const("len",n._`${a}.length`);r.forEach((t,r)=>{(0,o.alwaysValidSchema)(c,t)||(i.if(n._`${f} > ${r}`,()=>e.subschema({keyword:l,schemaProp:r,dataProp:r},u)),e.ok(u))})}t.validateTuple=a,t.default=s},495:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(1021),i=n(r(3497)),s=r(4723);t.default=(e,t,r)=>{e.log("_handleConnack");const{options:n}=e,a=5===n.protocolVersion?t.reasonCode:t.returnCode;if(e.connackReceived){const t=new s.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",t)}if(e.connackReceived=!0,clearTimeout(e.connackTimer),delete e.topicAliasSend,e._serverProperties=t.properties,t.properties&&t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new i.default(t.properties.topicAliasMaximum))}if(0===a)e.reconnecting=!1,e._onConnect(t);else if(a>0){e.log("_handleConnack :: connection refused with reason code %d",a);const t=new s.ErrorWithReasonCode(`Connection refused: ${o.ReasonCodes[a]}`,a);r?.discardParsedPackets(),e.reconnectSuppressed=!0,e._cleanUp(!0);try{e.emit("error",t)}finally{n.reconnectOnConnackError&&(e.reconnectSuppressed=!1,e._setupReconnect())}}}},507:(e,t,r)=>{"use strict";var n=r(453),o=r(6556),i=r(8859),s=r(9675),a=n("%Map%",!0),l=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),d=o("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+i(e))},delete:function(t){if(e){var r=f(e,t);return 0===d(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},519:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(4469);e.exports=i;const o=r(6269);function i(e){if(!(this instanceof i))return new i(e);o.call(this,e)}n(i.prototype,o.prototype),n(i,o),i.prototype._transform=function(e,t,r){r(null,e)}},537:(e,t,r)=>{var n=r(2045),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!_(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<o;a=n[++r])y(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+l+"$","i")}function c(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),d(n,e,n.depth)}function u(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return _(o)||(o=d(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(k(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return h(r)}var c,u="",f=!1,S=["{","}"];return m(r)&&(f=!0,S=["[","]"]),k(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(u=" "+RegExp.prototype.toString.call(r)),E(r)&&(u=" "+Date.prototype.toUTCString.call(r)),A(r)&&(u=" "+h(r)),0!==s.length||f&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,o){for(var i=[],s=0,a=t.length;s<a;++s)P(t,String(s))?i.push(p(e,t,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,f)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,S)):S[0]+u+S[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),P(n,o)||(s="["+o+"]"),a||(e.seen.indexOf(l.value)<0?(a=y(r)?d(e,l.value,null):d(e,l.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function b(e){return"number"==typeof e}function _(e){return"string"==typeof e}function w(e){return void 0===e}function v(e){return S(e)&&"[object RegExp]"===I(e)}function S(e){return"object"==typeof e&&null!==e}function E(e){return S(e)&&"[object Date]"===I(e)}function A(e){return S(e)&&("[object Error]"===I(e)||e instanceof Error)}function k(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=m,t.isBoolean=g,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=_,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=v,t.types.isRegExp=v,t.isObject=S,t.isDate=E,t.types.isDate=E,t.isError=A,t.types.isNativeError=A,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[O((e=new Date).getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function $(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t;if("function"!=typeof(t=e[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,n){e?r(e):t(n)});try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),T&&Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=T,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};e.apply(this,t).then(function(e){n.nextTick(s.bind(null,null,e))},function(e){n.nextTick($.bind(null,e,s))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},576:e=>{e.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},577:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:o,codes:i}=r(2074),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=i,{kEmptyObject:l,once:c}=r(7797),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:h}=r(1580),{Promise:p,PromisePrototypeThen:m,SymbolDispose:g}=r(4469),{isClosed:y,isReadable:b,isReadableNodeStream:_,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:P,kIsClosedPromise:T}=r(5980);let $;const x=()=>{};function j(e,t,i){var h,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),f(i,"callback"),u(t.signal,"options.signal"),i=c(i),w(e)||k(e))return function(e,t,i){let s=!1,a=x;if(t.signal)if(a=()=>{s=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{$=$||r(7797).addAbortListener;const n=$(t.signal,a),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>i.apply(e,t))};return m(e[T].promise,l,l),x}(e,t,i);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const j=null!==(h=t.readable)&&void 0!==h?h:_(e),N=null!==(p=t.writable)&&void 0!==p?p:A(e),C=e._writableState,M=e._readableState,L=()=>{e.writable||B()};let D=P(e)&&_(e)===j&&A(e)===N,F=I(e,!1);const B=()=>{F=!0,e.destroyed&&(D=!1),(!D||e.readable&&!j)&&(j&&!U||i.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(D=!1),(!D||e.writable&&!N)&&(N&&!F||i.call(e))},q=t=>{i.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?i.call(e,t):j&&!U&&_(e,!0)&&!v(e,!1)?i.call(e,new a):!N||F||I(e,!1)?void i.call(e):i.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?N&&!C&&(e.on("end",L),e.on("close",L)):(e.on("complete",B),D||e.on("abort",z),e.req?G():e.on("request",G)),D||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=C&&C.errorEmitted||null!=M&&M.errorEmitted?D||n.nextTick(H):(j||D&&!b(e)||!F&&!1!==E(e))&&(N||D&&!E(e)||!U&&!1!==b(e))?M&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{i=x,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",L),e.removeListener("close",L),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=i;K(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{$=$||r(7797).addAbortListener;const n=$(t.signal,s),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}}return K}e.exports=j,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p((r,o)=>{const i=j(e,t,e=>{n&&i(),e?o(e):r()})})}},579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){const 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(){}}},592:(e,t,r)=>{"use strict";var n=r(655),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),o=r(9029),i=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:l,parentSchema:c,schemaCode:u,it:f}=e;if(!a&&!l)return;const d=t.let("valid"),h=c.items?(0,n.getSchemaTypes)(c.items):[];function p(i,s){const a=t.name("item"),l=(0,n.checkDataTypes)(h,a,f.opts.strictNumbers,n.DataType.Wrong),c=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,()=>{t.let(a,o._`${r}[${i}]`),t.if(l,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${c}[${a}] == "number"`,()=>{t.assign(s,o._`${c}[${a}]`),e.error(),t.assign(d,!1).break()}).code(o._`${c}[${a}] = ${i}`)})}function m(n,a){const l=(0,i.useFunc)(t,s.default),c=t.name("outer");t.label(c).for(o._`;${n}--;`,()=>t.for(o._`${a} = ${n}; ${a}--;`,()=>t.if(o._`${l}(${r}[${n}], ${r}[${a}])`,()=>{e.error(),t.assign(d,!1).break(c)})))}e.block$data(d,function(){const n=t.let("i",o._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(d,!0),t.if(o._`${n} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?p:m)(n,i))},o._`${u} === false`),e.ok(d)}};t.default=a},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,o,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function o(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}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(){const 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=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(o(e,r))return!1;for(const r of t.names)if(o(e,r))return!0;return!1},t.humanize=r(6585),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}},778:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(1428)),i=n(r(7833)),s=n(r(6968)),a=(0,i.default)("mqttjs:tcp");t.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,s.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});const{port:r,path:n}=t,i=t.hostname;return a("port %d and host %s",r,i),o.default.createConnection({port:r,host:i,path:n})}},920:(e,t,r)=>{"use strict";var n=r(9675),o=r(8859),i=r(4803),s=r(507),a=r(2271)||s||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},968:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},982:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(4469),{AbortError:o,codes:i}=r(2074),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(5980),c=r(577),{ERR_INVALID_ARG_TYPE:u}=i;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const i=s(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{f=f||r(7797).addAbortListener;const o=f(e,i);c(t,o[n])}return t}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=void 0;const n=r(4723);t.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"};const o={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]};t.default=(e,r)=>{const{messageId:i}=r,s=r.cmd;let a=null;const l=e.outgoing[i],c=l?l.cb:null;let u=null;if(c){if(!o[l.cmd]?.includes(s))return e.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",s,l.cmd,i),void e.emit("error",new Error(`Protocol error: ${s} does not answer the ${l.cmd} pending on message id ${i}`));switch(e.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{const o=r.reasonCode;o&&o>0&&16!==o?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[o]}`,o),e._removeOutgoingAndStoreMessage(i,()=>{c(u,r)})):e._removeOutgoingAndStoreMessage(i,c);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:i};const o=r.reasonCode;o&&o>0&&16!==o?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[o]}`,o),e._removeOutgoingAndStoreMessage(i,()=>{c(u,r)})):e._sendPacket(a);break}case"suback":{delete e.outgoing[i],e.messageIdProvider.deallocate(i);const n=r.granted;for(let r=0;r<n.length;r++){const o=n[r];if(128&o){u=new Error(`Subscribe error: ${t.ReasonCodes[o]}`),u.code=o;const r=e.messageIdToTopic[i];r&&r.forEach(t=>{delete e._resubscribeTopics[t]})}}delete e.messageIdToTopic[i],e._invokeStoreProcessingQueue(),c(u,r);break}case"unsuback":delete e.outgoing[i],e.messageIdProvider.deallocate(i),e._invokeStoreProcessingQueue(),c(null,r);break;default:e.emit("error",new Error("unrecognized packet type"))}e.disconnecting&&0===Object.keys(e.outgoing).length&&e.emit("outgoingEmpty")}else e.log("_handleAck :: Server sent an ack in error. Ignoring.")}},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1072:(e,t)=>{t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},1077:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const 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"{}"}}}},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${i} ${o}`)}};t.default=o},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(1093),i=Object.keys,s=i?function(e){return i(e)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},1237:e=>{"use strict";e.exports=EvalError},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:i}=e;void 0===r.then&&void 0===r.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),l=s(i,"else");if(!a&&!l)return;const c=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&l){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(u,f("then",r),f("else",r))}else a?t.if(u,f("then")):t.if((0,n.not)(u),f("else"));function f(r,o){return()=>{const i=e.subschema({keyword:r},u);t.assign(c,u),e.mergeValidEvaluated(i,c),o?t.assign(o,n._`${r}`):e.setParams({ifClause:r})}}e.pass(c,()=>e.error(!0))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default=i},1278:(e,t,r)=>{t.parser=r(3079).parser,t.generate=r(2535),t.writeToStream=r(3132)},1333:e=>{"use strict";e.exports=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)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!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}},1396:(e,t,r)=>{e.exports=r(7007).EventEmitter},1401:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:o,SymbolAsyncIterator:i,SymbolIterator:s}=r(4469),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(2074).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[i])f=!0,u=t[i]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)d.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new c;if(d.push(t))continue;h=!1}}catch(e){d.destroy(e)}break}}())},d._destroy=function(e,t){o(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},d}},1428:()=>{},1514:e=>{"use strict";e.exports=Math.abs},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)l(r,t[n]),r.push(e[++n]);return new o(r)}t._Code=o,t.nil=new o(""),t._=i;const s=new o("+");function a(e,...t){const r=[u(e[0])];let n=0;for(;n<t.length;)r.push(s),l(r,t[n]),r.push(s,u(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function l(e,t){var r;t instanceof o?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},1580:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:g}=r(4469),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(2074),{normalizeEncoding:E}=r(7797),{isAsyncFunction:A,isArrayBufferView:k}=r(7797).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),P=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=!1)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new v(t,`>= ${n} && <= ${o}`,e)});function $(e,t){if("string"!=typeof e)throw new _(t,"string",e)}const x=y((e,t,r)=>{if(!o(r,e)){const n=i(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function j(e,t){if("boolean"!=typeof e)throw new _(t,"boolean",e)}function N(e,t,r){return null!=e&&d(e,t)?e[t]:r}const C=y((e,t,r=null)=>{const o=N(r,"allowArray",!1),i=N(r,"allowFunction",!1);if(!N(r,"nullable",!1)&&null===e||!o&&n(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new _(t,"Object",e)}),M=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new _(t,"a dictionary",e)}),L=y((e,t,r=0)=>{if(!n(e))throw new _(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),D=y((e,t="buffer")=>{if(!k(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}),F=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new _(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new _(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!h(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return T(e,t),e},validateArray:L,validateStringArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)$(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(null==n)throw new _(o,"AbortSignal",n);F(n,o)}},validateBoolean:j,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){const 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:B,validateInt32:P,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new _(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:x,validatePlainFunction:U,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($(e,t),void 0===I[e]){if(void 0!==I[m(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:$,validateUint32:T,validateUndefined:W,validateUnion:function(e,t,r){if(!o(r,e))throw new _(t,`('${i(r,"|")}')`,e)},validateAbortSignal:F,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const o=e[n];V(o,"hints"),r+=o,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"')}}},1591:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1676:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=t.KeepaliveManager=t.UniqueMessageIdProvider=t.DefaultMessageIdProvider=t.Store=t.MqttClient=t.connectAsync=t.connect=t.Client=void 0;const c=l(r(9777));t.MqttClient=c.default;const u=l(r(579));t.DefaultMessageIdProvider=u.default;const f=l(r(2099));t.UniqueMessageIdProvider=f.default;const d=l(r(7969));t.Store=d.default;const h=s(r(2793));t.connect=h.default,Object.defineProperty(t,"connectAsync",{enumerable:!0,get:function(){return h.connectAsync}});const p=l(r(3175));t.KeepaliveManager=p.default,t.Client=c.default,a(r(9777),t),a(r(4723),t),a(r(128),t);var m=r(1021);Object.defineProperty(t,"ReasonCodes",{enumerable:!0,get:function(){return m.ReasonCodes}})},1766:(e,t,r)=>{"use strict";function n(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 o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var l=r(8287).Buffer,c=r(3779).inspect,u=c&&c.custom||"inspect";function f(e,t,r){l.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return l.alloc(0);for(var t=l.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=l.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0===(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return c(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1787:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:s}=r(2074),{Symbol:a}=r(4469),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(5980),d=a("kDestroy"),h=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t,r){let o=!1;function i(t){if(o)return;o=!0;const i=e._readableState,s=e._writableState;p(t,s,i),s&&(s.closed=!0),i&&(i.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(y,e)}try{e._destroy(t||null,i)}catch(t){i(t)}}function g(e,t){b(e,t),y(e)}function y(e){const 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){const 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 _(e,t,r){const o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),r?n.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function r(r){if(t)return void _(e,null!=r?r:new i);t=!0;const o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(d,r):r?_(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(h)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(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?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,i=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?m(this,e,t):this.once(d,function(r){m(this,o(r,e),t)}),this)},undestroy:function(){const 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:_}},1860:(e,t,r)=>{"use strict";e.exports={VrpcClient:r(8577),VrpcAgent:r(6171),VrpcAdapter:r(8665)}},1999:(e,t,r)=>{"use strict";var n,o=r(2045);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=k,k.WritableState=A;var s,a={deprecate:r(4643)},l=r(1396),c=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(4347),d=r(6644).getHighWaterMark,h=r(2463).F,p=h.ERR_INVALID_ARG_TYPE,m=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,_=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,v=h.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function A(e,t,s){n=n||r(8101),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick($,e,t),e._writableState.errorEmitted=!0,S(e,n)):(i(n),e._writableState.errorEmitted=!0,S(e,n),$(e,t))}(e,r,n,t,i);else{var s=P(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(e,r),n?o.nextTick(O,e,r,s,i):O(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function k(e){var t=this instanceof(n=n||r(8101));if(!t&&!s.call(k,this))return new k(e);this._writableState=new A(e,this,t),this.writable=!0,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)),l.call(this)}function I(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),$(e,t)}function R(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,l=!0;r;)o[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;o.allBuffers=l,I(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(I(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),$(e,t)})}function $(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(k,l),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===k&&e&&e._writableState instanceof A}})):s=function(e){return e instanceof this},k.prototype.pipe=function(){S(this,new y)},k.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=e,c.isBuffer(n)||n instanceof u);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=E),i.ending?function(e,t){var r=new w;S(e,r),o.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i;return null===r?i=new _:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(S(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,o,i){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,a,n,o,i);return l}(this,i,a,e,t,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,$(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!==o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},2045:(e,t,r)=>{"use strict";const n=r(5606);n.nextTick=function(e,...t){queueMicrotask(()=>e(...t))},e.exports=n},2070:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:o,SymbolAsyncIterator:i,SymbolIterator:s}=r(2768),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(9157).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[i])f=!0,u=t[i]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)d.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new c;if(d.push(t))continue;h=!1}}catch(e){d.destroy(e)}break}}())},d._destroy=function(e,t){o(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},d}},2074:(e,t,r)=>{"use strict";const{format:n,inspect:o}=r(2858),{AggregateError:i}=r(4469),s=globalThis.AggregateError||i,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const 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 h(e,t,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return f(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[a]=!0,u[e]=o}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class m 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"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?i.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const e=i.pop();n+=`one of type ${i.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${o(r,{depth:-1})}`}else{let e=o(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),h("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=o(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),h("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),h("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const 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:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),h("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=d(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=d(n)),n+="n"}else n=o(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:m,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4807);t.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new n.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()}}},2100:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:o}=r(4469),{validateInteger:i}=r(1580),{ERR_INVALID_ARG_VALUE:s}=r(2074).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,i){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!o(a)||a<0)throw new s(i?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?l=t:a=t}}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),o=r(3693),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];t.default=i},2205:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(3144);e.exports=function(){return i(n,o,arguments)}},2271:(e,t,r)=>{"use strict";var n=r(453),o=r(6556),i=r(8859),s=r(507),a=r(9675),l=n("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),d=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return d(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?f(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},2299:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.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)?o(e,t):void 0}}(e,t)||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.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return i="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},i(e)}var s=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(4133);function d(e){return e.call.bind(e)}var h=d(Object.prototype.hasOwnProperty),p=d(Object.prototype.propertyIsEnumerable),m=d(Object.prototype.toString),g=r(537).types,y=g.isAnyArrayBuffer,b=g.isArrayBufferView,_=g.isDate,w=g.isMap,v=g.isRegExp,S=g.isSet,E=g.isNativeError,A=g.isBoxedPrimitive,k=g.isNumberObject,I=g.isStringObject,O=g.isBooleanObject,R=g.isBigIntObject,P=g.isSymbolObject,T=g.isFloat32Array,$=g.isFloat64Array;function x(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function j(e){return Object.keys(e).filter(x).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function N(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function C(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var o,a,l,u,d=m(e);if(d!==m(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var h=j(e),p=j(t);return h.length===p.length&&L(e,t,r,n,1,h)}if("[object Object]"===d&&(!w(e)&&w(t)||!S(e)&&S(t)))return!1;if(_(e)){if(!_(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(v(e)){if(!v(t)||(l=e,u=t,!(s?l.source===u.source&&l.flags===u.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(u))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(b(e)){if(r||!T(e)&&!$(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===N(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var g=j(e),x=j(t);return g.length===x.length&&L(e,t,r,n,0,g)}if(S(e))return!(!S(t)||e.size!==t.size)&&L(e,t,r,n,2);if(w(e))return!(!w(t)||e.size!==t.size)&&L(e,t,r,n,3);if(y(e)){if(a=t,(o=e).byteLength!==a.byteLength||0!==N(new Uint8Array(o),new Uint8Array(a)))return!1}else if(A(e)&&!function(e,t){return k(e)?k(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):I(e)?I(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):R(e)?R(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,n,0)}function M(e,t){return t.filter(function(t){return p(e,t)})}function L(e,t,r,o,s,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var d=0;d<c.length;d++)if(!h(t,c[d]))return!1;if(r&&5===arguments.length){var m=u(e);if(0!==m.length){var g=0;for(d=0;d<m.length;d++){var y=m[d];if(p(e,y)){if(!p(t,y))return!1;c.push(y),g++}else if(p(t,y))return!1}var b=u(t);if(m.length!==b.length&&M(t,b).length!==g)return!1}else{var _=u(t);if(0!==_.length&&0!==M(t,_).length)return!1}}if(0===c.length&&(0===s||1===s&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(e);if(void 0!==w){var v=o.val2.get(t);if(void 0!==v)return w===v}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var S=function(e,t,r,o,s,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,s=a(e),l=0;l<s.length;l++){var c=s[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!B(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=a(t),f=0;f<u.length;f++){var d=u[f];if("object"===i(d)&&null!==d){if(!D(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!D(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,s))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,a=l(e),c=0;c<a.length;c++){var u=n(a[c],2),f=u[0],d=u[1];if("object"===i(f)&&null!==f)null===s&&(s=new Set),s.add(f);else{var h=t.get(f);if(void 0===h&&!t.has(f)||!C(d,h,r,o)){if(r)return!1;if(!U(e,t,f,d,o))return!1;null===s&&(s=new Set),s.add(f)}}}if(null!==s){for(var p=l(t),m=0;m<p.length;m++){var g=n(p[m],2),y=g[0],b=g[1];if("object"===i(y)&&null!==y){if(!W(s,e,y,b,r,o))return!1}else if(!(r||e.has(y)&&C(e.get(y),b,!1,o)||W(s,e,y,b,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,s))return!1}else if(1===c)for(;u<e.length;u++){if(!h(e,u)){if(h(t,u))return!1;for(var f=Object.keys(e);u<f.length;u++){var d=f[u];if(!h(t,d)||!C(e[d],t[d],r,s))return!1}return f.length===Object.keys(t).length}if(!h(t,u)||!C(e[u],t[u],r,s))return!1}for(u=0;u<o.length;u++){var p=o[u];if(!C(e[p],t[p],r,s))return!1}return!0}(e,t,r,c,o,s);return o.val1.delete(e),o.val2.delete(t),S}function D(e,t,r,n){for(var o=a(e),i=0;i<o.length;i++){var s=o[i];if(C(t,s,r,n))return e.delete(s),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function B(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function U(e,t,r,n,o){var i=F(r);if(null!=i)return i;var s=t.get(i);return!(void 0===s&&!t.has(i)||!C(n,s,!1,o))&&!e.has(i)&&C(n,s,!1,o)}function W(e,t,r,n,o,i){for(var s=a(e),l=0;l<s.length;l++){var c=s[l];if(C(r,c,o,i)&&C(n,t.get(c),o,i))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return C(e,t,!1)},isDeepStrictEqual:function(e,t){return C(e,t,!0)}}},2463:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var o,i,s,a,l;if("string"==typeof t&&(i="not ",t.substr(0,4)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var c=("number"!=typeof l&&(l=0),l+1>(a=e).length||-1===a.indexOf(".",l)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(o," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},2464:(e,t,r)=>{"use strict";var n=r(8452),o=r(6642);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2535:(e,t,r)=>{const n=r(3132),{EventEmitter:o}=r(7007),{Buffer:i}=r(8287);class s extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let n,o=0;for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?t[n]=r[n].length:t[n]=i.byteLength(r[n]),e+=t[n];const s=i.allocUnsafe(e);for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?(r[n].copy(s,o),o+=t[n]):(s.write(r[n],o),o+=t[n]);return s}destroy(e){e&&this.emit("error",e)}}e.exports=function(e,t){const r=new s;return n(e,r,t),r.concat()}},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),o=r(208),i=r(7887),s=r(208),a=r(7870),l=r(3673),c=r(4495),u=r(9029),f=r(2023),d=r(6939),h=r(4227),p=r(8708);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,u._`${f.default.data}, ${f.default.valCxt}`,n.$async,()=>{e.code(u._`"use strict"; ${g(r,o)}`),function(e,t){e.if(f.default.valCxt,()=>{e.var(f.default.instancePath,u._`${f.default.valCxt}.${f.default.instancePath}`),e.var(f.default.parentData,u._`${f.default.valCxt}.${f.default.parentData}`),e.var(f.default.parentDataProperty,u._`${f.default.valCxt}.${f.default.parentDataProperty}`),e.var(f.default.rootData,u._`${f.default.valCxt}.${f.default.rootData}`),t.dynamicRef&&e.var(f.default.dynamicAnchors,u._`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{e.var(f.default.instancePath,u._`""`),e.var(f.default.parentData,u._`undefined`),e.var(f.default.parentDataProperty,u._`undefined`),e.var(f.default.rootData,f.default.data),t.dynamicRef&&e.var(f.default.dynamicAnchors,u._`{}`)})}(e,o),e.code(i)}):e.func(t,u._`${f.default.data}, ${function(e){return u._`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${e.dynamicRef?u._`, ${f.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,n.$async,()=>e.code(g(r,o)).code(i))}function g(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?u._`/*# sourceURL=${r} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function _(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function w(e,t){if(e.opts.jtd)return S(e,[],!1,t);const r=(0,o.getSchemaTypes)(e.schema);S(e,r,!(0,o.coerceAndCheckDataType)(e,r),t)}function v({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(u._`${f.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=u.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${f.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function S(e,t,r,n){const{gen:o,schema:a,data:l,allErrors:c,opts:d,self:p}=e,{RULES:m}=p;function g(h){(0,i.shouldUseGroup)(a,h)&&(h.type?(o.if((0,s.checkDataType)(h.type,l,d.strictNumbers)),E(e,h),1===t.length&&t[0]===h.type&&r&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):E(e,h),c||o.if(u._`${f.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(a,m)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{A(e.dataTypes,t)||k(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const n of e.dataTypes)A(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&k(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some(e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n})&&k(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),o.block(()=>{for(const e of m.rules)g(e);g(m.post)})):o.block(()=>O(e,"$ref",m.all.$ref.definition))}function E(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,i.shouldUseRule)(n,r)&&O(e,r.keyword,r.definition,t.type)})}function A(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function k(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(_(e),y(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,()=>{r.$comment&&t.$comment&&v(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(f.default.vErrors,null),n.let(f.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",u._`${r}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`)),t.if(u._`${e.evaluated}.dynamicItems`,()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`))}(e),w(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(u._`${f.default.errors} === 0`,()=>t.return(f.default.data),()=>t.throw(u._`new ${o}(${f.default.vErrors})`)):(t.assign(u._`${n}.errors`,f.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof u.Name&&e.assign(u._`${t}.props`,r),n instanceof u.Name&&e.assign(u._`${t}.items`,n)}(e),t.return(u._`${f.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,n.topBoolOrEmptySchema)(e))};class I{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",T(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,u.or)(u._`${n} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return u._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return u._`!${r}(${t})`}return u.nil}())}subschema(e,t){const r=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(r,this.it,e),(0,c.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return function(e,t){b(e)&&(_(e),y(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&v(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",f.default.errors);w(e,i),n.var(t,u._`${i} === ${f.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function O(e,t,r,n){const o=new I(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,l.funcKeywordCode)(o,r):"macro"in r?(0,l.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(o,r)}t.KeywordCxt=I;const R=/^\/(?:[^~]|~0|~1)*$/,P=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return f.default.rootData;if("/"===e[0]){if(!R.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=f.default.rootData}else{const s=P.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(l("property/index",a));return n[t-a]}if(a>t)throw new Error(l("data",a));if(i=r[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=u._`${s} && ${i}`);return s;function l(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=T},2634:()=>{},2635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedDuplex=void 0,t.writev=i;const n=r(9584),o=r(8287);function i(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=o.Buffer.from(e[t].chunk,"utf8"):r[t]=e[t].chunk;this._write(o.Buffer.concat(r),"binary",t)}class s extends n.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=i.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;){const{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}}t.BufferedDuplex=s},2639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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={}}}},2642:(e,t,r)=>{"use strict";var n=r(7720),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(s),u=c?s.slice(0,c.index):s,f=[];if(u){if(!r.plainObjects&&o.call(Object.prototype,u)&&!r.allowPrototypes)return;f.push(u)}for(var d=0;r.depth>0&&null!==(c=a.exec(s))&&d<r.depth;){if(d+=1,!r.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(c[1])}if(c){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");f.push("["+s.slice(c.index)+"]")}return function(e,t,r,o){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");i=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=o?t:l(t,r,i),c=e.length-1;c>=0;--c){var u,f=e[c];if("[]"===f&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:n.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var d="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,h=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,p=parseInt(h,10);r.parseArrays||""!==h?!isNaN(p)&&f!==h&&String(p)===h&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(u=[])[p]=a:"__proto__"!==h&&(u[h]=a):u={0:a}}a=u}return a}(f,t,r,i)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"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");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?s.charset:e.charset,r=void 0===e.duplicates?s.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||s.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var r={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,f=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&f.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var d,h=-1,p=t.charset;if(t.charsetSentinel)for(d=0;d<f.length;++d)0===f[d].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[d]?p="utf-8":"utf8=%26%2310003%3B"===f[d]&&(p="iso-8859-1"),h=d,d=f.length);for(d=0;d<f.length;++d)if(d!==h){var m,g,y=f[d],b=y.indexOf("]="),_=-1===b?y.indexOf("="):b+1;-1===_?(m=t.decoder(y,s.decoder,p,"key"),g=t.strictNullHandling?null:""):(m=t.decoder(y.slice(0,_),s.decoder,p,"key"),g=n.maybeMap(l(y.slice(_+1),t,i(r[m])?r[m].length:0),function(e){return t.decoder(e,s.decoder,p,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===p&&(g=a(String(g))),y.indexOf("[]=")>-1&&(g=i(g)?[g]:g);var w=o.call(r,m);w&&"combine"===t.duplicates?r[m]=n.combine(r[m],g):w&&"last"!==t.duplicates||(r[m]=g)}return r}(e,r):e,f=r.plainObjects?{__proto__:null}:{},d=Object.keys(u),h=0;h<d.length;++h){var p=d[h],m=c(p,u[p],r,"string"==typeof e);f=n.merge(f,m,r)}return!0===r.allowSparse?f:n.compact(f)}},2648:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:s}=r(2768);e.exports=c;const a=r(9214),l=r(7602);s(c.prototype,a.prototype),s(c,a);{const e=i(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.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}let u,f;function d(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.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 d().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5224)),f(e,"body")}},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:s,it:a}=e;let l,c;const{minContains:u,maxContains:f}=i;a.opts.next?(l=void 0===u?1:u,c=f):l=1;const d=t.const("len",n._`${s}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,r)){let t=n._`${d} >= ${l}`;return void 0!==c&&(t=n._`${t} && ${d} <= ${c}`),void e.pass(t)}a.items=!0;const h=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,()=>t.if(e,()=>function(e){t.code(n._`${e}++`),void 0===c?t.if(n._`${e} >= ${l}`,()=>t.assign(h,!0).break()):(t.if(n._`${e} > ${c}`,()=>t.assign(h,!1).break()),1===l?t.assign(h,!0):t.if(n._`${e} >= ${l}`,()=>t.assign(h,!0)))}(r)))}function m(r,n){t.forRange("i",0,d,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},r),n()})}void 0===c&&1===l?m(h,()=>t.if(h,()=>t.break())):0===l?(t.let(h,!0),void 0!==c&&t.if(n._`${s}.length > 0`,p)):(t.let(h,!1),p()),e.result(h,()=>e.reset())}};t.default=i},2682:(e,t,r)=>{"use strict";var n=r(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=e,"[object Array]"===o.call(a)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,s):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s)}},2729:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:m}=r(4469);e.exports=G,G.ReadableState=H;const{EventEmitter:g}=r(7007),{Stream:y,prependListener:b}=r(4474),{Buffer:_}=r(8287),{addAbortSignal:w}=r(982),v=r(577);let S=r(7797).debuglog("stream",e=>{S=e});const E=r(3158),A=r(1787),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(2100),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:T,ERR_STREAM_PUSH_AFTER_EOF:$,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:j}=r(2074),{validateObject:N}=r(1580),C=m("kPaused"),{StringDecoder:M}=r(7487),L=r(1401);u(G.prototype,y.prototype),u(G,y);const D=()=>{},{errorOrDestroy:F}=A,B=1,U=16,W=32,q=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 H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),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 M(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(7323);this._readableState=new H(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&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const o=e._readableState;let i;if(0===(o.state&B)&&("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=_.from(t,r).toString(o.encoding):(t=_.from(t,r),r=""))):t instanceof _?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new R("chunk",["string","Buffer","Uint8Array"],t))),i)F(e,i);else if(null===t)o.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,o);else if(0!==(o.state&B)||t&&t.length>0)if(n)if(4&o.state)F(e,new x);else{if(o.destroyed||o.errored)return!1;Q(e,o,t,!0)}else if(o.ended)F(e,new $);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?Q(e,o,t,!1):Z(e,o)):Q(e,o,t,!1)}else n||(o.state&=-9,Z(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function Q(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&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("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,oe(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oe(e),t.flowing&&!t.reading&&e.read(0)}function oe(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function ie(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=D;function o(t){this===e?(n(),n=D):n=t}e.on("readable",o);const i=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=D});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(o)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",o),i()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(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 ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("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)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),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=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:i(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new T("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 S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,o=!!(64&t.state);if(S("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,S("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,S("reading, ended or constructing",o);else if(o){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(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&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new P("_read()")},G.prototype.pipe=function(e,t){const r=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),S("pipe count=%d opts=%j",o.pipes.length,t);const i=t&&!1===t.end||e===n.stdout||e===n.stderr?m:s;function s(){S("onend"),e.end()}let a;o.endEmitted?n.nextTick(i):r.once("end",i),e.on("unpipe",function t(n,i){S("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,S("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",u),l=!0,a&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(S("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(S("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),m(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),m()}function p(){S("onfinish"),e.removeListener("close",h),m()}function m(){S("unpipe"),r.unpipe(e)}return r.on("data",u),b(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():o.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=o(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){const r=y.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,S("on readable",o.length,o.reading),o.length?Y(this):o.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!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())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return ie(this)},G.prototype.iterator=function(e){return void 0!==e&&N(e,"options"),ie(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const 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}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[C]},set(e){this[C]=!!e}}}),G._fromList=se,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){A.destroyer(e,t),r(t)}}).wrap(e)}},2768:e=>{"use strict";class t 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}}e.exports={AggregateError:t,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,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(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,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,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},2793:function(e,t,r){"use strict";var n=r(2045),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.connectAsync=function(e,t,r=!0){return new Promise((n,o)=>{const i=f(e,t),s={connect:e=>{a(),n(i)},end:()=>{a(),n(i)},error:e=>{a(),i.end(),o(e)}};function a(){Object.keys(s).forEach(e=>{i.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{i.on(e,s[e])})})};const i=o(r(7833)),s=o(r(8835)),a=o(r(9777)),l=o(r(6887));"function"!=typeof n?.nextTick&&(n.nextTick=setImmediate);const c=(0,i.default)("mqttjs");let u=null;function f(e,t){if(c("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){const r=s.default.parse(e,!0),n={},o=!r.protocol&&!r.hostname&&r.path?.startsWith("/")&&(l.default||t.forceNativeWebSocket);if(null!=r.port&&(n.port=Number(r.port)),n.host=r.hostname,n.query=r.query,n.auth=r.auth,n.protocol=r.protocol,n.path=r.path,!(t={...n,...t}).protocol&&!o)throw new Error("Missing protocol");t.protocol=(t.protocol||("undefined"!=typeof location?"https:"===location.protocol?"wss":"ws":"undefined"!=typeof document&&"https:"===new URL(document.URL).protocol?"wss":"ws")).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){const[,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),l.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&void 0!==n&&(t.socksProxy=n.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(u||(u={},l.default||t.forceNativeWebSocket?(u.ws=r(8203).browserStreamBuilder,u.wss=r(8203).browserStreamBuilder,u.wx=r(5670).A,u.wxs=r(5670).A,u.ali=r(397).A,u.alis=r(397).A):(u.ws=r(8203).streamBuilder,u.wss=r(8203).streamBuilder,u.mqtt=r(778).default,u.tcp=r(778).default,u.ssl=r(3936).default,u.tls=u.ssl,u.mqtts=r(3936).default)),!u[t.protocol]){const 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 u[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const o=new a.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++),c("calling streambuilder for",t.protocol),u[t.protocol](e,t)},t);return o.on("error",()=>{}),o}t.default=f},2858:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const 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"{}"}}}},2860:e=>{"use strict";e.exports={version:"5.16.0"}},2861:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3003:e=>{"use strict";e.exports=function(e){return e!=e}},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),o=r(4227),i=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const o=1===t?"property":"properties";return n.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>n._`{property: ${e},
|
|
6
6
|
missingProperty: ${o},
|
|
7
7
|
depsCount: ${t},
|
|
8
|
-
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),l(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,i.propertyInData)(r,o,l,s.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),s.allErrors?r.if(u,()=>{for(const t of c)(0,i.checkReportMissingProp)(e,t)}):(r.if(n._`${u} && (${(0,i.checkMissingProp)(e,c,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function l(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,l=r.name("valid");for(const c in t)(0,o.alwaysValidSchema)(a,t[c])||(r.if((0,i.propertyInData)(r,n,c,a.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:c},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=s},3079:(e,t,r)=>{const n=r(9868),{EventEmitter:o}=r(7007),i=r(576),s=r(5399),a=r(7833)("mqtt-packet:parser");class l extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof l?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new l).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("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++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0),t=e>>s.CMD_SHIFT;this.packet.cmd=s.types[t];const r=15&e,n=s.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(s.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.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&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_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 a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,r,n;a("_parseConnect");const o={},i=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(i.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(i.protocolVersion=this._list.readUInt8(this._pos),i.protocolVersion>=128&&(i.bridgeMode=!0,i.protocolVersion=i.protocolVersion-128),3!==i.protocolVersion&&4!==i.protocolVersion&&5!==i.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"));o.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;const c=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),u=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(o.will)i.will={},i.will.retain=c,i.will.qos=u;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(u)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(i.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,i.keepalive=this._parseNum(),-1===i.keepalive)return this._emitError(new Error("Packet too short"));if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.properties=e)}const f=this._parseString();if(null===f)return this._emitError(new Error("Packet too short"));if(i.clientId=f,a("_parseConnect: packet.clientId: %s",i.clientId),o.will){if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(i.will.topic=e,a("_parseConnect: packet.will.topic: %s",i.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));i.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",i.will.payload)}if(o.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));i.username=n,a("_parseConnect: packet.username: %s",i.username)}if(o.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));i.password=r}return this.settings=i,a("_parseConnect: complete"),i}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;const 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&s.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){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const 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){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,r,n,o,i,l,c;if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(r=this._parseByte(),5===this.settings.protocolVersion){if(192&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(l=0!==(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),i=0!==(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),o=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,o>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:t,qos:n},5===this.settings.protocolVersion?(c.nl=l,c.rap=i,c.rh=o):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const 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;){const e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!s.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(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const 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;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const 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){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const 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(!s.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const 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(),!s.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,r=0,n=1,o=0,i=!1;const l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),o+=n*(t&s.VARBYTEINT_MASK),n*=128,0===(t&s.VARBYTEINT_FIN_MASK)){i=!0;break}if(this._list.length<=r)break}return!i&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),i=!!i&&(e?{bytes:r,value:o}:o),a("_parseVarByteNum: result: %o",i),i}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_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(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const 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(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t])}return r}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_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)),a("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){a("_emitError",e),this.error=e,this.emit("error",e)}}e.exports=l},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),o=r(9675),i=r(76),s=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,i,e)}},3132:(e,t,r)=>{const n=r(5399),{Buffer:o}=r(8287),i=o.allocUnsafe(0),s=o.from([0]),a=r(6172),l=r(3225).nextTick,c=r(7833)("mqtt-packet:writeToStream"),u=a.cache,f=a.generateNumber,d=a.generateCache,h=a.genBufVariableByteInt,p=a.generate4ByteBuffer;let m=E,g=!0;function y(e,t,r){switch(c("generate called"),t.cork&&(t.cork(),l(b,t)),g&&(g=!1,d()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){const r=e||{},i=r.protocolId||"MQTT";let s=r.protocolVersion||4;const a=r.will;let l=r.clean;const c=r.keepalive||0,u=r.clientId||"",f=r.username,d=r.password,h=r.properties;void 0===l&&(l=!0);let p,g,y=0;if(!i||"string"!=typeof i&&!o.isBuffer(i))return t.destroy(new Error("Invalid protocolId")),!1;if(y+=i.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(y+=1,("string"==typeof u||o.isBuffer(u))&&(u||s>=4)&&(u||l))y+=o.byteLength(u)+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 c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(y+=2,y+=1,5===s){if(p=I(t,h),!p)return!1;y+=p.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(y+=o.byteLength(a.topic)+2,y+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?y+=o.byteLength(a.payload):y+=a.payload.length}if(g={},5===s){if(g=I(t,a.properties),!g)return!1;y+=g.length}}let b=!1;if(null!=f){if(!$(f))return t.destroy(new Error("Invalid username")),!1;b=!0,y+=o.byteLength(f)+2}if(null!=d){if(!b)return t.destroy(new Error("Username is required to use password")),!1;if(!$(d))return t.destroy(new Error("Invalid password")),!1;y+=T(d)+2}t.write(n.CONNECT_HEADER),w(t,y),k(t,i),r.bridgeMode&&(s+=128),t.write(131===s?n.VERSION131:132===s?n.VERSION132:4===s?n.VERSION4:5===s?n.VERSION5:n.VERSION3);let _=0;return _|=null!=f?n.USERNAME_MASK:0,_|=null!=d?n.PASSWORD_MASK:0,_|=a&&a.retain?n.WILL_RETAIN_MASK:0,_|=a&&a.qos?a.qos<<n.WILL_QOS_SHIFT:0,_|=a?n.WILL_FLAG_MASK:0,_|=l?n.CLEAN_SESSION_MASK:0,t.write(o.from([_])),m(t,c),5===s&&p.write(),k(t,u),a&&(5===s&&g.write(),v(t,a.topic),k(t,a.payload)),null!=f&&k(t,f),null!=d&&k(t,d),!0}(e,t);case"connack":return function(e,t,r){const i=r?r.protocolVersion:4,a=e||{},l=5===i?a.reasonCode:a.returnCode,c=a.properties;let u=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let f=null;if(5===i){if(f=I(t,c),!f)return!1;u+=f.length}return t.write(n.CONNACK_HEADER),w(t,u),t.write(a.sessionPresent?n.SESSIONPRESENT_HEADER:s),t.write(o.from([l])),null!=f&&f.write(),!0}(e,t,r);case"publish":return function(e,t,r){c("publish: packet: %o",e);const s=r?r.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?n.RETAIN_MASK:0,f=a.topic,d=a.payload||i,h=a.messageId,p=a.properties;let g=0;if("string"==typeof f)g+=o.byteLength(f)+2;else{if(!o.isBuffer(f))return t.destroy(new Error("Invalid topic")),!1;g+=f.length+2}if(o.isBuffer(d)?g+=d.length:g+=o.byteLength(d),l&&"number"!=typeof h)return t.destroy(new Error("Invalid messageId")),!1;l&&(g+=2);let y=null;if(5===s){if(y=I(t,p),!y)return!1;g+=y.length}return t.write(n.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),w(t,g),m(t,T(f)),t.write(f),l>0&&m(t,h),null!=y&&y.write(),c("publish: payload: %o",d),t.write(d)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,c=s.dup&&"pubrel"===a?n.DUP_MASK:0;let u=0;const f=s.reasonCode,d=s.properties;let h=5===i?3:2;if("pubrel"===a&&(u=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===i&&"object"==typeof d){if(p=O(t,d,r,h),!p)return!1;h+=p.length}return t.write(n.ACKS[a][u][c][0]),3===h&&(h+=0!==f?1:-1),w(t,h),m(t,l),5===i&&2!==h&&t.write(o.from([f])),null!==p?p.write():4===h&&t.write(o.from([0])),!0}(e,t,r);case"subscribe":return function(e,t,r){c("subscribe: packet: ");const i=r?r.protocolVersion:4,s=e||{},a=s.dup?n.DUP_MASK:0,l=s.messageId,u=s.subscriptions,f=s.properties;let d=0;if("number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;d+=2;let h=null;if(5===i){if(h=I(t,f),!h)return!1;d+=h.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,n=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof n)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===i){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}d+=o.byteLength(r)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),t.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,d),m(t,l),null!==h&&h.write();let p=!0;for(const e of u){const r=e.topic,s=e.qos,a=+e.nl,l=+e.rap,c=e.rh;let u;v(t,r),u=n.SUBSCRIBE_OPTIONS_QOS[s],5===i&&(u|=a?n.SUBSCRIBE_OPTIONS_NL:0,u|=l?n.SUBSCRIBE_OPTIONS_RAP:0,u|=c?n.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(o.from([u]))}return p}(e,t,r);case"suback":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,c=s.properties;let u=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;u+=1}let f=null;if(5===i){if(f=O(t,c,r,u),!f)return!1;u+=f.length}return t.write(n.SUBACK_HEADER),w(t,u),m(t,a),null!==f&&f.write(),t.write(o.from(l))}(e,t,r);case"unsubscribe":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.unsubscriptions,u=s.properties;let f=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(f+=2,"object"!=typeof c||!c.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<c.length;e+=1){if("string"!=typeof c[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;f+=o.byteLength(c[e])+2}let d=null;if(5===i){if(d=I(t,u),!d)return!1;f+=d.length}t.write(n.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,f),m(t,a),null!==d&&d.write();let h=!0;for(let e=0;e<c.length;e++)h=v(t,c[e]);return h}(e,t,r);case"unsuback":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.granted,u=s.properties,f=s.cmd;let d=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===i){if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.destroy(new Error("Invalid qos vector")),!1;d+=1}}let h=null;if(5===i){if(h=O(t,u,r,d),!h)return!1;d+=h.length}return t.write(n.ACKS[f][0][l][0]),w(t,d),m(t,a),null!==h&&h.write(),5===i&&t.write(o.from(c)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(n.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===i?1:0,u=null;if(5===i){if(u=O(t,l,r,c),!u)return!1;c+=u.length}return t.write(o.from([n.codes.disconnect<<4])),w(t,c),5===i&&t.write(o.from([a])),null!==u&&u.write(),!0}(e,t,r);case"auth":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===i?1:0;5!==i&&t.destroy(new Error("Invalid mqtt version for auth packet"));const u=O(t,l,r,c);return!!u&&(c+=u.length,t.write(o.from([n.codes.auth<<4])),w(t,c),t.write(o.from([a])),null!==u&&u.write(),!0)}(e,t,r);default:return t.destroy(new Error("Unknown command")),!1}}function b(e){e.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>m===E,set(e){e?(u&&0!==Object.keys(u).length||(g=!0),m=E):(g=!1,m=A)}});const _={};function w(e,t){if(t>n.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let r=_[t];return r||(r=h(t),t<16384&&(_[t]=r)),c("writeVarByteInt: writing to stream: %o",r),e.write(r)}function v(e,t){const r=o.byteLength(t);return m(e,r),c("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){v(e,t),v(e,r)}function E(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){const r=f(t);return c("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?v(e,t):t?(m(e,t.length),e.write(t)):m(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){P(e,{},0)}};let r=0;function i(t,r){let i=0;switch(n.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=2;break;case"binary":if(r&&null===r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=1+o.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=1+o.byteLength(h(r));break;case"string":if("string"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=3+o.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce((e,r)=>e+(3+o.byteLength(t.toString())+2+o.byteLength(r.toString())),0):e+=3+o.byteLength(t.toString())+2+o.byteLength(r[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${r}`)),!1}return i}if(t)for(const e in t){let n=0,o=0;const s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(o=i(e,s[t]),!o)return!1;n+=o}else{if(o=i(e,s),!o)return!1;n=o}if(!n)return!1;r+=n}}return{length:o.byteLength(h(r))+r,write(){P(e,t,r)}}}function O(e,t,r,n){const o=["reasonString","userProperties"],i=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=I(e,t);if(i)for(;n+s.length>i;){const r=o.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,r){switch(n.propertiesTypes[t]){case"byte":e.write(o.from([n.properties[t]])),e.write(o.from([+r]));break;case"int8":e.write(o.from([n.properties[t]])),e.write(o.from([r]));break;case"binary":e.write(o.from([n.properties[t]])),k(e,r);break;case"int16":e.write(o.from([n.properties[t]])),m(e,r);break;case"int32":e.write(o.from([n.properties[t]])),function(e,t){const r=p(t);c("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(o.from([n.properties[t]])),w(e,r);break;case"string":e.write(o.from([n.properties[t]])),v(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(i=>{const s=r[i];Array.isArray(s)?s.forEach(r=>{e.write(o.from([n.properties[t]])),S(e,i.toString(),r.toString())}):(e.write(o.from([n.properties[t]])),S(e,i.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${r}`)),!1}}function P(e,t,r){w(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function T(e){return e?e instanceof o?e.length:o.byteLength(e):0}function $(e){return"string"==typeof e||e instanceof o}e.exports=y},3141:(e,t,r)=>{"use strict";var n=r(5003).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},3144:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(76),s=r(7119);e.exports=s||n.call(i,o)},3158:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:s}=r(4469),{Buffer:a}=r(8287),{inspect:l}=r(7797);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const 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 a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const 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}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,o=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(i(t,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}i(t,a,r-e),e-=a.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},3175:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(7732));t.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,o.default)(t),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;const 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)}}},3225:(e,t,r)=>{"use strict";var n=r(2045);void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,o)});default:for(i=new Array(a-1),s=0;s<i.length;)i[s++]=arguments[s];return n.nextTick(function(){e.apply(null,i)})}}}:e.exports=n},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),i=r(6653),s=r(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3425:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(2768),{isIterable:i,isNodeStream:s,isWebStream:a}=r(6801),{pipelineImpl:l}=r(3616),{finished:c}=r(6364);r(5244),e.exports={finished:c,pipeline:function(...e){return new o((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!i(u)&&!a(u)){const t=n(e);o=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:o,end:c})})}}},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),l=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${l}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9096),o=r(4807);t.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new n.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new o.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const 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){const t=this.topicToAlias[e];return void 0!==t&&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]}}},3513:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:o}=r(2768),{validateInteger:i}=r(4947),{ERR_INVALID_ARG_VALUE:s}=r(9157).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,i){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!o(a)||a<0)throw new s(i?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?l=t:a=t}}},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const o=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${o} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),o)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>i,nanoid:()=>a,random:()=>o,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o=e=>crypto.getRandomValues(new Uint8Array(e)),i=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let t=r(o),a=0|o;for(;a--;)if(s+=e[t[a]&n]||"",s.length===i)return s}}},s=(e,t=21)=>i(e,t,o),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3616:(e,t,r)=>{const n=r(5606),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:s,SymbolDispose:a}=r(2768),l=r(6364),{once:c}=r(9862),u=r(7302),f=r(2648),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:b}=r(9157),{validateFunction:_,validateAbortSignal:w}=r(4947),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(6801),P=globalThis.AbortController||r(5568).AbortController;let T,$,x;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function N(e){if(v(e))return e;if(E(e))return async function*(e){$||($=r(9214)),yield*$.prototype[s].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let o,s=null;const a=e=>{if(e&&(o=e),s){const e=s;s=null,e()}},c=()=>new i((e,t)=>{o?t(o):s=()=>{o?t(o):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,r,{end:n}){k(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const s=new P,l=s.signal,c=null==i?void 0:i.signal,u=[];function d(){B(new b)}let g,y,_;w(c,"options.signal"),x=x||r(9862).addAbortListener,c&&(g=x(c,d));const R=[];let $,L=0;function F(e){B(e,0===--L)}function B(e,r){var o;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(o=g)||void 0===o||o[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,_))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==i?void 0:i.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&F(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if($=z({signal:l}),!v($))throw new p("Iterable, AsyncIterable or Stream","source",$)}else $=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if($=k($)?N(null===(W=$)||void 0===W?void 0:W.readable):N($),$=z($,{signal:l}),H){if(!v($,!0))throw new p("AsyncIterable",`transform[${V-1}]`,$)}else{var q;T||(T=r(5258));const X=new T({objectMode:!0}),Z=null===(q=$)||void 0===q?void 0:q.then;if("function"==typeof Z)L++,Z.call($,e=>{_=e,null!=e&&X.write(e),K&&X.end(),n.nextTick(F)},e=>{X.destroy(e),n.nextTick(F,e)});else if(v($,!0))L++,C($,X,F,{end:K});else{if(!O($)&&!k($))throw new p("AsyncIterable or Promise","destination",$);{const re=$.readable||$;L++,C(re,X,F,{end:K})}}$=X;const{destroy:ee,cleanup:te}=j($,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E($)){L+=2;const ne=D($,z,F,{end:K});S(z)&&Q&&u.push(ne)}else if(k($)||O($)){const oe=$.readable||$;L++,C(oe,z,F,{end:K})}else{if(!v($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,C($,z,F,{end:K})}$=z}else if(I(z)){if(E($))L++,M(N($),z,F,{end:K});else if(O($)||v($))L++,M($,z,F,{end:K});else{if(!k($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,M($.readable,z,F,{end:K})}$=z}else $=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),$}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",()=>{i||r(new y)}),e.pipe(t,{end:!1}),o){function s(){i=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const 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)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:L,pipeline:function(...e){return L(e,c(function(e){return _(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},3628:(e,t,r)=>{"use strict";var n=r(8648),o=r(1064),i=r(7176);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=l(r,o,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const f=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},f),e.pass(f,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;const{gen:c,keyword:u,schema:f,parentSchema:d,$data:h,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!h&&t.compile?t.compile.call(p.self,f,d,p):t.validate,g=l(c,u,m),y=c.let("valid");function b(r=(t.async?n._`await `:n.nil)){const s=p.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!h||!1===t.schema);c.assign(y,n._`${r}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function _(e){var r;c.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,function(){if(!1===t.errors)b(),t.modifying&&a(e),_(()=>e.error());else{const r=t.async?function(){const e=c.let("ruleErrs",null);return c.try(()=>b(n._`await `),t=>c.assign(y,!1).if(n._`${t} instanceof ${p.ValidationError}`,()=>c.assign(e,n._`${t}.errors`),()=>c.throw(t))),e}():function(){const e=n._`${g}.errors`;return c.assign(e,null),b(n.nil),e}();t.modifying&&a(e),_(()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}(e,r))}}),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3681:(e,t,r)=>{"use strict";e.exports=o;var n=r(9083);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(6698)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),l=r(4227),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:l,validateName:c,opts:d,self:h}=o,{root:p}=l;if(("#"===r||"#/"===r)&&s===p.baseId)return function(){if(l===p)return f(e,c,l,l.$async);const r=t.scopeValue("root",{ref:p});return f(e,i._`${r}.validate`,p,p.$async)}();const m=a.resolveRef.call(h,p,s,r);if(void 0===m)throw new n.default(o.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=u(e,t);f(e,r,t,t.$async)}(m):function(n){const o=t.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,r,n){const{gen:a,it:c}=e,{allErrors:u,schemaEnv:f,opts:d}=c,h=d.passContext?s.default.this:i.nil;function p(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const t=a.var("props",i._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,i.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const t=a.var("items",i._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,i.Name)}}n?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try(()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(r,!0)},e=>{a.if(i._`!(${e} instanceof ${c.ValidationError})`,()=>a.throw(e)),p(e),u||a.assign(r,!1)}),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,h),()=>m(t),()=>p(t))}t.getValidate=u,t.callRef=f,t.default=c},3779:()=>{},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),l=r(2586);class c{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=d.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,f=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let h;e.$async&&(h=f.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();g=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const t of this._compilations)if(h(t,e))return t}function h(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return y.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new c({schema:t,schemaId:r,root:e,baseId:o})}return y.call(this,r,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=p.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new c({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=f.call(this,i):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!g.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:l}=this.opts;return i=i||new c({schema:r,schemaId:l,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3885:(e,t,r)=>{"use strict";e.exports=r(9844)()},3918:(e,t,r)=>{"use strict";var n=r(2045);function o(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o,i;n=e,o=t,i=r[t],(o=a(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function l(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},u(e)}function f(e,t,r){return f=d()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&h(o,r.prototype),o},f.apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e){return m="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},m(e)}var g=r(537).inspect,y=r(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var _="",w="",v="",S="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var I=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(I,e);var r,o,a,u,f=(r=I,o=d(),function(){var e,t=p(r);if(o){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function I(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,I),"object"!==m(e)||null===e)throw new y("options","Object",e);var r=e.message,o=e.operator,i=e.stackStartFn,s=e.actual,a=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(_="[34m",w="[32m",S="[39m",v="[31m"):(_="",w="",S="",v="")),"object"===m(s)&&null!==s&&"object"===m(a)&&null!==a&&"stack"in s&&s instanceof Error&&"stack"in a&&a instanceof Error&&(s=A(s),a=A(a)),"deepStrictEqual"===o||"strictEqual"===o)t=f.call(this,function(e,t,r){var o="",i="",s=0,a="",l=!1,c=k(e),u=c.split("\n"),f=k(t).split("\n"),d=0,h="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===f.length&&u[0]!==f[0]){var p=u[0].length+f[0].length;if(p<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(u[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===f[0][d];)d++;d>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var g=u[u.length-1],y=f[f.length-1];g===y&&(d++<2?a="\n ".concat(g).concat(a):o=g,u.pop(),f.pop(),0!==u.length&&0!==f.length);)g=u[u.length-1],y=f[f.length-1];var A=Math.max(u.length,f.length);if(0===A){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(_,"...").concat(S);I.length>27;)I.pop();return"".concat(E.notIdentical,"\n\n").concat(I.join("\n"),"\n")}d>3&&(a="\n".concat(_,"...").concat(S).concat(a),l=!0),""!==o&&(a="\n ".concat(o).concat(a),o="");var O=0,R=E[r]+"\n".concat(w,"+ actual").concat(S," ").concat(v,"- expected").concat(S),P=" ".concat(_,"...").concat(S," Lines skipped");for(d=0;d<A;d++){var T=d-s;if(u.length<d+1)T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(f[d-2]),O++),i+="\n ".concat(f[d-1]),O++),s=d,o+="\n".concat(v,"-").concat(S," ").concat(f[d]),O++;else if(f.length<d+1)T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(u[d-2]),O++),i+="\n ".concat(u[d-1]),O++),s=d,i+="\n".concat(w,"+").concat(S," ").concat(u[d]),O++;else{var $=f[d],x=u[d],j=x!==$&&(!b(x,",")||x.slice(0,-1)!==$);j&&b($,",")&&$.slice(0,-1)===x&&(j=!1,x+=","),j?(T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(u[d-2]),O++),i+="\n ".concat(u[d-1]),O++),s=d,i+="\n".concat(w,"+").concat(S," ").concat(x),o+="\n".concat(v,"-").concat(S," ").concat($),O+=2):(i+=o,o="",1!==T&&0!==d||(i+="\n ".concat(x),O++))}if(O>20&&d<A-2)return"".concat(R).concat(P,"\n").concat(i,"\n").concat(_,"...").concat(S).concat(o,"\n")+"".concat(_,"...").concat(S)}return"".concat(R).concat(l?P:"","\n").concat(i).concat(o).concat(a).concat(h)}(s,a,o));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=E[o],h=k(s).split("\n");if("notStrictEqual"===o&&"object"===m(s)&&null!==s&&(d=E.notStrictEqualObject),h.length>30)for(h[26]="".concat(_,"...").concat(S);h.length>27;)h.pop();t=1===h.length?f.call(this,"".concat(d," ").concat(h[0])):f.call(this,"".concat(d,"\n\n").concat(h.join("\n"),"\n"))}else{var p=k(s),g="",O=E[o];"notDeepEqual"===o||"notEqual"===o?(p="".concat(E[o],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(g="".concat(k(a)),p.length>512&&(p="".concat(p.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?p="".concat(O,"\n\n").concat(p,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),t=f.call(this,"".concat(p).concat(g))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=a,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(c(t),i),t.stack,t.name="AssertionError",l(t)}return a=I,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,i(i({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),I}(u(Error),g.custom);e.exports=I},3936:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(6370),i=n(r(1428)),s=n(r(7833)),a=n(r(6968)),l=(0,s.default)("mqttjs:tls");t.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0!==i.default.isIP(t.host)||t.servername||(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,l("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=function(e){const{host:t,port:r,socksProxy:n,...i}=e;if(void 0!==n){const s=(0,a.default)(t,r,n,{timeout:e.socksTimeout});return(0,o.connect)({...i,socket:s})}return(0,o.connect)(e)}(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)}),r.on("error",n),r}},3942:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(4469),{isIterable:i,isNodeStream:s,isWebStream:a}=r(5980),{pipelineImpl:l}=r(4867),{finished:c}=r(577);r(9037),e.exports={finished:c,pipeline:function(...e){return new o((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!i(u)&&!a(u)){const t=n(e);o=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:o,end:c})})}}},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===r.length)return;const f=r.length>=u.loopRequired;if(c.allErrors?function(){if(f||l)e.block$data(o.nil,d);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(f||l){const r=t.let("valid",!0);e.block$data(r,()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(i,(0,n.propertyInData)(t,a,r,u.ownProperties)),t.if((0,o.not)(i),()=>{e.error(),t.break()})},o.nil)}(i,r)),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(c,t,c.opts.strictRequired)}}function d(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,u.ownProperties),()=>e.error())})}}};t.default=s},4035:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9092)(),s=r(9957),a=r(5795);if(i){var l=o("RegExp.prototype.exec"),c={},u=function(){throw c},f={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=u),n=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{l(e,f)}catch(e){return e===c}}}else{var d=o("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===d(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),l=r(3835),c=r(9029),u=r(6939),f=r(208),d=r(4227),h=r(3837),p=r(5944),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function w(e){var t,r,n,o,i,s,a,l,c,u,f,d,h,g,y,b,_,w,v,S,E,A,k,I,O;const R=e.strict,P=null===(t=e.code)||void 0===t?void 0:t.optimize,T=!0===P||void 0===P?1:P||0,$=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,x=null!==(o=e.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:R)||void 0===s||s,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:R)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:R)&&void 0!==u?u:"log",strictTuples:null!==(d=null!==(f=e.strictTuples)&&void 0!==f?f:R)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:R)&&void 0!==g&&g,code:e.code?{...e.code,optimize:T,regExp:$}:{optimize:T,regExp:$},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(k=e.validateFormats)||void 0===k||k,unicodeRegExp:null===(I=e.unicodeRegExp)||void 0===I||I,int32range:null===(O=e.int32range)||void 0===O||O,uriResolver:x}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...w(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&I.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),A.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=h;"id"===r&&(n={...h},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const r=await c.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:r});if(t=l.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return(0,d.eachItem)(r,e=>$.call(this,e)),this;j.call(this,t);const n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>$.call(this,e,n):e=>n.type.forEach(t=>$.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=C(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,u.normalizeId)(i||r);const c=u.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function A(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function k(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function I(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of g)delete e[t];return e}v.ValidationError=i.default,v.MissingRefError=s.default,t.default=v;const R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function $(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?x.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function x(e,t,r){const n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function j(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,N]}}},4133:(e,t,r)=>{"use strict";var n=r(487),o=r(8452),i=r(3003),s=r(6642),a=r(2464),l=n(s(),Number);o(l,{getPolyfill:s,implementation:i,shim:a}),e.exports=l},4148:(e,t,r)=>{"use strict";var n=r(2045);function o(e){return o="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},o(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!==o(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}var l,c,u=r(9597).codes,f=u.ERR_AMBIGUOUS_ARGUMENT,d=u.ERR_INVALID_ARG_TYPE,h=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,m=u.ERR_MISSING_ARGS,g=r(3918),y=r(537).inspect,b=r(537).types,_=b.isPromise,w=b.isRegExp,v=r(9133)(),S=r(9394)(),E=r(8075)("RegExp.prototype.test");function A(){var e=r(2299);l=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var k=!1,I=e.exports=T,O={};function R(e){if(e.message instanceof Error)throw e.message;throw new g(e)}function P(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new g({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[T,t.length].concat(t))}I.fail=function e(t,r,o,i,s){var a,l=arguments.length;if(0===l?a="Failed":1===l?(o=t,t=void 0):(!1===k&&(k=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===l&&(i="!=")),o instanceof Error)throw o;var c={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:s||e};void 0!==o&&(c.message=o);var u=new g(c);throw a&&(u.message=a,u.generatedMessage=!0),u},I.AssertionError=g,I.ok=T,I.equal=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");t!=r&&R({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},I.notEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");t==r&&R({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},I.deepEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),l(t,r)||R({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},I.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),l(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},I.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),c(t,r)||R({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},I.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),c(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},I.strictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");S(t,r)||R({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},I.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");S(t,r)&&R({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var $=s(function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&E(t[e],n[e])?o[e]=n[e]:o[e]=t[e])})});function x(e,t,r,n){if("function"!=typeof t){if(w(t))return E(t,e);if(2===arguments.length)throw new d("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new g({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new h("error",t,"may not be an empty object");return void 0===l&&A(),s.forEach(function(o){"string"==typeof e[o]&&w(t[o])&&E(t[o],e[o])||function(e,t,r,n,o,i){if(!(r in e)||!c(e[r],t[r])){if(!n){var s=new $(e,o),a=new $(t,o,e),l=new g({actual:s,expected:a,operator:"deepStrictEqual",stackStartFn:i});throw l.actual=e,l.expected=t,l.operator=i.name,l}R({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}(e,t,o,r,s,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function j(e){if("function"!=typeof e)throw new d("fn","Function",e);try{e()}catch(e){return e}return O}function N(e){return _(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!N(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!N(e))throw new d("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return O}).catch(function(e){return e})})}function M(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new d("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new d("error",["Object","Error","Function","RegExp"],r);if(t===O){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";R({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!x(t,r,n,e))throw t}function L(e,t,r,n){if(t!==O){if("string"==typeof r&&(n=r,r=void 0),!r||x(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";R({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function D(e,t,r,n,i){if(!w(t))throw new d("regexp","RegExp",t);var s="match"===i;if("string"!=typeof e||E(t,e)!==s){if(r instanceof Error)throw r;var a=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(o(e)," (").concat(y(e),")"):(s?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(t),". Input:\n\n").concat(y(e),"\n"));var l=new g({actual:e,expected:t,message:r,operator:i,stackStartFn:n});throw l.generatedMessage=a,l}}function F(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[F,t.length].concat(t))}I.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];M.apply(void 0,[e,j(t)].concat(n))},I.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return C(t).then(function(t){return M.apply(void 0,[e,t].concat(n))})},I.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];L.apply(void 0,[e,j(t)].concat(n))},I.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return C(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},I.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new g({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},I.match=function e(t,r,n){D(t,r,n,e,"match")},I.doesNotMatch=function e(t,r,n){D(t,r,n,e,"doesNotMatch")},I.strict=v(F,I,{equal:I.strictEqual,deepEqual:I.deepStrictEqual,notEqual:I.notStrictEqual,notDeepEqual:I.notDeepStrictEqual}),I.strict.strict=I.strict},4152:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEventEmitter=void 0;const o=n(r(7007)),i=r(4723);class s{}t.TypedEventEmitter=s,(0,i.applyMixin)(s,o.default)},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||p(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,l)=>{const c=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return l!==n.Name||c instanceof n.Name?c:o(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach(r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>{e.if(n._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),f(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=f;const d={};var h;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h||(t.Type=h={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===h.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},4233:e=>{"use strict";const t=function*(){}.constructor;e.exports=()=>t},4257:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){a=!1,c=!0,s||i.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){s=!1,f=!0,a||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",p),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",d),t.on("finish",u),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",u),t.removeListener("abort",p),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:o}=t,i={cmd:"pubcomp",messageId:o};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(i,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._releaseIncomingQoS2Publish(o),e._sendPacket(i,n)}))})}},4269:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(9157),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(4947),d=r(2768).Symbol("kWeak"),h=r(2768).Symbol("kResistStopPropagation"),{finished:p}=r(6364),m=r(9848),{addAbortSignalNoValidate:g}=r(5121),{isWritable:y,isNodeStream:b}=r(6801),{deprecate:_}=r(9862),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:P}=r(2768),T=P("kEmpty"),$=P("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=S(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(9862).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,m()}function m(){h-=1,g()}function g(){f&&!d&&h<n&&a.length<o&&(f(),f=null)}!async function(){try{for await(let t of s){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===T)continue;t=O(t)}catch(e){t=I(e)}h+=1,R(t,m,p),a.push(t),u&&(u(),u=null),!d&&(a.length>=o||h>=n)&&await new k(e=>{f=e})}a.push($)}catch(e){const t=I(e);R(t,m,p),a.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===$)return;if(i.aborted)throw new l;e!==T&&(yield e),a.shift(),g()}await new k(e=>{u=e})}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of N.call(this,e,t))return!0;return!1}function N(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,async function(t,r){return await e(t,r)?t:T},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:_(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({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&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:N,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!y(e))throw new o("stream",e,"must be writable");const r=m(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.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(const r of x.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let m=!1;try{for await(const n of this){var g;if(m=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!m&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of N.call(this,e,t))return r}}},4347:(e,t,r)=>{"use strict";var n=r(2045);function o(e,t){s(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4469:e=>{"use strict";class t 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}}e.exports={AggregateError:t,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,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(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,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,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},4474:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(4469),{EventEmitter:i}=r(7007);function s(e){i.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(s.prototype,i.prototype),o(s,i),s.prototype.pipe=function(e,t){const 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",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:l}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:l}=t;u(c.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(u(s instanceof n.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class o extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=o},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},4723:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.MQTTJS_VERSION=t.nextTick=t.ErrorWithSubackPacket=t.ErrorWithReasonCode=void 0,t.applyMixin=function(e,t,r=!1){const n=[t];for(;;){const e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(const t of n)for(const n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};class o extends Error{code;constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,o.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}t.ErrorWithReasonCode=o;class i extends Error{packet;constructor(e,t){super(e),this.packet=t,Object.setPrototypeOf(this,i.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}}t.ErrorWithSubackPacket=i,t.nextTick="function"==typeof n?.nextTick?n.nextTick:e=>{setTimeout(e,0)},t.MQTTJS_VERSION=r(2860).version},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=l;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),l=r.let("fType"),u=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(l,n._`${s}.type || "string"`).assign(u,n._`${s}.validate`),()=>r.assign(l,n._`"string"`).assign(u,s)),e.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${u}`,function(){const e=f.$async?n._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:n._`${u}(${o})`,r=n._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return n._`${u} && ${u} !== true && ${l} === ${t} && !${r}`}()))}():function(){const i=d.formats[s];if(!i)return void function(){if(!1!==c.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}d.logger.warn(e())}();if(!0===i)return;const[a,l,h]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return n._`await ${h}(${o})`}return"function"==typeof l?n._`${h}(${o})`:n._`${h}.test(${o})`}())}())}};t.default=o},4765:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},4803:(e,t,r)=>{"use strict";var n=r(8859),o=r(9675),i=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return i(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=i(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=i(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},4807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberAllocator=void 0,t.NumberAllocator=class{used;min;max;lowWaterMark;constructor(e,t){this.min=e,this.max=t,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return!(e<this.min||e>this.max||this.used.has(e)||(this.used.add(e),0))}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}}},4834:e=>{"use strict";const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),48!==r){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){const o=n(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function a(e){if(function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e)<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},o=[],a=[];let l=!1,c=!1,u=s;for(let n=0;n<e.length;n++){const s=e[n];if("["!==s&&"]"!==s)if(":"!==s)if("%"===s){if(!u(a,o,r))break;u=i}else a.push(s);else{if(!0===l&&(c=!0),!u(a,o,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(l=!0),o.push(":")}}return a.length&&(u===i?r.zone=a.join(""):c?o.push(a.join("")):o.push(n(a))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}e.exports={nonSimpleDomain:o,recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){const t=a(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e;const r=[];let n=-1,o=0;for(;o=t.length;){if(1===o){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===o&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n}},4867:(e,t,r)=>{const n=r(5606),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:s,SymbolDispose:a}=r(4469),l=r(577),{once:c}=r(7797),u=r(1787),f=r(7323),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:b}=r(2074),{validateFunction:_,validateAbortSignal:w}=r(1580),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(5980),P=globalThis.AbortController||r(5568).AbortController;let T,$,x;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function N(e){if(v(e))return e;if(E(e))return async function*(e){$||($=r(2729)),yield*$.prototype[s].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let o,s=null;const a=e=>{if(e&&(o=e),s){const e=s;s=null,e()}},c=()=>new i((e,t)=>{o?t(o):s=()=>{o?t(o):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,r,{end:n}){k(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const s=new P,l=s.signal,c=null==i?void 0:i.signal,u=[];function d(){B(new b)}let g,y,_;w(c,"options.signal"),x=x||r(7797).addAbortListener,c&&(g=x(c,d));const R=[];let $,L=0;function F(e){B(e,0===--L)}function B(e,r){var o;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(o=g)||void 0===o||o[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,_))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==i?void 0:i.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&F(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if($=z({signal:l}),!v($))throw new p("Iterable, AsyncIterable or Stream","source",$)}else $=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if($=k($)?N(null===(W=$)||void 0===W?void 0:W.readable):N($),$=z($,{signal:l}),H){if(!v($,!0))throw new p("AsyncIterable",`transform[${V-1}]`,$)}else{var q;T||(T=r(519));const X=new T({objectMode:!0}),Z=null===(q=$)||void 0===q?void 0:q.then;if("function"==typeof Z)L++,Z.call($,e=>{_=e,null!=e&&X.write(e),K&&X.end(),n.nextTick(F)},e=>{X.destroy(e),n.nextTick(F,e)});else if(v($,!0))L++,C($,X,F,{end:K});else{if(!O($)&&!k($))throw new p("AsyncIterable or Promise","destination",$);{const re=$.readable||$;L++,C(re,X,F,{end:K})}}$=X;const{destroy:ee,cleanup:te}=j($,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E($)){L+=2;const ne=D($,z,F,{end:K});S(z)&&Q&&u.push(ne)}else if(k($)||O($)){const oe=$.readable||$;L++,C(oe,z,F,{end:K})}else{if(!v($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,C($,z,F,{end:K})}$=z}else if(I(z)){if(E($))L++,M(N($),z,F,{end:K});else if(O($)||v($))L++,M($,z,F,{end:K});else{if(!k($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,M($.readable,z,F,{end:K})}$=z}else $=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),$}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",()=>{i||r(new y)}),e.pipe(t,{end:!1}),o){function s(){i=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const 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)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:L,pipeline:function(...e){return L(e,c(function(e){return _(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},4947:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:g}=r(2768),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(9157),{normalizeEncoding:E}=r(9862),{isAsyncFunction:A,isArrayBufferView:k}=r(9862).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),P=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=!1)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new v(t,`>= ${n} && <= ${o}`,e)});function $(e,t){if("string"!=typeof e)throw new _(t,"string",e)}const x=y((e,t,r)=>{if(!o(r,e)){const n=i(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function j(e,t){if("boolean"!=typeof e)throw new _(t,"boolean",e)}function N(e,t,r){return null!=e&&d(e,t)?e[t]:r}const C=y((e,t,r=null)=>{const o=N(r,"allowArray",!1),i=N(r,"allowFunction",!1);if(!N(r,"nullable",!1)&&null===e||!o&&n(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new _(t,"Object",e)}),M=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new _(t,"a dictionary",e)}),L=y((e,t,r=0)=>{if(!n(e))throw new _(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),D=y((e,t="buffer")=>{if(!k(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}),F=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new _(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new _(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!h(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return T(e,t),e},validateArray:L,validateStringArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)$(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(null==n)throw new _(o,"AbortSignal",n);F(n,o)}},validateBoolean:j,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){const 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:B,validateInt32:P,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new _(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:x,validatePlainFunction:U,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($(e,t),void 0===I[e]){if(void 0!==I[m(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:$,validateUint32:T,validateUndefined:W,validateUnion:function(e,t,r){if(!o(r,e))throw new _(t,`('${i(r,"|")}')`,e)},validateAbortSignal:F,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const o=e[n];V(o,"hints"),r+=o,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"')}}},4959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),o=[0,16,128,131,135,144,145,151,153],i=(e,t,r,o,i=148)=>{o?.discardParsedPackets(),o&&!o.isCurrent()||e._cleanUp(!0),r(),e.emit("error",new n.ErrorWithReasonCode(t,i))},s=(e,t,r)=>{r(),e.emit("error",t)};t.default=(e,t,r,n)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let a=t.topic.toString();const l=t.payload,{qos:c}=t,{messageId:u}=t,{options:f}=e;if(5===e.options.protocolVersion){let o;if(t.properties&&(o=t.properties.topicAlias),void 0!==o){const t=e.topicAliasRecv;if(!t)return e.log("handlePublish :: received unexpected topic alias. alias: %d",o),void i(e,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);if(0===a.length){if(!(o>0&&o<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",o),void i(e,`Received Topic Alias ${o} is outside the valid range 1-65535`,r,n);{const s=t.getTopicByAlias(o);if(!s)return e.log("handlePublish :: unregistered topic alias. alias: %d",o),void i(e,"Received unregistered Topic Alias",r,n,130);a=s,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,o)}}else{if(!t.put(a,o))return e.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",o,t.max),void i(e,`Received Topic Alias ${o} is outside the advertised Topic Alias Maximum range 1-${t.max}`,r,n);e.log("handlePublish :: registered topic: %s - alias: %d",a,o)}}}switch(e.log("handlePublish: qos %d",c),c){case 2:f.customHandleAcks(a,l,t,(i,a)=>{if("number"==typeof i&&(a=i,i=null),i)return s(e,i,r);if(-1===o.indexOf(a))return s(e,new Error("Wrong reason code for pubrec"),r);if(a)e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:a},r);else{if(!e._trackIncomingQoS2Publish(u,r,n))return;e.incomingStore.put(t,()=>{e._sendPacket({cmd:"pubrec",messageId:u},r)})}});break;case 1:f.customHandleAcks(a,l,t,(n,i)=>("number"==typeof n&&(i=n,n=null),n?s(e,n,r):-1===o.indexOf(i)?s(e,new Error("Wrong reason code for puback"),r):(i||e.emit("message",a,l,t),void e.handleMessage(t,t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:i},r)}))));break;case 0:e.emit("message",a,l,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},5003:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5016:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(2768);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(9157).codes,s=r(2648),{getHighWaterMark:a}=r(3513);n(c.prototype,s.prototype),n(c,s);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}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 f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5034:(e,t,r)=>{"use strict";var n,o=r(2045);function i(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(4257),a=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function g(e){o.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(t,r){o.nextTick(function(){e[c]?r(e[c]):t(p(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(p(void 0,!0)):t[d](r,n)},n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(b,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[f]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[a]=null,r[l]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[u]=!0}),e.on("readable",g.bind(null,r)),r}},5121:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(2768),{AbortError:o,codes:i}=r(9157),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(6801),c=r(6364),{ERR_INVALID_ARG_TYPE:u}=i;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const i=s(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{f=f||r(9862).addAbortListener;const o=f(e,i);c(t,o[n])}return t}},5224:(e,t,r)=>{const n=r(5606),o=r(8287),{isReadable:i,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(6801),p=r(6364),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=r(9157),{destroyer:b}=r(7302),_=r(2648),w=r(9214),v=r(7602),{createDeferredPromise:S}=r(9862),E=r(2070),A=globalThis.Blob||o.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(2768);class R extends _{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function P(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,o,a,l,c,u=!!i(t),f=!!s(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&b(t,e),d(e)}),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(o){const e=o;o=null,e()}})),u&&(p(t,e=>{u=!1,e&&b(t,e),d(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new m),a=null,n=null,o=null,null===l?i(e):(l=i,b(r,e),b(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return P({readable:t});if(u(t))return P({writable:t});if(l(t))return P({writable:!1,readable:!1});if(d(t))return P({readable:w.fromWeb(t)});if(h(t))return P({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:s}=function(e){let{promise:t,resolve:r}=S();const o=new I,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(i.aborted)throw new m(void 0,{cause:i.reason});({promise:t,resolve:r}=S()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:o,final:i,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{b(t,e)});return t=new R({objectMode:!0,readable:!1,write:o,final(e){i(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return P({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{b(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),o=130,i=(e,t,r)=>{e.log("handleAuth :: %s",t.message),r?.discardParsedPackets(),r&&!r.isCurrent()||e._cleanUp(!0),e.emit("error",t)};t.default=(e,t,r)=>{const{options:s}=e,a=s.protocolVersion,l=5===a?t.reasonCode:t.returnCode;if(5!==a)return void i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,o),r);const c=e._authenticationMethod;c?t.properties?.authenticationMethod===c?e.handleAuth(t,(t,s)=>{if(t)i(e,t,r);else{if(0!==l)return 24===l?s?(e.reconnecting=!1,void e._sendPacket(s)):void i(e,new n.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",o),r):void i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${l} is not one a broker may send`,o),r);e.log("handleAuth :: authentication exchange completed successfully")}}):i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${c}" sent in CONNECT`,o),r):i(e,new n.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",o),r)}},5244:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:s}=r(2768),{promisify:{custom:a}}=r(9862),{streamReturningOperators:l,promiseReturningOperators:c}=r(4269),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(9157),f=r(9848),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(3513),{pipeline:p}=r(3616),{destroyer:m}=r(7302),g=r(6364),y=r(3425),b=r(6801),_=e.exports=r(8745).Stream;_.isDestroyed=b.isDestroyed,_.isDisturbed=b.isDisturbed,_.isErrored=b.isErrored,_.isReadable=b.isReadable,_.isWritable=b.isWritable,_.Readable=r(9214);for(const v of i(l)){const S=l[v];function E(...e){if(new.target)throw u();return _.Readable.from(s(S,this,e))}o(E,"name",{__proto__:null,value:S.name}),o(E,"length",{__proto__:null,value:S.length}),o(_.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}o(I,"name",{__proto__:null,value:k.name}),o(I,"length",{__proto__:null,value:k.length}),o(_.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}_.Writable=r(7602),_.Duplex=r(2648),_.Transform=r(5016),_.PassThrough=r(5258),_.pipeline=p;const{addAbortSignal:w}=r(5121);_.addAbortSignal=w,_.finished=g,_.destroy=m,_.compose=f,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=h,o(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(g,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),_.Stream=_,_._isUint8Array=function(e){return e instanceof Uint8Array},_._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},5258:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(2768);e.exports=i;const o=r(5016);function i(e){if(!(this instanceof i))return new i(e);o.call(this,e)}n(i.prototype,o.prototype),n(i,o),i.prototype._transform=function(e,t,r){r(null,e)}},5267:(e,t,r)=>{"use strict";var n,o=r(2463).F,i=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var u,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var d=t.map(function(e,o){var i=o<t.length-1;return function(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(4257)),n(e,{readable:t,writable:o},function(e){if(e)return i(e);a=!0,i()});var l=!1;return function(t){if(!a&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new s("pipe"))}}(e,i,o>0,function(e){u||(u=e),e&&d.forEach(l),i||(d.forEach(l),f(u))})});return t.reduce(c)}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:l,it:c}=e,{opts:u}=c,f=(0,n.allSchemaProperties)(r),d=f.filter(e=>(0,i.alwaysValidSchema)(c,r[e]));if(0===f.length||d.length===f.length&&(!c.opts.unevaluated||!0===c.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,p=t.name("valid");!0===c.props||c.props instanceof o.Name||(c.props=(0,s.evaluatedPropsToName)(t,c.props));const{props:m}=c;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(r){t.forIn("key",a,i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,()=>{const n=d.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},p),c.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):n||c.allErrors||t.if((0,o.not)(p),()=>t.break())})})}!function(){for(const e of f)h&&g(e),c.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}()}};t.default=a},5345:e=>{"use strict";e.exports=URIError},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5373:(e,t,r)=>{"use strict";var n=r(8636),o=r(2642),i=r(4765);e.exports={formats:i,parse:o,stringify:n}},5399:(e,t,r)=>{const n=e.exports,{Buffer:o}=r(8287);n.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"},n.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},n.requiredHeaderFlagsErrors={};for(const e in n.requiredHeaderFlags){const t=n.requiredHeaderFlags[e];n.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+n.types[e]+" packet"}n.codes={};for(const e in n.types){const t=n.types[e];n.codes[t]=e}n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=o.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=o.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=o.from([n.codes.connect<<n.CMD_SHIFT]),n.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},n.propertiesCodes={};for(const e in n.properties){const t=n.properties[e];n.propertiesCodes[t]=e}function i(e){return[0,1,2].map(t=>[0,1].map(r=>[0,1].map(i=>{const s=o.alloc(1);return s.writeUInt8(n.codes[e]<<n.CMD_SHIFT|(r?n.DUP_MASK:0)|t<<n.QOS_SHIFT|i,0,!0),s})))}n.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"},n.PUBLISH_HEADER=i("publish"),n.SUBSCRIBE_HEADER=i("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=i("unsubscribe"),n.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},n.SUBACK_HEADER=o.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=o.from([3]),n.VERSION4=o.from([4]),n.VERSION5=o.from([5]),n.VERSION131=o.from([131]),n.VERSION132=o.from([132]),n.QOS=[0,1,2].map(e=>o.from([e])),n.EMPTY={pingreq:o.from([n.codes.pingreq<<4,0]),pingresp:o.from([n.codes.pingresp<<4,0]),disconnect:o.from([n.codes.disconnect<<4,0])},n.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"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.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"},n.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"},n.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"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:l}=e;l.items=!0;const c=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${c} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(l,i)){const i=r.var("valid",n._`${c} <= ${t.length}`);r.if((0,n.not)(i),()=>function(i){r.forRange("i",t.length,c,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),l.allErrors||r.if((0,n.not)(i),()=>r.break())})}(i)),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5568:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.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];l.push(new h(e,t)),1!==l.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5670:(e,t,r)=>{"use strict";const n=r(8287),o=r(9584),i=r(2635);let s,a,l;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const c=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let 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}(t,e);s=wx.connectSocket({url:c,protocols:[r]}),a=function(){const e=new o.Transform;return e._write=(e,t,r)=>{s.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{s.close({success(){e()}})},e}(),l=new i.BufferedDuplex(t,a,s),l._destroy=(e,t)=>{s.close({success(){t&&t(e)}})};const u=l.destroy;return l.destroy=(e,t)=>(l.destroy=u,setTimeout(()=>{s.close({fail(){l._destroy(e,t)}})},0),l),s.onOpen(()=>{l.socketReady()}),s.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?n.Buffer.from(t):n.Buffer.from(t,"utf8"),a.push(t)}),s.onClose(()=>{l.emit("close"),l.end(),l.destroy()}),s.onError(e=>{const t=new Error(e.errMsg);l.destroy(t)}),l}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function c(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(l(e,t,r))):i}function u(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(c(r,o,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map(o=>(0,n.and)(c(e,t,o,r.ownProperties),n._`${i} = ${o}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${l(e,t,r)}`:i},t.noPropertyInData=c,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter(r=>!(0,o.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:l},c,u,f){const d=f?n._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const p=n._`${d}, ${r.object(...h)}`;return u!==n.nil?n._`${c}.call(${u}, ${p})`:n._`${c}(${p})`};const f=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?f:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(s){const l=t.const("len",n._`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)})}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,o.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},l);t.assign(a,n._`${a} || ${l}`),e.mergeValidEvaluated(s,l)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},5767:(e,t,r)=>{"use strict";var n=r(2682),o=r(9209),i=r(487),s=r(6556),a=r(5795),l=r(3628),c=s("Object.prototype.toString"),u=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,d=o(),h=s("String.prototype.slice"),p=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},m={__proto__:null};n(d,u&&a&&l?function(e){var t=new f[e];if(Symbol.toStringTag in t&&l){var r=l(t),n=a(r,Symbol.toStringTag);if(!n&&r){var o=l(r);n=a(o,Symbol.toStringTag)}m["$"+e]=i(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(m["$"+e]=i(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=h(c(e),8,-1);return p(d,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(m,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return a?function(e){var t=!1;return n(m,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}},5769:(e,t,r)=>{const n=r(5606),o=r(8287),{isReadable:i,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(5980),p=r(577),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=r(2074),{destroyer:b}=r(1787),_=r(7323),w=r(2729),v=r(8601),{createDeferredPromise:S}=r(7797),E=r(1401),A=globalThis.Blob||o.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(4469);class R extends _{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function P(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,o,a,l,c,u=!!i(t),f=!!s(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&b(t,e),d(e)}),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(o){const e=o;o=null,e()}})),u&&(p(t,e=>{u=!1,e&&b(t,e),d(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new m),a=null,n=null,o=null,null===l?i(e):(l=i,b(r,e),b(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return P({readable:t});if(u(t))return P({writable:t});if(l(t))return P({writable:!1,readable:!1});if(d(t))return P({readable:w.fromWeb(t)});if(h(t))return P({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:s}=function(e){let{promise:t,resolve:r}=S();const o=new I,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(i.aborted)throw new m(void 0,{cause:i.reason});({promise:t,resolve:r}=S()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:o,final:i,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{b(t,e)});return t=new R({objectMode:!0,readable:!1,write:o,final(e){i(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return P({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{b(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)})}};t.default=o},5880:e=>{"use strict";e.exports=Math.pow},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},5980:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(4469),s=i("nodejs.stream.destroyed"),a=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(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 m(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||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function _(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!_(e)&&h(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!_(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 k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:_,kIsDestroyed:s,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,o,i,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0: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 m(e)?!(!_(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return m(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:m,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;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return m(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:k,willEmitClose:function(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),l=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,l=t.let("valid",!1),c=t.let("passing",null),u=t.name("_valid");e.setParams({passing:c}),t.block(function(){a.forEach((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(n._`${u} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${i}]`).else(),t.if(u,()=>{t.assign(l,!0),t.assign(c,i),a&&e.mergeEvaluated(a,n.Name)})})}),e.result(l,()=>e.reset(),()=>e.error(!0))}};t.default=i},6171:(e,t,r)=>{const n=r(1072),o=r(9372),i=r(8665),s=r(7007),{nanoid:a}=r(3561);class l extends s{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:o=a(8),broker:s="mqtts://broker.hivemq.com:8883",log:c="console",bestEffort:u=!1,version:f="",mqttClientId:d=null}={}){super(),this._validateDomain(n),this._validateAgent(o),this._username=e,this._password=t,this._token=r,this._agent=o,this._domain=n,this._broker=s,this._qos=u?0:1,this._version=f,this._mqttClientId=d||`va3${l._createHash(this._domain+this._agent)}`,"console"===c?(this._log=console,this._log.debug=()=>{}):this._log=c,this._baseTopic=`${this._domain}/${this._agent}`,i.onCallback(this._handleVrpcCallback.bind(this)),this._isolatedInstances=new Map,this._sharedInstances=new Map,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=a()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=o.connect(this._broker,this._options),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){try{if(!this._client||!this._client.connected)return void this.emit("end");const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});const e=this._getClasses();for(const t of e){const e=`${this._baseTopic}/${t}/__classInfo__`;this._mqttPublish(e,null,{retain:!0})}}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:3})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t){this._client.subscribe(e,{qos:this._qos,...t},(r,n)=>{if(r)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${r.message}`);else{const o=Array.isArray(e)?e:[e],i=n.filter(e=>128===e.qos).map(e=>e.topic);i.length>0&&((r=new Error(`Could not subscribe all ${o.length} topic(s) but got error qos=128 on following ${i.length} topic(s): ${i}`)).code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r),this.emit("error",r));const s=n.filter(e=>e.qos<this._qos);s.length>0&&((r=new Error(`Could not subscribe all ${o.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`)).code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r),this.emit("error",r)),0===n.length&&this._log.debug(`Already subscribed to topic '${e}'`)}})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return i._getClassesArray()}_getInstances(e){return i._getInstancesArray(e)}_getMemberFunctions(e){return i._getMemberFunctionsArray(e)}_getStaticFunctions(e){return i._getStaticFunctionsArray(e)}_getMetaData(e){return i._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._client.connected?e():(this._client.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:o,a:i}=e,s=r.startsWith("__e__")?r.slice(5):t;try{this._log.debug(`Forwarding callback to: ${s} with payload:`,e),this._mqttPublish(s,l._stringifySafely({a:i,r:n,e:o,i:r,v:3}))}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${s} because of: ${e.message}`)}}static _stringifySafely(e){let t;const{c:r,f:n}=e;try{t=JSON.stringify(e)}catch(o){this._log.debug(`Failed serialization of return value for: ${r}::${n}, because: ${o.message}`),e.r="__vrpc::not-serializable__",t=JSON.stringify(e)}return t}_handleConnect(){this._log.info("[OK]");try{const e=this._generateTopics();e.length>0&&this._mqttSubscribe(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}this._publishAgentInfoMessage(),this._getClasses().forEach(e=>{this._publishClassInfoMessage(e)});for(const[e,{className:t}]of i._instances.entries())this._subscribeToMethodsOfNewInstance(t,e);this.emit("connect")}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:3};try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();return t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})}),e}_handleMessage(e,t){try{const r=JSON.parse(t.toString());this._log.debug(`Message arrived with topic: ${e} and payload:`,r);const n=e.split("/"),[,,o,s,a]=n;if(4===n.length&&"__clientInfo__"===n[3])return void this._handleClientInfoMessage(e,r);if(5!==n.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);switch(r.c="__static__"===s?o:s,r.f=a,i._call(r)&&this._mqttSubscribe(`${r.s}/__clientInfo__`),a){case"__createIsolated__":{const e=r.r;this._subscribeToMethodsOfNewInstance(o,e),this._registerIsolatedInstance(e,r.s);break}case"__createShared__":{const e=r.r;this._hasSharedInstance(e)||(this._subscribeToMethodsOfNewInstance(o,e),this._publishClassInfoMessage(o)),this._registerSharedInstance(e,r.s);break}case"__delete__":this._unsubscribeMethodsOfDeletedInstance(o,s),this._unregisterInstance(r.a[0],r.s)&&this._publishClassInfoMessage(o)}const{a:c,r:u,e:f,i:d,v:h}=r,p=f?{a:c,r:u,e:f,i:d,v:h}:{a:c,r:u,i:d,v:h};this._mqttPublish(r.s,l._stringifySafely(p))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){i._unregisterClient(r);const e=this._isolatedInstances.get(r);e&&e.forEach(e=>{const t={f:"__delete__",a:[e],r:null,s:i.LOCAL_SENDER};i._call(t),t.r&&this._log.debug(`Auto-deleted isolated instance: ${e}`)}),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):(this._isolatedInstances.set(t,new Set([e])),this._sharedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.info(`Tracking lifetime of client: ${t}`))}_registerSharedInstance(e,t){const r=this._sharedInstances.get(t);r?r.add(e):(this._sharedInstances.set(t,new Set([e])),this._isolatedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${t}`))}_hasSharedInstance(e){for(const[,t]of this._sharedInstances)if(t.has(e))return!0;return!1}_unregisterInstance(e,t){const r=this._isolatedInstances.get(t);if(r&&r.has(e))return r.delete(e),0===r.size&&(this._isolatedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)),!1;let n=!1;return this._sharedInstances.forEach(async r=>{r.has(e)&&(n=!0,r.delete(e),0===r.size&&(this._sharedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)))}),!!n||(this._log.warn(`Failed un-registering not registered instance: ${e}`),!1)}_subscribeToMethodsOfNewInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=l},6172:(e,t,r)=>{const{Buffer:n}=r(8287),o={},i=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:o,generateCache:function(){for(let e=0;e<65536;e++)o[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const o=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),i?o.subarray(0,r):o.slice(0,r)},generate4ByteBuffer:function(e){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6188:e=>{"use strict";e.exports=Math.max},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6269:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(4469);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(2074).codes,s=r(7323),{getHighWaterMark:a}=r(2100);n(c.prototype,s.prototype),n(c,s);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}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 f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},6357:(e,t,r)=>{"use strict";const{pipeline:n}=r(4867),o=r(7323),{destroyer:i}=r(1787),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(5980),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(2074),g=r(577);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,b,_,w;const v=e[0],S=n(e,function(e){const t=_;_=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||d(S)||u(S));if(w=new o({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;g(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(b){const e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{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,t){e||null===_||(e=new h),b=null,r=null,y=null,null===_?t(e):(_=t,s(S)&&i(S,e))},w}},6364:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:o,codes:i}=r(9157),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=i,{kEmptyObject:l,once:c}=r(9862),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:h}=r(4947),{Promise:p,PromisePrototypeThen:m,SymbolDispose:g}=r(2768),{isClosed:y,isReadable:b,isReadableNodeStream:_,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:P,kIsClosedPromise:T}=r(6801);let $;const x=()=>{};function j(e,t,i){var h,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),f(i,"callback"),u(t.signal,"options.signal"),i=c(i),w(e)||k(e))return function(e,t,i){let s=!1,a=x;if(t.signal)if(a=()=>{s=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{$=$||r(9862).addAbortListener;const n=$(t.signal,a),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>i.apply(e,t))};return m(e[T].promise,l,l),x}(e,t,i);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const j=null!==(h=t.readable)&&void 0!==h?h:_(e),N=null!==(p=t.writable)&&void 0!==p?p:A(e),C=e._writableState,M=e._readableState,L=()=>{e.writable||B()};let D=P(e)&&_(e)===j&&A(e)===N,F=I(e,!1);const B=()=>{F=!0,e.destroyed&&(D=!1),(!D||e.readable&&!j)&&(j&&!U||i.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(D=!1),(!D||e.writable&&!N)&&(N&&!F||i.call(e))},q=t=>{i.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?i.call(e,t):j&&!U&&_(e,!0)&&!v(e,!1)?i.call(e,new a):!N||F||I(e,!1)?void i.call(e):i.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?N&&!C&&(e.on("end",L),e.on("close",L)):(e.on("complete",B),D||e.on("abort",z),e.req?G():e.on("request",G)),D||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=C&&C.errorEmitted||null!=M&&M.errorEmitted?D||n.nextTick(H):(j||D&&!b(e)||!F&&!1!==E(e))&&(N||D&&!E(e)||!U&&!1!==b(e))?M&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{i=x,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",L),e.removeListener("close",L),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=i;K(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{$=$||r(9862).addAbortListener;const n=$(t.signal,s),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}}return K}e.exports=j,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p((r,o)=>{const i=j(e,t,e=>{n&&i(),e?o(e):r()})})}},6370:()=>{},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),l=r(3025),c=r(9713),u=r(8660),f=r(117),d=r(5333),h=r(7923),p=r(6505),m=r(6163),g=r(5844),y=r(1239),b=r(4426);t.default=function(e=!1){const t=[h.default,p.default,m.default,g.default,y.default,b.default,c.default,u.default,l.default,f.default,d.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),o=r(3126),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),o=r(8452);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6585:e=>{var t=1e3,r=60*t,n=60*r,o=24*n,i=7*o;function s(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\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(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=o?s(l,c,o,"day"):c>=n?s(l,c,n,"hour"):c>=r?s(l,c,r,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6644:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:l,parentSchema:c,it:u}=e,{oneOf:f}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!f)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),p=t.const("tag",n._`${r}${(0,n.getProperty)(d)}`);function m(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${p} == "string"`,()=>function(){const r=function(){var e;const t={},r=o(c);let n=!0;for(let t=0;t<f.length;t++){let c=f[t];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){const e=c.$ref;if(c=i.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof i.SchemaEnv&&(c=c.schema),void 0===c)throw new s.default(u.opts.uriResolver,u.baseId,e)}const h=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[d];if("object"!=typeof h)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||o(c)),l(h,t)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(d)}function l(e,t){if(e.const)h(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const r of e.enum)h(r,t)}}function h(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${p} === ${e}`),t.assign(h,m(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:p,tagName:d}),t.endIf()}(),()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:p,tagName:d})),e.ok(h)}};t.default=l},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6801:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(2768),s=i("nodejs.stream.destroyed"),a=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(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 m(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||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function _(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!_(e)&&h(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!_(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 k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:_,kIsDestroyed:s,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,o,i,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0: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 m(e)?!(!_(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return m(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:m,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;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return m(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:k,willEmitClose:function(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},6887:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.isReactNativeBrowser=t.isWebWorker=void 0;const o=()=>Boolean("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&"undefined"==typeof Deno),i=()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product,s="undefined"!=typeof window&&("undefined"!=typeof navigator&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&n?.versions?!Object.prototype.hasOwnProperty.call(n.versions,"electron"):void 0!==window.document)||o()||i();t.isWebWorker=o(),t.isReactNativeBrowser=i(),t.default=s},6891:(e,t,r)=>{"use strict";var n,o=r(2045);e.exports=k,k.ReadableState=A,r(7007).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},a=r(1396),l=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(7199);i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,d,h,p=r(1766),m=r(4347),g=r(6644).getHighWaterMark,y=r(2463).F,b=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(k,a);var S=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(e,t,o){n=n||r(8101),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3141).I),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function k(e){if(n=n||r(8101),!(this instanceof k))return new k(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function I(e,t,r,n,o){i("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,$(e)))}}(e,a);else if(o||(s=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)a.endEmitted?S(e,new v):O(e,a,t,!0);else if(a.ended)S(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):x(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,x(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),x(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=m.destroy,k.prototype._undestroy=m.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),I(this,e,t,!1,r)},k.prototype.unshift=function(e){return I(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){f||(f=r(3141).I);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var R=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick($,e))}function $(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function x(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){i("readable nexttick read 0"),e.read(0)}function M(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(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);var r}function F(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):T(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){S(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===o.stdout||e===o.stderr?m:l;function l(){i("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",function t(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",f),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var u=!1;function f(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),m(),e.removeListener("error",d),0===s(e,"error")&&S(e,t)}function h(){e.removeListener("finish",p),m()}function p(){i("onfinish"),e.removeListener("close",h),m()}function m(){i("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?T(this):n.reading||o.nextTick(C,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(N,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(N,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(M,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5034)),d(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=D,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===h&&(h=r(968)),h(k,e,t)})},6897:(e,t,r)=>{"use strict";var n=r(453),o=r(41),i=r(592)(),s=r(5795),a=r(9675),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var u=s(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},6912:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(4959)),i=n(r(5228)),s=n(r(495)),a=n(r(1021)),l=n(r(4264)),c=r(4723);t.default=(e,t,r,n)=>{const{options:u}=e,f=u.properties?.maximumPacketSize,d=1+(e=>e<128?1:e<16384?2:e<2097152?3:4)(h=t.length)+h;var h;if(5===u.protocolVersion&&f&&f<d)return e.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",t.cmd,d,f),n?.discardParsedPackets(),e._cleanUp(!0),r(),e.emit("error",new c.ErrorWithReasonCode(`exceeding packets size ${t.cmd}: ${d} bytes, maximumPacketSize is ${f}`,149)),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,o.default)(e,t,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing();try{(0,a.default)(e,t)}finally{r()}break;case"pubrel":e.reschedulePing(),(0,l.default)(e,t,r);break;case"connack":try{(0,s.default)(e,t,n)}finally{r()}break;case"auth":e.reschedulePing();try{(0,i.default)(e,t,n)}finally{r()}break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(l))return!0;if("object"==typeof r&&l(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=c(e)),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=h(t));const n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=f;const d=/#\/?$/;function h(e){return e?e.replace(d,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,r){return r=h(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=h(e[r]||t),a={"":s},l=u(n,s,!1),c={},f=new Set;return i(e,{allKeys:!0},(e,t,n,o)=>{if(void 0===o)return;const i=l+t;let s=a[o];function u(t){const r=this.opts.uriResolver.resolve;if(t=h(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(e,n.schema,t):t!==h(i)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=i),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s}),c;function d(e,t,r){if(void 0!==t&&!o(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},6968:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){p("SOCKS connection to %s:%d via %s",e,t,r);const o=new m;return async function(e,t,r,n,o={}){const i=o.lookup??(0,d.promisify)(f.lookup),[s,a]=function(e){const t=new URL(e);if(t.pathname||t.hash||t.search)throw g(new Error("bad SOCKS URL"));const[r,n]=function(e){switch(e){case"socks5h:":return[5,!0];case"socks4a:":return[4,!0];case"socks5:":return[5,!1];case"socks4:":return[4,!1];default:return[void 0,!1]}}(t.protocol);if(!r)throw g(new Error("bad SOCKS URL: invalid protocol"));const o=parseInt(t.port,10);if(Number.isNaN(o))throw g(new Error("bad SOCKS URL: invalid port"));return[{host:t.hostname,port:o,type:r},n]}(r);a||(p("resolving %s locally",e),e=(await i(e,{family:4===s.type?4:0})).address),p("establishing SOCKS%d connection to %s:%d via %s:%d",s.type,e,t,s.host,s.port);const l=new u.SocksClient({command:"connect",destination:{host:e,port:t},proxy:{...s},timeout:o.timeout});l.connect(),l.on("established",({socket:e})=>n._start(e)),l.on("error",e=>{p("SOCKS failed: %s",e),n.destroy(g(e))})}(e,t,r,o,n).catch(e=>{p("SOCKS failed: %s",e),o.destroy(e)}),o};const l=a(r(7833)),c=r(8310),u=r(9122),f=s(r(9288)),d=r(537),h=a(r(4148)),p=(0,l.default)("mqttjs:socks");class m extends c.Duplex{_flowing=!1;_socket;constructor(){super({autoDestroy:!1}),this.cork()}_start(e){p("proxy stream started"),(0,h.default)(!this._socket),this.destroyed?e.destroy(this.errored):(this._socket=e,this._flowing||e.pause(),e.on("data",this._onData),e.on("end",this._onEnd),e.on("error",this._onError),e.on("close",this._onClose),e.emit("connect"),this.uncork())}_write(e,t,r){(0,h.default)(this._socket),this._socket.write(e,r)}_read(e){this._flowing=!0,this._socket?.resume?.()}_destroy(e,t){this._socket?.destroy?.(e),t(e)}_onData=e=>{(0,h.default)(this._socket),this._flowing=this.push(e),this._flowing||this._socket.pause()};_onEnd=()=>{p("proxy stream received EOF"),this.push(null)};_onClose=()=>{p("proxy stream closed"),this.destroy()};_onError=e=>{p("proxy stream died with error %s",e),this.destroy(e)}}function g(e){try{return void 0===e.code&&(e.code="SOCKS"),e}catch{return e}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,s,c;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}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 f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):p(o,o.length)}function h(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 m(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 o(i){n.once&&e.removeEventListener(t,o),r(i)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=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||o(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 l(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){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=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(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(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||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 o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);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 d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),l=r(4003),c=r(1163),u=r(617),f=r(7935),d=r(8643),h=[n.default,o.default,i.default,s.default,a.default,l.default,c.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,d.default];t.default=h},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,o,i,s,a,l,c,u,f,d){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in o(s,a,l,c,u,f,d),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)r(e,o,i,p[m],a+"/"+h+"/"+m,l,a,h,s,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)r(e,o,i,p[g],a+"/"+h+"/"+n(g),l,a,h,s,g)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,o,i,p,a+"/"+h,l,a,h,s)}i(s,a,l,c,u,f,d)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,o=r(3126),i=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&i&&i(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},7199:()=>{},7244:(e,t,r)=>{"use strict";var n=r(9092)(),o=r(6556)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},s=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},a=function(){return i(arguments)}();i.isLegacyArguments=s,e.exports=a?i:s},7302:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:s}=r(9157),{Symbol:a}=r(2768),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(6801),d=a("kDestroy"),h=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t,r){let o=!1;function i(t){if(o)return;o=!0;const i=e._readableState,s=e._writableState;p(t,s,i),s&&(s.closed=!0),i&&(i.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(y,e)}try{e._destroy(t||null,i)}catch(t){i(t)}}function g(e,t){b(e,t),y(e)}function y(e){const 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){const 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 _(e,t,r){const o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),r?n.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function r(r){if(t)return void _(e,null!=r?r:new i);t=!0;const o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(d,r):r?_(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(h)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(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?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,i=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?m(this,e,t):this.once(d,function(r){m(this,o(r,e),t)}),this)},undestroy:function(){const 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:_}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,l="maxLength"===t?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${c} ${l} ${s}`)}};t.default=s},7323:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:s}=r(4469);e.exports=c;const a=r(2729),l=r(8601);s(c.prototype,a.prototype),s(c,a);{const e=i(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.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}let u,f;function d(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.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 d().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5769)),f(e,"body")}},7396:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),o=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,o,{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++){const 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){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(e>this.length||e<0)return;const 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,r,o){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof o||o>this.length)&&(o=this.length),r>=this.length)return e||n.alloc(0);if(o<=0)return e||n.alloc(0);const i=!!e,s=this._offset(r),a=o-r;let l=a,c=i&&t||0,u=s[1];if(0===r&&o===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-u)return i?this._bufs[s[0]].copy(e,t,u,u+l):this._bufs[s[0]].slice(u,u+l);i||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-u;if(!(l>r)){this._bufs[t].copy(e,c,u,u+l),c+=r;break}this._bufs[t].copy(e,c,u),c+=r,l-=r,u&&(u=0)}return e.length>c?e.slice(0,c):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();const r=this._offset(e),n=this._offset(t),o=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),0!==r[1]&&(o[0]=o[0].slice(r[1])),this._new(o)},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(){const 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,r){if(null==e)return this;if(e.buffer)t.call(this,n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){const[n,o]=r?[e.length-1,-1]:[0,1];for(let i=n;i>=0&&i<e.length;i+=o)this._attach(e[i],t,r)}else if(this._isBufferList(e)){const[n,o]=r?[e._bufs.length-1,-1]:[0,1];for(let i=n;i>=0&&i<e._bufs.length;i+=o)this._attach(e._bufs[i],t,r)}else"number"==typeof e&&(e=e.toString()),t.call(this,n.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,r){if(void 0===r&&"string"==typeof t&&(r=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=n.from([e]):"string"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.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;const o=this._offset(t);let i=o[0],s=o[1];for(;i<this._bufs.length;i++){const t=this._bufs[i];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([i,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([i,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(){const 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(const 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[o]},e.exports=i},7419:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},7487:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=a(e),s=i[0],l=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,f=l>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(c(e,a,a+s>l?l:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(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 l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(l(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7602:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(2768);e.exports=N,N.WritableState=x;const{EventEmitter:h}=r(7007),p=r(8745).Stream,{Buffer:m}=r(8287),g=r(7302),{addAbortSignal:y}=r(5121),{getHighWaterMark:b,getDefaultHighWaterMark:_}=r(3513),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(9157).codes,{errorOrDestroy:P}=g;function T(){}c(N.prototype,p.prototype),c(N,p);const $=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,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,j(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[$]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function N(e){const t=this instanceof r(2648);if(!t&&!s(N,this))return new N(e);this._writableState=new x(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,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new R(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=T)}if(null===t)throw new I;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return i.ending?s=new O:i.destroyed&&(s=new A("write")),s?(n.nextTick(o,s),P(e,s,!0),s):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const 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:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==T&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),U(t),P(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(L,e,r,t,i):L(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(F,r.afterWriteTickInfo)):B(e,r,1,i))):P(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(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&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[$].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?T:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===a?r:o(r,a);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),j(t)}else{do{const{chunk:n,encoding:o,callback:s}=r[a];r[a++]=null,M(e,t,!1,i?1:n.length,n,o,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(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,r){q(t)&&(function(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 r=!1;function o(o){if(r)P(e,null!=o?o:S());else if(r=!0,t.pendingcb--,o){const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e](o);P(e,o,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},a(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(N,d,{__proto__:null,value:function(e){return!!s(this,e)||this===N&&e&&e._writableState instanceof x}}),N.prototype.pipe=function(){P(this,new E)},N.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},N.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!m.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},N.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},N.prototype._writev=null,N.prototype.end=function(e,t,r){const o=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof i&&(s=r)}return o.corked&&(o.corked=1,this.uncork()),s||(o.errored||o.ending?o.finished?s=new k("end"):o.destroyed&&(s=new A("end")):(o.ending=!0,V(this,o,!0),o.ended=!0)),"function"==typeof r&&(s||o.finished?n.nextTick(r,s):o[$].push(r)),this},l(N.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(){const 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(){const 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)}}});const H=g.destroy;let G;function K(){return void 0===G&&(G={}),G}N.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[$].length)&&n.nextTick(U,r),H.call(this,e,t),this},N.prototype._undestroy=g.undestroy,N.prototype._destroy=function(e,t){t(e)},N.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},N.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},N.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7653:(e,t,r)=>{"use strict";var n=r(8452),o=r(487),i=r(9211),s=r(9394),a=r(6576),l=o(s(),Object);n(l,{getPolyfill:s,implementation:i,shim:a}),e.exports=l},7712:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(2074),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(1580),d=r(4469).Symbol("kWeak"),h=r(4469).Symbol("kResistStopPropagation"),{finished:p}=r(577),m=r(6357),{addAbortSignalNoValidate:g}=r(982),{isWritable:y,isNodeStream:b}=r(5980),{deprecate:_}=r(7797),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:P}=r(4469),T=P("kEmpty"),$=P("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=S(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(7797).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,m()}function m(){h-=1,g()}function g(){f&&!d&&h<n&&a.length<o&&(f(),f=null)}!async function(){try{for await(let t of s){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===T)continue;t=O(t)}catch(e){t=I(e)}h+=1,R(t,m,p),a.push(t),u&&(u(),u=null),!d&&(a.length>=o||h>=n)&&await new k(e=>{f=e})}a.push($)}catch(e){const t=I(e);R(t,m,p),a.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===$)return;if(i.aborted)throw new l;e!==T&&(yield e),a.shift(),g()}await new k(e=>{u=e})}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of N.call(this,e,t))return!0;return!1}function N(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,async function(t,r){return await e(t,r)?t:T},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:_(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({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&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:N,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!y(e))throw new o("stream",e,"must be writable");const r=m(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.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(const r of x.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let m=!1;try{for await(const n of this){var g;if(m=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!m&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of N.call(this,e,t))return r}}},7720:(e,t,r)=>{"use strict";var n=r(4765),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=1024;e.exports={arrayToObject:a,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"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(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(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<a.length;u+=l){for(var f=a.length>=l?a.slice(u,u+l):a,d=[],h=0;h<f.length;++h){var p=f.charCodeAt(h);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||i===n.RFC1738&&(40===p||41===p)?d[d.length]=f.charAt(h):p<128?d[d.length]=s[p]:p<2048?d[d.length]=s[192|p>>6]+s[128|63&p]:p<55296||p>=57344?d[d.length]=s[224|p>>12]+s[128|p>>6&63]+s[128|63&p]:(h+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(h)),d[d.length]=s[240|p>>18]+s[128|p>>12&63]+s[128|p>>6&63]+s[128|63&p])}c+=d.join("")}return c},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(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach(function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r}),t):Object.keys(r).reduce(function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t},s)}}},7732:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const a=r(9993),l=s(r(6887)),c={set:a.setInterval,clear:a.clearInterval},u={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};t.default=e=>{switch(e){case"native":return u;case"worker":return c;default:return!l.default||l.isWebWorker||l.isReactNativeBrowser?u:c}}},7797:(e,t,r)=>{"use strict";const n=r(8287),{format:o,inspect:i}=r(2858),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(2074),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(4469),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,d=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||n.Blob,p=void 0!==h?function(e){return e instanceof h}:function(e){return!1},m=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,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:o,inspect:i,types:{isAsyncFunction:e=>e instanceof d,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return m(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{m(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7829:(e,t,r)=>{"use strict";const n=r(9037),o=r(3942),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},7833:(e,t,r)=>{var n=r(2045);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i||(t.UsedValueState=i={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const l=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,n.setValue(t,{property:o,itemIndex:l}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let l=n.nil;for(const c in e){const u=e[c];if(!u)continue;const f=s[c]=s[c]||new Map;u.forEach(e=>{if(f.has(e))return;f.set(e,i.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=n._`${l}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);l=n._`${l}${s}${this.opts._n}`}f.set(e,i.Completed)})}return l}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:l}=e;if(void 0===r)return;const c=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${c}`);let u=n._`${c} === undefined`;"empty"===l.useDefaults&&(u=n._`${u} || ${c} === null || ${c} === ""`),i.if(u,n._`${c} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>i(e,r,t.default))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:l}=e;s||l&&"object"==typeof l?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${l} !== ${r}`)}};t.default=s},7969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9584),o={objectMode:!0},i={clean:!0};t.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...i,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(o),t=[];let r=!1,i=0;return this._inflights.forEach((e,r)=>{t.push(e)}),e._read=()=>{!r&&i<t.length?e.push(t[i++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){const 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){const 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()}}},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),o=r(487),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8101:(e,t,r)=>{"use strict";var n=r(2045),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(6891),s=r(1999);r(6698)(u,i);for(var a=o(s.prototype),l=0;l<a.length;l++){var c=a[l];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},8184:(e,t,r)=>{"use strict";var n=r(6556),o=r(9721)(/^\s*(?:function)?\*/),i=r(9092)(),s=r(3628),a=n("Object.prototype.toString"),l=n("Function.prototype.toString"),c=r(4233);e.exports=function(e){if("function"!=typeof e)return!1;if(o(l(e)))return!0;if(!i)return"[object GeneratorFunction]"===a(e);if(!s)return!1;var t=c();return t&&s(e)===t.prototype}},8203:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.streamBuilder=t.browserStreamBuilder=void 0;const o=r(8287),i=n(r(1591)),s=n(r(7833)),a=r(9584),l=n(r(6887)),c=r(2635),u=(0,s.default)("mqttjs:ws"),f=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function d(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){const t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),l.default||e.forceNativeWebSocket||"wss"!==e.protocol||f.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}t.streamBuilder=(e,t)=>{u("streamBuilder");const r=h(t);r.hostname=r.hostname||r.host||"localhost";const n=d(r,e),o=function(e,t,r){u("createWebSocket"),u(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";let o;return u(`creating new Websocket for url: ${t} and protocol: ${n}`),o=r.createWebsocket?r.createWebsocket(t,[n],r):new i.default(t,[n],r.wsOptions),o}(0,n,r),s=i.default.createWebSocketStream(o,r.wsOptions);return s.url=n,o.on("close",()=>{s.destroy()}),s},t.browserStreamBuilder=(e,t)=>{let r;u("browserStreamBuilder");const n=function(e){const t=h(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const 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),i=n.browserBufferSize||524288,s=t.browserBufferTimeout||1e3,l=!t.objectMode,f=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=d(t,e);let o;return o=t.createWebsocket?t.createWebsocket(n,[r],t):new WebSocket(n,[r]),o.binaryType="arraybuffer",o}(e,t),p=function(e){const t=new a.Transform({objectMode:e.objectMode});return t._write=function e(t,r,n){if(f.bufferedAmount>i)return void setTimeout(e,s,t,r,n);l&&"string"==typeof t&&(t=o.Buffer.from(t,"utf8"));try{f.send(t)}catch(e){return n(e)}n()},t._flush=function(e){f.close(),e()},t}(t);t.objectMode||(p._writev=c.writev.bind(p)),p.on("close",()=>{f.close()});const m=void 0!==f.addEventListener;function g(){u("WebSocket onOpen"),r instanceof c.BufferedDuplex&&r.socketReady()}function y(e){u("WebSocket onClose",e),r.end(),r.destroy()}function b(e){u("WebSocket onError",e);const t=new Error("WebSocket error");t.event=e,r.destroy(t)}async function _(e){if(!p||!p.readable||!p.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?o.Buffer.from(t):t instanceof Blob?o.Buffer.from(await new Response(t).arrayBuffer()):o.Buffer.from(t,"utf8"),p.push(t)}return f.readyState===f.OPEN?(r=p,r.socket=f):(r=new c.BufferedDuplex(t,p,f),m?f.addEventListener("open",g):f.onopen=g),m?(f.addEventListener("close",y),f.addEventListener("error",b),f.addEventListener("message",_)):(f.onclose=y,f.onerror=b,f.onmessage=_),r}},8287:(e,t,r)=>{"use strict";const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(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 f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(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(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const o=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.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 u(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 f(e){return u(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(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,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(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);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:H(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,o){let i,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 c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return K(G(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(i=l));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:r=e[o+1],n=e[o+2],a=e[o+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&&(i=l))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"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(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.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 o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const 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)y(this,t,t+1);return this},l.prototype.swap32=function(){const 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)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const 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)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.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===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(i,s),c=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==u[e]){i=c[e],s=u[e];break}return i<s?-1:s<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.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)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function T(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function $(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function x(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 j(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;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,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;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 M(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const 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);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),l.prototype.readBigUInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const 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)}),l.prototype.readBigInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const 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)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeBigUInt64LE=X(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=X(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeBigInt64LE=X(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=X(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.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)return 0;if(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);const o=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),o},l.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&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const 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 o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=l.isBuffer(e)?e:l.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%s]}return this};const F={};function B(e,t,r){F[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 U(e){let t="",r=e.length;const 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 W(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function q(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=U(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=U(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8310:(e,t,r)=>{e.exports=o;var n=r(7007).EventEmitter;function o(){n.call(this)}r(6698)(o,n),o.Readable=r(6891),o.Writable=r(1999),o.Duplex=r(8101),o.Transform=r(9083),o.PassThrough=r(3681),o.finished=r(4257),o.pipeline=r(5267),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",l));var s=!1;function a(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:o,recomposeAuthority:i,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:l}=r(4834),{SCHEMES:c,getSchemeHandler:u}=r(343);function f(e,t,r,n){const i={};return n||(e=p(d(e,r),r),t=p(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=u(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&s.push(r.scheme,":");const l=i(r);if(void 0!==l&&("suffix"!==n.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){const r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let i=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const s=e.match(h);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(!1===a(o.host)){const e=n(o.host);o.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||void 0!==o.query||o.path?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const t=u(r.scheme||o.scheme);if(!(r.unicodeSupport||t&&t.unicodeSupport)&&o.host&&(r.domainHost||t&&t.domainHost)&&!1===i&&l(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),void 0!==o.host&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),t&&t.parse&&t.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=d(p(e,t),t):"object"==typeof e&&(e=p(d(e,t),t)),e},resolve:function(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=f(p(e,n),p(t,n),n,!0);return n.skipEscape=!0,d(o,n)},resolveComponent:f,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=d(s(p(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=d(s(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=d(s(p(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=d(s(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:p};e.exports=m,e.exports.default=m,e.exports.fastUri=m},8389:function(e,t){!function(e){"use strict";var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,o=1073741824,i=new WeakMap,s=function(e,t){return function(i){var s=t.get(i),a=void 0===s?i.size:s<o?s+1:0;if(!i.has(a))return e(i,a);if(i.size<n){for(;i.has(a);)a=Math.floor(Math.random()*o);return e(i,a)}if(i.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;i.has(a);)a=Math.floor(Math.random()*r);return e(i,a)}}((t=i,function(e,r){return t.set(e,r),r}),i),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s}(t)},8403:(e,t,r)=>{"use strict";var n=r(1189),o=r(1333)(),i=r(6556),s=r(9612),a=i("Array.prototype.push"),l=i("Object.prototype.propertyIsEnumerable"),c=o?s.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=s(e);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var u=s(arguments[i]),f=n(u),d=o&&(s.getOwnPropertySymbols||c);if(d)for(var h=d(u),p=0;p<h.length;++p){var m=h[p];l(u,m)&&a(f,m)}for(var g=0;g<f.length;++g){var y=f[g];if(l(u,y)){var b=u[y];r[y]=b}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,s=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=s.call(i,Object.getOwnPropertySymbols(t)));for(var a=0;a<i.length;a+=1)c(e,i[a],t[i[a]],r[i[a]])};u.supportsDescriptors=!!l,e.exports=u},8577:(e,t,r)=>{var n=r(2045);const o=r(1072),{nanoid:i}=r(3561),s=r(9372),a=r(7007),l=r(3530);class c extends a{constructor({token:e,password:t,username:r,domain:n,agent:o="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:c=12e3,log:u="console",bestEffort:f=!0,mqttClientId:d=null,identity:h=null,keepalive:p=30,requiresSchema:m=!1,tls:g=null}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(o.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(h&&h.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=d){if("string"!=typeof d||0===d.length)throw new Error("The mqttClientId must be a non-empty string");if(d.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=o,this._domain=n,this._broker=s,this._timeout=c,this._identity=h,this._keepalive=p,this._qos=this._qos=f?0:1,this._requiresSchema=m,this._instance=i(8),this._mqttClientId=d||this._createMqttClientId(),this._tls=g,this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=i(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._subscribeRetrier=new l({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log}),this._callbackIds=new WeakMap,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}static _tlsOptions(e){if(!e)return{rejectUnauthorized:!1};const t={rejectUnauthorized:!1!==e.rejectUnauthorized};return e.ca&&(t.ca=e.ca),t}async connect(){if(this._client&&this._client.connected)return;let e=this._username,t=this._password;this._token&&(e=e||this._generateUserName(),t=this._token);const r={username:e,password:t,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,...c._tlsOptions(this._tls),connectTimeout:this._timeout,reconnectOnConnackError:!0,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===e&&delete r.username,void 0===t&&delete r.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,r),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t)=>{if(0!==t.length)try{const r=e.split("/"),[n,o,i,s]=r;if(n!==this._domain)return void this._log.warn(`Received message from foreign domain: ${n}`);if("__agentInfo__"===i){const{status:e,hostname:r,version:i}=JSON.parse(t.toString());this._createIfNotExist(o),this._agents[o].status=e,this._agents[o].hostname=r,this._agents[o].version=i,"offline"===e&&this._clearCachedSubscriptions({lostAgent:o}),this.emit("agent",{domain:n,agent:o,status:e,hostname:r,version:i})}else if("__classInfo__"===s||"__classInfoConcise__"===s){const e=JSON.parse(t.toString());this._createIfNotExist(o);const r=this._agents[o].classes[i],s=e.instances||[],a=r?r.instances:[],l=a.filter(e=>!s.includes(e)),c=s.filter(e=>!a.includes(e));this._agents[o].classes[i]=e;const{className:u,instances:f,memberFunctions:d,staticFunctions:h,meta:p}=e;0!==l.length&&(this.emit("instanceGone",l,{domain:n,agent:o,className:u}),l.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:o,className:u}))),0!==c.length&&this.emit("instanceNew",c,{domain:n,agent:o,className:u}),this.emit("class",{domain:n,agent:o,className:u,instances:f,memberFunctions:d,staticFunctions:h,meta:p||{}})}else{const{i:e,a:r,e:n,r:o}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:o})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),new Promise((e,t)=>{const r=setTimeout(()=>{this._client.end(!0,()=>{t(new Error(`Connection trial timed out (> ${this._timeout} ms)`))})},this._timeout);this._client.once("connect",()=>{clearTimeout(r),e()})})}async create({className:e,instance:t=i(8),args:r=[],agent:n=this._agent,cacheProxy:o=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},l=await this._getProxy(n,e,a);return t&&o&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:l}),l}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:o}=await this._getInstanceData(e,t);return this._createProxy(n,o,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),o={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},i=`${this._domain}/${r}/${n}/__static__/__delete__`;return this._mqttPublish(i,JSON.stringify(o)),delete this._proxies[`${r}/${n}/${e}`],this._handleAgentAnswer(o,r)}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!o)return;const i={c:e,f:t,a:o,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},s=`${this._domain}/${n}/${e}/__static__/${t}`;return await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(i)),this._handleAgentAnswer(i,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};if("*"===n){const n=[],i=this.getAvailableAgents();for(const s of i){const i=`${this._domain}/${s}/${e}/__static__/__callAll__`,a=await this._wrapArguments({agent:s,className:e,functionName:t,args:r});if(!a)continue;o.a=[t,...a],await this._waitUntilClassIsOnline(s,e),this._mqttPublish(i,JSON.stringify(o));const l=await this._handleAgentAnswer(o,s);n.push(...l)}return n}const i=`${this._domain}/${n}/${e}/__static__/__callAll__`,s=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(s)return o.a=[t,...s],await this._waitUntilClassIsOnline(n,e),this._mqttPublish(i,JSON.stringify(o)),this._handleAgentAnswer(o,n)}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){return this._token=e,this._agent=t,this._client&&await new Promise(e=>this._client.end(!1,{},e)),this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r){const r=`${this._domain}/${e}/${t}/__classInfo__`;this._mqttPublish(r,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:3})),this._eventEmitter.removeAllListeners(),this.removeAllListeners();const e=this._client;return this._client=null,new Promise(t=>e.end(!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_getCallbackId(e,{readOnly:t=!1}={}){if(!this._callbackIds.has(e)){if(t)return null;this._callbackIds.set(e,i(8))}return this._callbackIds.get(e)}_generateUserName(){return`${this._domain}:client@${o.hostname()}-${o.platform()}-js`}_createMqttClientId(){const e=o.arch()+o.homedir()+o.hostname()+JSON.stringify(o.networkInterfaces())+o.platform()+o.release()+o.totalmem()+o.type(),t=c._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${o.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect()))})}async _mqttSubscribe(e,t){return new Promise((r,n)=>{this._client.subscribe(e,{qos:this._qos,...t},(o,i)=>{if(o){if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${o.message}`),"client disconnecting"===o.message){const e=`Failed to subscribe, because: ${o.message}`;this._log.error(e),this.emit("error",o),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect(),n(new Error(e))}}else{const n=Array.isArray(e)?e:[e],s=i.filter(e=>128===e.qos).map(e=>e.topic);s.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${s.length} topic(s): ${s}`)).code="SUBSCRIBE_FAILED",o.subscribeOptions=t,this._log.error(o.message),this.emit("error",o),this._subscribeRetrier.schedule(s,t)),this._subscribeRetrier.granted(i.filter(e=>128!==e.qos).map(e=>e.topic));const a=i.filter(e=>e.qos<this._qos);a.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${a.length} topic(s): ${JSON.stringify(a)}`)).code="SUBSCRIBE_REDUCED_QOS",o.subscribeOptions=t,this._log.warn(o.message),this.emit("error",o)),0===i.length&&this._log.debug(`Already subscribed to: ${e}`),r()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i:o}=r,i=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(i,JSON.stringify(r)),new Promise((r,i)=>{const s=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(o),i(new Error(s))},this._timeout);this._eventEmitter.once(o,({e:o,r:s})=>{if(clearTimeout(a),o){const{message:r,cause:s}=c._prepareError(o);i(new Error(`[vrpc ${e}-${t}-${n}]: ${r}`,{cause:s}))}else{const n=this._createProxy(e,t,s);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let o=null;const i=()=>{this._hasClassOnline(e,t)&&(o&&clearTimeout(o),this.removeListener("class",i),r())};o=setTimeout(()=>{this.removeListener("class",i),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",i)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,o=`${this._instance}-${this._proxyId++}`,i={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:o};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{i[s]="removeAllListeners"!==s?async(...i)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:s,args:i});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async t=>{if(!t)throw new Error("VRPC does not support removing all listeners");Object.keys(this._cachedSubscriptions).filter(e=>{const n=this._cachedSubscriptions[e];return n.instance===r&&n.event===t}).forEach(e=>{const t=`__e__${e}`;this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]});try{const o={c:r,f:s,a:[t],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(o)),this._handleAgentAnswer(o,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(i.vrpcOn=async(i,...s)=>{if(!a.has(i))throw new Error("Bad magic");const l=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:"vrpcOn",args:[i,...s]});if(l)try{const t={c:r,f:i,a:l.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${i}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${i}" because: ${e.message}`)}},i.vrpcOff=n=>{const o=`__e__${this._domain}/${e}/${t}/${r}-${n}`;this._eventEmitter.removeAllListeners(o)}),i}async _handleAgentAnswer({i:e,c:t,f:r},n){return new Promise((o,i)=>{const s=`Function call "${t}::${r}()" on agent "${n}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(e),i(new Error(s))},this._timeout);this._eventEmitter.once(e,e=>{if(clearTimeout(a),e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else{const s=e.r;"string"==typeof s&&"__p__"===s.substring(0,5)?this._eventEmitter.once(s,e=>{if(e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else o(e.r)}):o(s)}})})}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const o=n=>(i,{agent:s,className:a})=>{if(i.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",o),r({agent:s,className:a,instance:e})}},i=setTimeout(()=>{this.removeListener("instanceNew",o(i));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",o(i))})}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:o,args:i}){const s=[],a=/^(on|notify|monitor|signal)/.test(o),l=/^(off|remove|unmonitor|unsignal)/.test(o);for(const[c,u]of i.entries()){if(this._isFunction(u)){const f=u;if("vrpcOn"===o||"on"===o&&1===c&&"string"==typeof i[0]||a){const n="string"==typeof i[0]?i[0]:o,a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:f});s.push(a);continue}if(("off"===o||"removeListener"===o)&&1===c&&"string"==typeof i[0]||l){const e=await this._offRemoteEvent({callback:f});if(!e&&("off"===o||"removeListener"===o))return null;s.push(e||null);continue}{const r=`__f__${n||`${e}-${t}`}-${o}-${c}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;s.push(r),this._eventEmitter.once(r,({a:e})=>u.apply(null,e));continue}}if(this._isEmitter(u)){const{emitter:n,event:o}=u;let i=(...e)=>n.emit(o,...e);if(this._emitterListener.has(n)){const e=this._emitterListener.get(n);e.has(o)?i=e.get(o):e.set(o,i)}else this._emitterListener.set(n,new Map([[o,i]]));const a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:o,callback:i});s.push(a);continue}s.push(u)}return s}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:o}){const i=`${e}-${t}-${r||"__static__"}-${n}-${this._getCallbackId(o)}`,s=c._createHash(i,12),a=`${this._vrpcConnectionId}/${s}`,l=`__e__${a}`,u=({a:e})=>o.apply(null,e);return 0===this._eventEmitter.listenerCount(l)&&this._eventEmitter.on(l,u),this._cachedSubscriptions[a]?this._cachedSubscriptions[a].listeners.push({callback:o,handler:u}):this._cachedSubscriptions[a]={agent:e,className:t,instance:r,event:n,listeners:[{callback:o,handler:u}]},l}async _offRemoteEvent({callback:e}){if(!this._getCallbackId(e,{readOnly:!0}))return null;let t=null;return Object.keys(this._cachedSubscriptions).forEach(r=>{const n=`__e__${r}`,o=this._cachedSubscriptions[r],i=o.listeners.findIndex(t=>t.callback===e);-1!==i&&(o.listeners.splice(i,1),0===o.listeners.length&&(delete this._cachedSubscriptions[r],this._eventEmitter.removeAllListeners(n)),t=n)}),t}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){Object.keys(this._cachedSubscriptions).filter(o=>{const i=this._cachedSubscriptions[o];return void 0!==e?i.agent===e:i.instance===t&&i.agent===r&&i.className===n}).forEach(e=>{const t=`__e__${e}`;this._log.debug(`Clearing subscriptions for obsolete topic: ${e}`),this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._getInstanceFromCache(e,t);if(!r){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return r}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:o}=r[n];if(o&&o.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:o}=this._agents[r];if(n&&"offline"!==o)for(const o in n){if(t.className&&o!==t.className)continue;const{instances:i}=n[o];if(i&&i.includes(e))return{agent:r,className:o,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=c},8601:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(4469);e.exports=N,N.WritableState=x;const{EventEmitter:h}=r(7007),p=r(4474).Stream,{Buffer:m}=r(8287),g=r(1787),{addAbortSignal:y}=r(982),{getHighWaterMark:b,getDefaultHighWaterMark:_}=r(2100),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(2074).codes,{errorOrDestroy:P}=g;function T(){}c(N.prototype,p.prototype),c(N,p);const $=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,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,j(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[$]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function N(e){const t=this instanceof r(7323);if(!t&&!s(N,this))return new N(e);this._writableState=new x(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,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new R(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=T)}if(null===t)throw new I;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return i.ending?s=new O:i.destroyed&&(s=new A("write")),s?(n.nextTick(o,s),P(e,s,!0),s):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const 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:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==T&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),U(t),P(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(L,e,r,t,i):L(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(F,r.afterWriteTickInfo)):B(e,r,1,i))):P(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(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&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[$].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?T:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===a?r:o(r,a);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),j(t)}else{do{const{chunk:n,encoding:o,callback:s}=r[a];r[a++]=null,M(e,t,!1,i?1:n.length,n,o,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(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,r){q(t)&&(function(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 r=!1;function o(o){if(r)P(e,null!=o?o:S());else if(r=!0,t.pendingcb--,o){const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e](o);P(e,o,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},a(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(N,d,{__proto__:null,value:function(e){return!!s(this,e)||this===N&&e&&e._writableState instanceof x}}),N.prototype.pipe=function(){P(this,new E)},N.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},N.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!m.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},N.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},N.prototype._writev=null,N.prototype.end=function(e,t,r){const o=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof i&&(s=r)}return o.corked&&(o.corked=1,this.uncork()),s||(o.errored||o.ending?o.finished?s=new k("end"):o.destroyed&&(s=new A("end")):(o.ending=!0,V(this,o,!0),o.ended=!0)),"function"==typeof r&&(s||o.finished?n.nextTick(r,s):o[$].push(r)),this},l(N.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(){const 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(){const 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)}}});const H=g.destroy;let G;function K(){return void 0===G&&(G={}),G}N.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[$].length)&&n.nextTick(U,r),H.call(this,e,t),this},N.prototype._undestroy=g.undestroy,N.prototype._destroy=function(e,t){t(e)},N.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},N.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},N.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8636:(e,t,r)=>{"use strict";var n=r(920),o=r(7720),i=r(4765),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},m=function e(t,r,i,s,a,c,f,d,m,g,y,b,_,w,v,S,E,A){for(var k,I=t,O=A,R=0,P=!1;void 0!==(O=O.get(p))&&!P;){var T=O.get(t);if(R+=1,void 0!==T){if(T===R)throw new RangeError("Cyclic object value");P=!0}void 0===O.get(p)&&(R=0)}if("function"==typeof g?I=g(r,I):I instanceof Date?I=_(I):"comma"===i&&l(I)&&(I=o.maybeMap(I,function(e){return e instanceof Date?_(e):e})),null===I){if(c)return m&&!S?m(r,h.encoder,E,"key",w):r;I=""}if("string"==typeof(k=I)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||o.isBuffer(I))return m?[v(S?r:m(r,h.encoder,E,"key",w))+"="+v(m(I,h.encoder,E,"value",w))]:[v(r)+"="+v(String(I))];var $,x=[];if(void 0===I)return x;if("comma"===i&&l(I))S&&m&&(I=o.maybeMap(I,m)),$=[{value:I.length>0?I.join(",")||null:void 0}];else if(l(g))$=g;else{var j=Object.keys(I);$=y?j.sort(y):j}var N=d?String(r).replace(/\./g,"%2E"):String(r),C=s&&l(I)&&1===I.length?N+"[]":N;if(a&&l(I)&&0===I.length)return C+"[]";for(var M=0;M<$.length;++M){var L=$[M],D="object"==typeof L&&L&&void 0!==L.value?L.value:I[L];if(!f||null!==D){var F=b&&d?String(L).replace(/\./g,"%2E"):String(L),B=l(I)?"function"==typeof i?i(C,F):C:C+(b?"."+F:"["+F+"]");A.set(t,R);var U=n();U.set(p,A),u(x,e(D,B,i,s,a,c,f,d,"comma"===i&&S&&l(I)?null:m,g,y,b,_,w,v,S,E,U))}}return x};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"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 r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,o=i.formatters[r],c=h.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:c,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(r=c.filter);var f=[];if("object"!=typeof o||null===o)return"";var d=a[c.arrayFormat],p="comma"===d&&c.commaRoundTrip;r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var g=n(),y=0;y<r.length;++y){var b=r[y],_=o[b];c.skipNulls&&null===_||u(f,m(_,b,d,p,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=f.join(c.delimiter),v=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:l,it:c}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=c.opts.loopEnum;let f;const d=()=>null!=f?f:f=(0,o.useFunc)(t,i.default);let h;if(u||s)h=t.let("valid"),e.block$data(h,function(){t.assign(h,!1),t.forOf("v",l,e=>t.if(n._`${d()}(${r}, ${e})`,()=>t.assign(h,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);h=(0,n.or)(...a.map((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${d()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o)))}e.pass(h)}};t.default=s},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:f,opts:d}=u;if(u.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(u,r))return;const h=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${l}[${e}]`)}function g(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(f||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(u,r)){const r=t.name("valid");"failing"===d.removeAdditional?(y(n,r,!1),t.if((0,o.not)(r),()=>{e.reset(),m(n)})):(y(n,r),f||t.if((0,o.not)(r),()=>t.break()))}}}function y(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",l,r=>{h.length||p.length?t.if(function(r){let i;if(h.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=h.length?(0,o.or)(...h.map(e=>o._`${r} === ${e}`)):o.nil;return p.length&&(i=(0,o.or)(i,...p.map(t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,o.not)(i)}(r),()=>g(r)):g(r)}),e.ok(o._`${c} === ${i.default.errors}`)}};t.default=a},8665:(e,t,r)=>{const n=r(3282),o=r(7007),{nanoid:i}=r(3561),s="__global__",a="vrpc";class l{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let o=l._extractStaticFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),o.push("__createIsolated__"),o.push("__createShared__"),o.push("__callAll__"),o.push("__delete__");let i=l._extractMemberFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),l._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:o,memberFunctions:i,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[a]||(window[a]={}),window[a][t]=e;const r=l._functionRegistry.get(s),n=r?[...r.staticFunctions,t]:[t];l._functionRegistry.set(s,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let o=l._extractMemberFunctions(e);n&&(o=o.filter(e=>!e.startsWith("_"))),l._functionRegistry.has(t)||l._functionRegistry.set(t,{memberFunctions:o,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),l._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=i(8),args:r=[],isIsolated:n=!1}={}){const o={c:e,a:[t,...r]},s=n?l._handleCreateIsolated(o):l._handleCreateShared(o);if(o.e)throw new Error(o.e);return s}static delete(e){if("string"==typeof e)return l._delete(e);if("object"==typeof e){for(const[t,r]of l._instances)if(r.instance===e)return l._instances.delete(t),!0;return!1}}static getInstance(e){const t=l._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return l._getClassesArray()}static getAvailableInstances(e){return l._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return l._call(t),JSON.stringify(t)}static onCallback(e){l._callback=e}static on(e,t){l._emitter.on(e,t)}static once(e,t){l._emitter.once(e,t)}static off(e,t){l._emitter.off(e,t)}static removeAllListeners(e){l._emitter.removeAllListeners(e)}static _call(e){switch(l._mustTrackClient=!1,e.f){case"__createIsolated__":l._handleCreateIsolated(e);break;case"__createShared__":l._handleCreateShared(e);break;case"__callAll__":l._handleCallAll(e);break;case"__delete__":l._handleDelete(e);break;default:l._handleCall(e)}return l._mustTrackClient}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==l.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i){if(!i.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return l._assertOwner(i,e,n),e.r=n,i.instance}t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),l._emitter.emit("create",{args:o,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=t.message}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i&&i.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,l._emitter.emit("create",{args:o,className:r,isIsolated:!1,instance:n})}catch(t){e.e=t.message}return t}static _handleCallAll(e){try{const t=[];for(const[r,{className:n,instance:o,isIsolated:i}]of l._instances){if(n!==e.c||i)continue;let s=!0,a=null;try{const t=l._unwrapArguments(e,r);t&&(s=o[t[0]].apply(o,t.slice(1)),s=l.sanitizeEventListenerReturnValues(s))}catch(e){a=e.message}l._isPromise(s)?t.push(s.then(e=>({id:r,val:e,err:null})).catch(e=>({id:r,err:e,val:null}))):t.push({id:r,val:s,err:a})}this._handlePromise(e,Promise.allSettled(t).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=t.message}}static sanitizeEventListenerReturnValues(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}static _handleDelete(e){try{const t=e.a[0];l._assertOwner(l._instances.get(t),e,t),l._emitter.emit("beforeDelete",{instance:t,className:e.c}),e.r=l._delete(t),l._emitter.emit("delete",{instance:t,className:e.c})}catch(t){e.e=t.message}}static _handleCall(e){try{l._assertOwner(l._instances.get(e.c),e,e.c)}catch(t){const{message:r,cause:n}=t;return void(e.e={message:r,cause:n})}if("removeAllListeners"===e.f)return l._removeAllListeners(e.a[0],e.s,e.c),void(e.r=!0);const t=l._unwrapArguments(e);if(!t)return void(e.r=!0);if(e.c===s){try{const r=window[a][e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}return}const r=l._functionRegistry.get(e.c);if(void 0!==r){const{Klass:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find static function: ${e.f}`);try{const r=n[e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}else{const r=l._instances.get(e.c);if(void 0===r)throw new Error(`Could not find context: ${e.c}`);const{instance:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find member function: ${e.f}`);try{let r=n[e.f].apply(n,t);r=l.sanitizeEventListenerReturnValues(r),l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}}static _create(e,t,...r){const n=l._instances.get(t);if(n)return n.instance;const{Klass:o,withNew:i,schema:s}=l._getClassEntry(e);return null!==s&&l._validate(s,...r),i?new o(...r):o(...r)}static _delete(e){const t=l._instances.get(e);return!!t&&(l._isFunction(t.removeAllListeners)&&t.removeAllListeners(),delete l._listeners[e],l._instances.delete(e),!0)}static _unregisterClient(e){Object.entries(l._listeners).forEach(([t,r])=>{Object.entries(r).forEach(([r,n])=>{const{clients:o,listener:i,event:s}=n,a=o.indexOf(e);if(-1!==a&&(o.splice(a,1),0===o.length)){const e=l.getInstance(t);e&&e.removeListener&&e.removeListener(s,i),delete l._listeners[t][r]}})})}static _validate(e,t){if(l._ajv||(l._ajv=new n({useDefaults:!0})),!l._ajv.validate(e,t))throw new Error(l._ajv.errorsText())}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,o=n?t:e.c,i=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const e of i)if("string"==typeof e)if(e.startsWith("__f__"))a.push(l._generateCallback({clientId:r,isCallAll:n,instanceId:o,eventId:e}));else if(e.startsWith("__e__"))if("on"===s||"addListener"===s){l._mustTrackClient=!0;const t=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:i[0]});if(!t)return null;a.push(t)}else if("off"===s||"removeListener"===s){const t=l._unregisterListener({clientId:r,instanceId:o,eventId:e});if(!t)return null;a.push(t)}else{l._mustTrackClient=!0;const t=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:null});a.push(t)}else a.push(e);else a.push(e);return a}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n}){return(...o)=>{const i=n?[r,...o]:[...o];l._callback({a:i,s:t,i:e})}}static _registerListener({eventId:e,clientId:t,instanceId:r,event:n,isCallAll:o}){return l._listeners[r]?l._listeners[r][e]?(l._listeners[r][e].clients.push(t),null):(l._listeners[r][e]={event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})},l._listeners[r][e].listener):(l._listeners[r]={[e]:{event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})}},l._listeners[r][e].listener)}static _generateListener({eventId:e,instanceId:t,isCallAll:r}){return(...n)=>{const o=r?[t,...n]:[...n];l._callback({a:o,i:e})}}static _unregisterListener({eventId:e,clientId:t,instanceId:r}){if(l._listeners[r]&&l._listeners[r][e]){const{listener:n,clients:o}=l._listeners[r][e],i=o.indexOf(t);if(-1!==i&&o.splice(i,1),0===o.length)return delete l._listeners[r][e],0===Object.keys(l._listeners[r]).length&&delete l._listeners[r],n}}static _removeAllListeners(e,t,r){const n=l._listeners[r];n&&Object.entries(n).forEach(([n,o])=>{o.event===e&&o.clients.includes(t)&&(o.clients=o.clients.filter(e=>e!==t),0===o.clients.length&&(l.getInstance(r).removeListener(o.event,o.listener),delete l._listeners[r][n]))})}static _handlePromise(e,t){try{const r=l._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${r}`;e.r=n,t.then(t=>l._callback({...e,r:t,i:n})).catch(t=>l._callback({...e,e:t.message,i:n}))}catch(t){e.data.e=t.message}}static _getClassEntry(e){const t=l._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!l._blackList.has(e)&&l._isFunction(t.prototype[e]));r=[...r,...e]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!l._blackList.has(e)&&l._isFunction(t[e]));r=[...r,...e]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})],t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(l._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return l._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=l._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}l._functionRegistry=new Map,l._instances=new Map,l._emitter=new o,l._correlationId=0,l._listeners={},l._blackList=new Set(["caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),l.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=l},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,n._`[${r}]`),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){const{it:l}=e,{gen:u,compositeRule:f,allErrors:d}=l,h=c(e,r,o);(null!=i?i:f||d)?s(u,h):a(l,n._`[${h}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:l,compositeRule:u,allErrors:f}=o;s(l,c(e,r,n)),u||f||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",s,i.default.errors,s=>{e.const(l,n._`${i.default.vErrors}[${s}]`),e.if(n._`${l}.instancePath === undefined`,()=>e.assign(n._`${l}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath))),e.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${l}.schema`,r),e.assign(n._`${l}.data`,o))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[u(s,r),f(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:c,it:u}=e,{opts:f,propertyName:d,topSchemaRef:h,schemaPath:p}=u;o.push([l.keyword,s],[l.params,"function"==typeof t?t(e):t||n._`{}`]),f.messages&&o.push([l.message,"function"==typeof r?r(e):r]),f.verbose&&o.push([l.schema,c],[l.parentSchema,n._`${h}${p}`],[i.default.data,a]),d&&o.push([l.propertyName,d])}(e,t,a),o.object(...a)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[l.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},8745:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(2768),{EventEmitter:i}=r(7007);function s(e){i.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(s.prototype,i.prototype),o(s,i),s.prototype.pipe=function(e,t){const 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",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},8835:(e,t,r)=>{"use strict";var n=r(9655);function o(){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 i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(5373);function b(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var b=e=l.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=a.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=i.exec(b);if(w){var v=(w=w[0]).toLowerCase();this.protocol=v,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===b.substr(0,2);!S||w&&m[w]||(b=b.substr(2),this.slashes=!0)}if(!m[w]&&(S||w&&!g[w])){for(var E,A,k=-1,I=0;I<f.length;I++)-1!==(O=b.indexOf(f[I]))&&(-1===k||O<k)&&(k=O);for(-1!==(A=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(E=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(E)),k=-1,I=0;I<u.length;I++){var O;-1!==(O=b.indexOf(u[I]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var P=this.hostname.split(/\./),T=(I=0,P.length);I<T;I++){var $=P[I];if($&&!$.match(d)){for(var x="",j=0,N=$.length;j<N;j++)$.charCodeAt(j)>127?x+="x":x+=$[j];if(!x.match(d)){var C=P.slice(0,I),M=P.slice(I+1),L=$.match(h);L&&(C.push(L[1]),M.unshift(L[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+D,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!p[v])for(I=0,T=c.length;I<T;I++){var B=c[I];if(-1!==b.indexOf(B)){var U=encodeURIComponent(B);U===B&&(U=escape(B)),b=b.split(B).join(U)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[v]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var V=this.search||"";this.path=D+V}return this.href=this.format(),this},o.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||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var d=u[f];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",y=r.search||"";r.path=p+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||r.host&&e.pathname,v=w,S=r.pathname&&r.pathname.split("/")||[],E=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===S[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=h;else if(h.length)S||(S=[]),S.pop(),S=S.concat(h),r.search=e.search,r.query=e.query;else if(null!=e.search)return E&&(r.host=S.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,I=0,O=S.length;O>=0;O--)"."===(A=S[O])?S.splice(O,1):".."===A?(S.splice(O,1),I++):I&&(S.splice(O,1),I--);if(!w&&!v)for(;I--;I)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var R,P=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(r.hostname=P?"":S.length?S.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),(w=w||r.host&&S.length)&&!P&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=b(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},8859:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,w=String.prototype.toUpperCase,v=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,k=Array.prototype.slice,I=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,$="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,j=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-I(-e):I(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return _.call(o,r,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var C=r(2634),M=C.custom,L=z(M)?M:null,D={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,o=D[n];return o+e+o}function U(e){return _.call(String(e),/"/g,""")}function W(e){return!$||!("object"==typeof e&&($ in e||void 0!==e[$]))}function q(e){return"[object Array]"===K(e)&&W(e)}function V(e){return"[object RegExp]"===K(e)&&W(e)}function z(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,a){var l=n||{};if(G(l,"quoteStyle")&&!G(D,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!G(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?N(t,S):S}if("bigint"==typeof t){var I=String(t)+"n";return w?N(t,I):I}var R=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=R&&R>0&&"object"==typeof t)return q(t)?"[Array]":"[Object]";var M,F=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(l,o);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(a=k.call(a)).push(r),n){var i={depth:l.depth};return G(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,a)}return e(t,l,o+1,a)}if("function"==typeof t&&!V(t)){var Y=function(e){if(e.name)return e.name;var t=y.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ne=re(t,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ne.length>0?" { "+A.call(ne,", ")+" }":"")}if(z(t)){var oe=T?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(t);return"object"!=typeof t||T?oe:X(oe)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ie="<"+v.call(String(t.nodeName)),se=t.attributes||[],ae=0;ae<se.length;ae++)ie+=" "+se[ae].name+"="+B(U(se[ae].value),"double",l);return ie+=">",t.childNodes&&t.childNodes.length&&(ie+="..."),ie+"</"+v.call(String(t.nodeName))+">"}if(q(t)){if(0===t.length)return"[]";var le=re(t,H);return F&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,F)+"]":"[ "+A.call(le,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&W(e)}(t)){var ce=re(t,H);return"cause"in Error.prototype||!("cause"in t)||x.call(t,"cause")?0===ce.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(ce,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+H(t.cause),ce),", ")+" }"}if("object"==typeof t&&m){if(L&&"function"==typeof t[L]&&C)return C(t,{depth:R-o});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return s&&s.call(t,function(e,r){ue.push(H(r,t,!0)+" => "+H(e,t))}),ee("Map",i.call(t),ue,F)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var fe=[];return u&&u.call(t,function(e){fe.push(H(e,t))}),ee("Set",c.call(t),fe,F)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===K(e)&&W(e)}(t))return X(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return X(H(O.call(t)));if(function(e){return"[object Boolean]"===K(e)&&W(e)}(t))return X(p.call(t));if(function(e){return"[object String]"===K(e)&&W(e)}(t))return X(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&W(e)}(t)&&!V(t)){var de=re(t,H),he=j?j(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",me=!he&&$&&Object(t)===t&&$ in t?b.call(K(t),8,-1):pe?"Object":"",ge=(he||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(me||pe?"["+A.call(E.call([],me||[],pe||[]),": ")+"] ":"");return 0===de.length?ge+"{}":F?ge+"{"+te(de,F)+"}":ge+"{ "+A.call(de,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return H.call(e,t)}function K(e){return m.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 J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(b.call(e,0,t.maxStringLength),t)+n}var o=F[t.quoteStyle||"single"];return o.lastIndex=0,B(_.call(_.call(e,o,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(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":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):A.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=q(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=G(e,o)?t(e[o],e):""}var i,s="function"==typeof R?R(e):[];if(T){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)G(e,l)&&(r&&String(Number(l))===l&&l<e.length||T&&i["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof R)for(var c=0;c<s.length;c++)x.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,s=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=s(e),a=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(n&&e.length>0)for(var g=0;g<e.length;++g)d.push(String(g));else for(var y in e)p&&"prototype"===y||!o.call(e,y)||d.push(String(y));if(l)for(var b=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),_=0;_<u.length;++_)b&&"constructor"===u[_]||!o.call(e,u[_])||d.push(u[_]);return d}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=$(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=$(this.rhs,e,t),this}get names(){return T(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(x(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>P(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class b extends g{}b.kind="else";class _ extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(j(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=$(this.condition,e,t),this}get names(){const e=super.names;return T(e,this.condition),this.else&&P(e,this.else.names),e}}_.kind="if";class w extends g{}w.kind="for";class v extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=$(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class S extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=T(super.names,this.from);return T(e,this.to)}}class E extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=$(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class A extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}A.kind="func";class k extends m{render(e){return"return "+super.render(e)}}k.kind="return";class I extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class O extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}O.kind="catch";class R extends g{render(e){return"finally"+super.render(e)}}function P(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function T(e,t){return t instanceof n._CodeOrName?P(e,t.names):e}function $(e,t,r){return e instanceof n.Name?i(e):(o=e)instanceof n._Code&&o._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${L(e)}`}R.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new l(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new S(i,s,t,r),()=>n(s))}forOf(e,t,r,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(s,n._`${e}[${t}]`),r(s)})}return this._for(new E("of",i,s,t),()=>r(s))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new E("in",i,s,t),()=>r(s))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new I;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new O(e),t(e)}return r&&(this._currNode=n.finally=new R,this.code(r)),this._endBlockNode(O,R)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new A(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=j;const N=M(t.operators.AND);t.and=function(...e){return e.reduce(N)};const C=M(t.operators.OR);function M(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${L(t)} ${e} ${L(r)}`}function L(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(C)}},9032:(e,t,r)=>{"use strict";var n=r(7244),o=r(8184),i=r(5767),s=r(5680);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),f=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),h=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var m=a(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function b(e){return"[object Set]"===u(e)}function _(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===u(e)}function A(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),t.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==k&&(void 0===I.working&&(I.working=I(new k)),I.working?I(e):e instanceof k)}function R(e){return g(e,f)}function P(e){return g(e,d)}function T(e){return g(e,h)}function $(e){return l&&g(e,p)}function x(e){return c&&g(e,m)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=R,t.isStringObject=P,t.isBooleanObject=T,t.isBigIntObject=$,t.isSymbolObject=x,t.isBoxedPrimitive=function(e){return R(e)||P(e)||T(e)||$(e)||x(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9037:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:s}=r(4469),{promisify:{custom:a}}=r(7797),{streamReturningOperators:l,promiseReturningOperators:c}=r(7712),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(2074),f=r(6357),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(2100),{pipeline:p}=r(4867),{destroyer:m}=r(1787),g=r(577),y=r(3942),b=r(5980),_=e.exports=r(4474).Stream;_.isDestroyed=b.isDestroyed,_.isDisturbed=b.isDisturbed,_.isErrored=b.isErrored,_.isReadable=b.isReadable,_.isWritable=b.isWritable,_.Readable=r(2729);for(const v of i(l)){const S=l[v];function E(...e){if(new.target)throw u();return _.Readable.from(s(S,this,e))}o(E,"name",{__proto__:null,value:S.name}),o(E,"length",{__proto__:null,value:S.length}),o(_.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}o(I,"name",{__proto__:null,value:k.name}),o(I,"length",{__proto__:null,value:k.length}),o(_.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}_.Writable=r(8601),_.Duplex=r(7323),_.Transform=r(6269),_.PassThrough=r(519),_.pipeline=p;const{addAbortSignal:w}=r(982);_.addAbortSignal=w,_.finished=g,_.destroy=m,_.compose=f,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=h,o(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(g,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),_.Stream=_,_._isUint8Array=function(e){return e instanceof Uint8Array},_._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},9075:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:s}=r(2768),{Buffer:a}=r(8287),{inspect:l}=r(9862);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const 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 a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const 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}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,o=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(i(t,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}i(t,a,r-e),e-=a.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},9083:(e,t,r)=>{"use strict";e.exports=u;var n=r(2463).F,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(8101);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new o("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9096:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const o="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i=new Set,s="object"==typeof n&&n?n:{},a=(e,t,r,n)=>{"function"==typeof s.emitWarning?s.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let l=globalThis.AbortController,c=globalThis.AbortSignal;if(void 0===l){c=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new c;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==s.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,a("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))}}Symbol("type");const u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),f=e=>u(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?d:null:null;class d extends Array{constructor(e){super(e),this.fill(0)}}class h{heap;length;static#e=!1;static create(e){const t=f(e);if(!t)return[];h.#e=!0;const r=new h(e,t);return h.#e=!1,r}constructor(e,t){if(!h.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class p{#t;#r;#n;#o;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#f;#d;#h;#p;#m;#g;#y;#b;#_;#w;#v;#S;#E;static unsafeExposeInternals(e){return{starts:e.#_,ttls:e.#w,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#f,next:e.#d,prev:e.#h,get head(){return e.#p},get tail(){return e.#m},free:e.#g,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,r,n,o)=>e.#k(t,r,n,o),moveToTail:t=>e.#I(t),indexes:t=>e.#O(t),rindexes:t=>e.#R(t),isStale:t=>e.#P(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#i}get memoMethod(){return this.#s}get dispose(){return this.#n}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:c,dispose:d,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:_=0,sizeCalculation:w,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:O}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const R=t?f(t):Array;if(!R)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=b,this.maxEntrySize=_||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!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.#s=S,void 0!==v&&"function"!=typeof v)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=v,this.#S=!!v,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#d=new R(t),this.#h=new R(t),this.#p=0,this.#m=0,this.#g=h.create(t),this.#a=0,this.#l=0,"function"==typeof d&&(this.#n=d),"function"==typeof m?(this.#o=m,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#v=!!this.#n,this.#E=!!this.#o,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#r&&!u(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=u(n)||0===n?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!i.has(e))(e)&&(i.add(e),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,p))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#$(){const e=new d(this.#t),t=new d(this.#t);this.#w=e,this.#_=t,this.#x=(r,n,i=o.now())=>{if(t[r]=0!==n?i:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout(()=>{this.#P(r)&&this.#j(this.#u[r],"expire")},n+1);e.unref&&e.unref()}},this.#N=r=>{t[r]=0!==e[r]?o.now():0},this.#C=(o,i)=>{if(e[i]){const s=e[i],a=t[i];if(!s||!a)return;o.ttl=s,o.start=a,o.now=r||n();const l=o.now-a;o.remainingTTL=s-l}};let r=0;const n=()=>{const e=o.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=o=>{const i=this.#c.get(o);if(void 0===i)return 0;const s=e[i],a=t[i];return s&&a?s-((r||n())-a):1/0},this.#P=o=>{const i=t[o],s=e[o];return!!s&&!!i&&(r||n())-i>s}}#N=()=>{};#C=()=>{};#x=()=>{};#P=()=>!1;#T(){const e=new d(this.#t);this.#l=0,this.#b=e,this.#M=t=>{this.#l-=e[t],e[t]=0},this.#L=(e,t,r,n)=>{if(this.#A(t))return 0;if(!u(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),!u(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#D=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#l>r;)this.#F(!0)}this.#l+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#M=e=>{};#D=(e,t,r)=>{};#L=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#B(t)&&(!e&&this.#P(t)||(yield t),t!==this.#p);)t=this.#h[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;this.#B(t)&&(!e&&this.#P(t)||(yield t),t!==this.#m);)t=this.#d[t]}#B(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#O())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*rentries(){for(const e of this.#R())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*keys(){for(const e of this.#O()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#R()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*values(){for(const e of this.#O())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}*rvalues(){for(const e of this.#R())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#O()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==o&&e(o,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(const r of this.#O()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}rforEach(e,t=this){for(const r of this.#R()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}purgeStale(){let e=!1;for(const t of this.#R({allowStale:!0}))this.#P(t)&&(this.#j(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const r=this.#f[t],n=this.#A(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#w&&this.#_){const e=this.#w[t],r=this.#_[t];if(e&&r){const t=e-(o.now()-r);i.ttl=t,i.start=Date.now()}}return this.#b&&(i.size=this.#b[t]),i}dump(){const e=[];for(const t of this.#O({allowStale:!0})){const r=this.#u[t],n=this.#f[t],i=this.#A(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const s={value:i};if(this.#w&&this.#_){s.ttl=this.#w[t];const e=o.now()-this.#_[t];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=o.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#L(e,t,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#j(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#m:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#F(!1):this.#a,this.#u[u]=e,this.#f[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#h[u]=this.#m,this.#m=u,this.#a++,this.#D(u,c,a),a&&(a.set="add"),l=!1;else{this.#I(u);const r=this.#f[u];if(t!==r){if(this.#S&&this.#A(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#v&&this.#n?.(t,e,"set"),this.#E&&this.#y?.push([t,e,"set"]))}else i||(this.#v&&this.#n?.(r,e,"set"),this.#E&&this.#y?.push([r,e,"set"]));if(this.#M(u),this.#D(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#A(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#w||this.#$(),this.#w&&(l||this.#x(u,n,o),a&&this.#C(a,u)),!i&&this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#f[this.#p];if(this.#F(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#F(e){const t=this.#p,r=this.#u[t],n=this.#f[t];return this.#S&&this.#A(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(n,r,"evict"),this.#E&&this.#y?.push([n,r,"evict"])),this.#M(t),e&&(this.#u[t]=void 0,this.#f[t]=void 0,this.#g.push(t)),1===this.#a?(this.#p=this.#m=0,this.#g.length=0):this.#p=this.#d[t],this.#c.delete(r),this.#a--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#c.get(e);if(void 0!==o){const e=this.#f[o];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#P(o))return r&&this.#N(o),n&&(n.has="hit",this.#C(n,o)),!0;n&&(n.has="stale",this.#C(n,o))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#c.get(e);if(void 0===n||!r&&this.#P(n))return;const o=this.#f[n];return this.#A(o)?o.__staleWhileFetching:o}#k(e,t,r,n){const o=void 0===t?void 0:this.#f[t];if(this.#A(o))return o;const i=new l,{signal:s}=r;s?.addEventListener("abort",()=>i.abort(s.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:n},c=(n,o=!1)=>{const{aborted:s}=i.signal,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!o?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!o)return u(i.signal.reason);const c=f;return this.#f[t]===f&&(void 0===n?c.__staleWhileFetching?this.#f[t]=c.__staleWhileFetching:this.#j(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,a.options))),n},u=n=>{const{aborted:o}=i.signal,s=o&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=f;if(this.#f[t]===f&&(l&&void 0!==c.__staleWhileFetching?s||(this.#f[t]=c.__staleWhileFetching):this.#j(e,"fetch")),a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};r.status&&(r.status.fetchDispatched=!0);const f=new Promise((t,n)=>{const s=this.#i?.(e,o,a);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),n),i.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})}).then(c,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),d=Object.assign(f,{__abortController:i,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#f[t]=d,d}#A(e){if(!this.#S)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:p,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#S)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:h,ignoreFetchAbort:d,status:g,signal:y};let _=this.#c.get(e);if(void 0===_){g&&(g.fetch="miss");const t=this.#k(e,_,b,p);return t.__returned=t}{const t=this.#f[_];if(this.#A(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#P(_);if(!m&&!o)return g&&(g.fetch="hit"),this.#I(_),n&&this.#N(_),g&&this.#C(g,_),t;const i=this.#k(e,_,b,p),s=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=o?"stale":"refresh",s&&o&&(g.returnedStale=!0)),s?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#s;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&void 0!==s)return s;const a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#f[s],a=this.#A(t);return i&&this.#C(i,s),this.#P(s)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(o||this.#j(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#N(s),t))}i&&(i.get="miss")}#U(e,t){this.#h[t]=e,this.#d[e]=t}#I(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#h[e],this.#d[e]),this.#U(this.#m,e),this.#m=e)}delete(e){return this.#j(e,"delete")}#j(e,t){let r=!1;if(0!==this.#a){const n=this.#c.get(e);if(void 0!==n)if(r=!0,1===this.#a)this.#W(t);else{this.#M(n);const r=this.#f[n];if(this.#A(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(r,e,t),this.#E&&this.#y?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#f[n]=void 0,n===this.#m)this.#m=this.#h[n];else if(n===this.#p)this.#p=this.#d[n];else{const e=this.#h[n];this.#d[e]=this.#d[n];const t=this.#d[n];this.#h[t]=this.#h[n]}this.#a--,this.#g.push(n)}}if(this.#E&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return r}clear(){return this.#W("delete")}#W(e){for(const t of this.#R({allowStale:!0})){const r=this.#f[t];if(this.#A(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#v&&this.#n?.(r,n,e),this.#E&&this.#y?.push([r,n,e])}}if(this.#c.clear(),this.#f.fill(void 0),this.#u.fill(void 0),this.#w&&this.#_&&(this.#w.fill(0),this.#_.fill(0)),this.#b&&this.#b.fill(0),this.#p=0,this.#m=0,this.#g.length=0,this.#l=0,this.#a=0,this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}t.LRUCache=p},9122:()=>{},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var s in o)i+=s;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9157:(e,t,r)=>{"use strict";const{format:n,inspect:o}=r(1077),{AggregateError:i}=r(2768),s=globalThis.AggregateError||i,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const 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 h(e,t,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return f(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[a]=!0,u[e]=o}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class m 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"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?i.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const e=i.pop();n+=`one of type ${i.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${o(r,{depth:-1})}`}else{let e=o(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),h("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=o(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),h("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),h("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const 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:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),h("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=d(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=d(n)),n+="n"}else n=o(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:m,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},9209:(e,t,r)=>{"use strict";var n=r(6578),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9214:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:m}=r(2768);e.exports=G,G.ReadableState=H;const{EventEmitter:g}=r(7007),{Stream:y,prependListener:b}=r(8745),{Buffer:_}=r(8287),{addAbortSignal:w}=r(5121),v=r(6364);let S=r(9862).debuglog("stream",e=>{S=e});const E=r(9075),A=r(7302),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(3513),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:T,ERR_STREAM_PUSH_AFTER_EOF:$,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:j}=r(9157),{validateObject:N}=r(4947),C=m("kPaused"),{StringDecoder:M}=r(7419),L=r(2070);u(G.prototype,y.prototype),u(G,y);const D=()=>{},{errorOrDestroy:F}=A,B=1,U=16,W=32,q=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 H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),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 M(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(2648);this._readableState=new H(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&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const o=e._readableState;let i;if(0===(o.state&B)&&("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=_.from(t,r).toString(o.encoding):(t=_.from(t,r),r=""))):t instanceof _?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new R("chunk",["string","Buffer","Uint8Array"],t))),i)F(e,i);else if(null===t)o.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,o);else if(0!==(o.state&B)||t&&t.length>0)if(n)if(4&o.state)F(e,new x);else{if(o.destroyed||o.errored)return!1;Q(e,o,t,!0)}else if(o.ended)F(e,new $);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?Q(e,o,t,!1):Z(e,o)):Q(e,o,t,!1)}else n||(o.state&=-9,Z(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function Q(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&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("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,oe(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oe(e),t.flowing&&!t.reading&&e.read(0)}function oe(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function ie(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=D;function o(t){this===e?(n(),n=D):n=t}e.on("readable",o);const i=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=D});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(o)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",o),i()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(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 ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("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)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),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=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:i(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new T("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 S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,o=!!(64&t.state);if(S("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,S("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,S("reading, ended or constructing",o);else if(o){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(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&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new P("_read()")},G.prototype.pipe=function(e,t){const r=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),S("pipe count=%d opts=%j",o.pipes.length,t);const i=t&&!1===t.end||e===n.stdout||e===n.stderr?m:s;function s(){S("onend"),e.end()}let a;o.endEmitted?n.nextTick(i):r.once("end",i),e.on("unpipe",function t(n,i){S("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,S("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",u),l=!0,a&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(S("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(S("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),m(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),m()}function p(){S("onfinish"),e.removeListener("close",h),m()}function m(){S("unpipe"),r.unpipe(e)}return r.on("data",u),b(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():o.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=o(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){const r=y.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,S("on readable",o.length,o.reading),o.length?Y(this):o.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!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())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return ie(this)},G.prototype.iterator=function(e){return void 0!==e&&N(e,"options"),ie(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const 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}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[C]},set(e){this[C]=!!e}}}),G._fromList=se,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){A.destroyer(e,t),r(t)}}).wrap(e)}},9288:()=>{},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,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=r(0,o.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(s,arguments));return Object(t)===t?t:this}return o.apply(e,n(s,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9372:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const l=s(r(1676));t.default=l,a(r(1676),t)},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9584:(e,t,r)=>{"use strict";const n=r(5244),o=r(3425),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},9597:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(u,r);var s,a,l,c=(a=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=i(a);if(l){var r=i(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function u(r,n,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),i=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o)),i.code=e,i}return s=u,Object.defineProperty(s,"prototype",{writable:!1}),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,o){var i,a,l,c,f;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))l="The ".concat(e," ").concat(i," ").concat(u(t,"type"));else{var d=("number"!=typeof f&&(f=0),f+1>(c=e).length||-1===c.indexOf(".",f)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(i," ").concat(u(t,"type"))}return l+". Received type ".concat(n(o))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(537));var o=a.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=l},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,s=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(f=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},9612:e=>{"use strict";e.exports=Object},9655:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,s=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function p(e){throw new RangeError(f[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(u,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function b(e){return m(e,function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)}).join("")}function _(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=a)e=d(e/35);return d(n+36*e/(e+38))}function S(e){var t,r,n,o,i,l,c,u,f,h,m=[],g=e.length,y=0,w=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&p("not-basic"),m.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(i=y,l=1,c=a;o>=g&&p("invalid-input"),((u=_(e.charCodeAt(o++)))>=a||u>d((s-y)/l))&&p("overflow"),y+=u*l,!(u<(f=c<=S?1:c>=S+26?26:c-S));c+=a)l>d(s/(h=a-f))&&p("overflow"),l*=h;S=v(y-i,t=m.length+1,0==i),d(y/t)>s-w&&p("overflow"),w+=d(y/t),y%=t,m.splice(y++,0,w)}return b(m)}function E(e){var t,r,n,o,i,l,c,u,f,m,g,b,_,S,E,A=[];for(b=(e=y(e)).length,t=128,r=0,i=72,l=0;l<b;++l)(g=e[l])<128&&A.push(h(g));for(n=o=A.length,o&&A.push("-");n<b;){for(c=s,l=0;l<b;++l)(g=e[l])>=t&&g<c&&(c=g);for(c-t>d((s-r)/(_=n+1))&&p("overflow"),r+=(c-t)*_,t=c,l=0;l<b;++l)if((g=e[l])<t&&++r>s&&p("overflow"),g==t){for(u=r,f=a;!(u<(m=f<=i?1:f>=i+26?26:f-i));f+=a)E=u-m,S=a-m,A.push(h(w(m+E%S,0))),u=d(E/S);A.push(h(w(u,0))),i=v(r,_,n==o),r=0,++n}++r,++t}return A.join("")}i={version:"1.4.1",ucs2:{decode:y,encode:b},decode:S,encode:E,toASCII:function(e){return g(e,function(e){return c.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return g(e,function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},9675:e=>{"use strict";e.exports=TypeError},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=i},9721:(e,t,r)=>{"use strict";var n=r(6556),o=r(4035),i=n("RegExp.prototype.exec"),s=r(9675);e.exports=function(e){if(!o(e))throw new s("`regex` must be a RegExp");return function(t){return null!==i(e,t)}}},9777:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=a(r(1278)),c=r(9584),u=a(r(3885)),f=a(r(7833)),d=s(r(128)),h=a(r(7969)),p=a(r(6912)),m=r(1021),g=a(r(579)),y=a(r(2639)),b=r(4723),_=r(4152),w=a(r(3175)),v=s(r(6887)),S=globalThis.setImmediate||((...e)=>{const t=e.shift();(0,b.nextTick)(()=>{t(...e)})}),E=65535,A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"};class k extends _.TypedEventEmitter{static VERSION=b.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in A)void 0===this.options[e]?this.options[e]=A[e]:this.options[e]=t[e];this.log=this.options.log||(0,f.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",k.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:k.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(l.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new g.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new h.default,this.incomingStore=t.incomingStore||new h.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=E;const r=t.properties?.receiveMaximum;void 0!==r&&(Number.isInteger(r)&&r>=1&&r<=E?this._receiveMaximum=r:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",r,E,E)),this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(t.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:e}=this,t=()=>{const 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 o=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(o=!1)),o?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._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,t,r){return!!this._incomingQoS2Ids.has(e)||(5===this.options.protocolVersion&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),r?.discardParsedPackets(),r&&!r.isCurrent()||this._cleanUp(!0),t(),this.emit("error",new b.ErrorWithReasonCode(`${m.ReasonCodes[147]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,147)),!1):(this._incomingQoS2Ids.add(e),!0))}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(0!==this._incomingQoS2Ids.size){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(const e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){const e=new c.Writable,t=l.default.parser(this.options);let r=null;const n=[],o={discardParsedPackets:()=>{n.length=0},isCurrent:()=>this._currentPump===o};this._currentPump=o,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});const i=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==o&&(this.log("work :: pump superseded, dropping %d queued packets",n.length),n.length=0);const e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,s,o);else{this.log("work :: no packets in queue");const e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},s=()=>{if(n.length)(0,b.nextTick)(i);else{const e=r;r=null,e&&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`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(void 0!==a.properties?.receiveMaximum&&(a.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(a.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=a.properties?.authenticationMethod,this._writePacket(a),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){const e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:o}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};const{qos:i,retain:s,dup:a,properties:l,cbStorePut:c}=r;if(this._checkDisconnecting(n))return this;const u=()=>{let r=0;if((1===i||2===i)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const u={cmd:"publish",topic:e,payload:t,qos:i,retain:s,messageId:r,dup:a};switch(5===o.protocolVersion&&(u.properties=l),this.log("publish :: qos",i),i){case 1:case 2:this.outgoing[u.messageId]={volatile:!1,cmd:"publish",cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,o)=>{this.publish(e,t,r,(e,t)=>{e?o(e):n(t)})})}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let o=!1,i=[];"string"==typeof e?i=e=[e]:Array.isArray(e)?i=e:"object"==typeof e&&(o=e.resubscribe,delete e.resubscribe,i=Object.keys(e));const s=d.validateTopics(i);if(null!==s)return S(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};const{properties:l}=t,c=[],u=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||o){const 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),c.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),u(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),u(t,e[t])}),!c.length)return r(null,[]),this;const f=(e,t)=>{const r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){const 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}const o=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cmd:"subscribe",cb:(r,o)=>{if(r)return void n(new b.ErrorWithSubackPacket(r.message,o));const{granted:i}=o;if(i.length!==e.length)return n(new b.ErrorWithSubackPacket(`Protocol error: suback granted ${i.length} reason code(s) for ${e.length} subscription(s)`,o)),void this._cleanUp(!0);for(let t=0;t<i.length;t+=1)e[t].qos=i[t];t(o)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),o},h=()=>{const e=this.options.subscribeBatchSize??c.length,t=[];for(let r=0;r<c.length;r+=e){const n=c.slice(r,r+e),o=this._nextId();if(null===o)return this.log("No messageId left"),!1;t.push(f(n,o))}return Promise.all(t).then(e=>{r(null,c,e.at(-1))}).catch(e=>{r(e,c,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,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;const n=d.validateTopics(e);if(null!==n)return S(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const o=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const o={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?o.unsubscriptions=[e]:Array.isArray(e)&&(o.unsubscriptions=e),this.options.resubscribe&&o.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(o.properties=t.properties),this.outgoing[o.messageId]={volatile:!0,cmd:"unsubscribe",cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,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);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const 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)},o=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.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,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");const 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._incomingQoS2Ids.clear(),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(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)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.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,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{const 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),S(()=>{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,o=e;if("publish"===o.cmd&&(o=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(o),n))return t&&t(n);this.outgoingStore.put(o,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);const 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");const r=l.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;const o=this._applyTopicAlias(e);if(o)t(o);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,u.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const o=n.qos||0;0===o&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):o>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"))}get serverProperties(){return this._serverProperties}get keepalive(){const e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");const 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++){const 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.options.clean&&(this.options.protocolVersion<4||!0===e.sessionPresent)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});const i=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?i():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cmd:e.cmd,cb(e,r){t&&t(e,r),i()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",i)};r.on("end",()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),i()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const 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()})}}t.default=k},9844:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function o(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const t=[],r=[],n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(s(Array.from(e),t))),n.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let i=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const l={};t.push(a),r.push(l);for(const s in a){const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=n.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=o(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const l={};t.push(a),r.push(l);for(const s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=n.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=o(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l};function s(e,s){const a=Object.keys(e),l=new Array(a.length);for(let c=0;c<a.length;c++){const u=a[c],f=e[u];if("object"!=typeof f||null===f)l[u]=f;else if(f.constructor!==Object&&(i=n.get(f.constructor)))l[u]=i(f,s);else if(ArrayBuffer.isView(f))l[u]=o(f);else{const e=t.indexOf(f);l[u]=-1!==e?r[e]:s(f)}}return l}}(e);const t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(n(Array.from(e),t))),t.set(Set,(e,t)=>new Set(n(Array.from(e),t))),e.constructorHandlers)for(const r of e.constructorHandlers)t.set(r[0],r[1]);let r=null;return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(r=t.get(i.constructor)))return r(i,e);const s={};for(const n in i){const a=i[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=o(a):s[n]=e(a)}return s}:function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(r=t.get(i.constructor)))return r(i,e);const s={};for(const n in i){if(!1===Object.hasOwnProperty.call(i,n))continue;const a=i[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=o(a):s[n]=e(a)}return s};function n(e,n){const i=Object.keys(e),s=new Array(i.length);for(let a=0;a<i.length;a++){const l=i[a],c=e[l];"object"!=typeof c||null===c?s[l]=c:c.constructor!==Object&&(r=t.get(c.constructor))?s[l]=r(c,n):ArrayBuffer.isView(c)?s[l]=o(c):s[l]=n(c)}return s}}},9848:(e,t,r)=>{"use strict";const{pipeline:n}=r(3616),o=r(2648),{destroyer:i}=r(7302),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(6801),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(9157),g=r(6364);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,b,_,w;const v=e[0],S=n(e,function(e){const t=_;_=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||d(S)||u(S));if(w=new o({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;g(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(b){const e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{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,t){e||null===_||(e=new h),b=null,r=null,y=null,null===_?t(e):(_=t,s(S)&&i(S,e))},w}},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},9862:(e,t,r)=>{"use strict";const n=r(8287),{format:o,inspect:i}=r(1077),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(9157),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(2768),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,d=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||n.Blob,p=void 0!==h?function(e){return e instanceof h}:function(e){return!1},m=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,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:o,inspect:i,types:{isAsyncFunction:e=>e instanceof d,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return m(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{m(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},9868:(e,t,r)=>{"use strict";const n=r(7829).Duplex,o=r(6698),i=r(7396);function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const 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),n.call(this)}o(s,n),Object.assign(s.prototype,i.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},s.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)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof i||s.isBufferList(e)},s.isBufferList=i.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=i},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(6743);e.exports=i.call(n,o)},9993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearInterval:()=>b,clearTimeout:()=>_,setInterval:()=>w,setTimeout:()=>v});var n=r(8389);const o=(c=new WeakMap,i=e=>{if(c.has(e))return c.get(e);const t=new Map;return c.set(e,t),t},l=new WeakMap,s=e=>({...e,connect:({call:e})=>async()=>{const{port1:t,port2:r}=new MessageChannel,n=await e("connect",{port:t},[t]);return l.set(r,n),r},disconnect:({call:e})=>async t=>{const r=l.get(t);if(void 0===r)throw new Error("The given port is not connected.");await e("disconnect",{portId:r})},isSupported:({call:e})=>()=>e("isSupported")}),a=n.generateUniqueNumber,e=>{const t=s(e);return e=>{const r=i(e);e.addEventListener("message",({data:e})=>{const{id:t}=e;if(null!==t&&r.has(t)){const{reject:n,resolve:o}=r.get(t);r.delete(t),void 0===e.error?o(e.result):n(new Error(e.error.message))}}),(e=>"function"==typeof e.start)(e)&&e.start();const n=(t,n=null,o=[])=>new Promise((i,s)=>{const l=a(r);r.set(l,{reject:s,resolve:i}),null===n?e.postMessage({id:l,method:t},o):e.postMessage({id:l,method:t,params:n},o)}),o=(t,r,n=[])=>{e.postMessage({id:null,method:t,params:r},n)};let s={};for(const[e,r]of Object.entries(t))s={...s,[e]:r({call:n,notify:o})};return{...s}}});var i,s,a,l,c;const u=new Map([[0,null]]),f=new Map([[0,null]]),d=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(u),h=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(f),p=((e,t)=>r=>(n,o=0,...i)=>{const s=Symbol(),a=e(t);t.set(a,s);const l=()=>r(o,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(n(...i),t.get(a)===s&&l())});return l(),a})(n.generateUniqueNumber,u),m=((e,t)=>r=>(n,o=0,...i)=>{const s=Symbol(),a=e(t);return t.set(a,s),r(o,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(t.delete(a),n(...i))}),a})(n.generateUniqueNumber,f),g=o({clearInterval:({call:e})=>d(t=>e("clear",{timerId:t,timerType:"interval"})),clearTimeout:({call:e})=>h(t=>e("clear",{timerId:t,timerType:"timeout"})),setInterval:({call:e})=>p((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})),setTimeout:({call:e})=>m((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"}))}),y=(()=>{let e=null;return()=>{if(null!==e)return e;const t=new Blob(['(()=>{var e={455(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,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);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,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o(\'The handler of the method called "\'.concat(t,\'" returned an unexpected result.\'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o(\'The requested method called "\'.concat(e,\'" is not supported.\'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o(\'The handler of the method called "\'.concat(t,\'" returned no required result.\'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,()=>{n(),t.close(),u.delete(o)}),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o(\'The specified parameter called "portId" with the given value "\'.concat(e,\'" does not identify a port connected to this worker.\'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},m=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise(t=>{e.set(a,[r(n,u,i,e,t,a),t])})},f=new Map,h=d(globalThis.clearTimeout,f),p=new Map,w=d(globalThis.clearTimeout,p),v=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=m(f,performance,globalThis.setTimeout,v),T=m(p,performance,globalThis.setTimeout,v);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):w(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return e=(e=>{const t=new Worker(e);return g(t)})(r),setTimeout(()=>URL.revokeObjectURL(r)),e}})(),b=e=>y().clearInterval(e),_=e=>y().clearTimeout(e),w=(...e)=>y().setInterval(...e),v=(...e)=>y().setTimeout(...e)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1860)})());
|
|
8
|
+
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),l(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,i.propertyInData)(r,o,l,s.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),s.allErrors?r.if(u,()=>{for(const t of c)(0,i.checkReportMissingProp)(e,t)}):(r.if(n._`${u} && (${(0,i.checkMissingProp)(e,c,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function l(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,l=r.name("valid");for(const c in t)(0,o.alwaysValidSchema)(a,t[c])||(r.if((0,i.propertyInData)(r,n,c,a.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:c},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=s},3079:(e,t,r)=>{const n=r(9868),{EventEmitter:o}=r(7007),i=r(576),s=r(5399),a=r(7833)("mqtt-packet:parser");class l extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof l?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new l).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("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++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0),t=e>>s.CMD_SHIFT;this.packet.cmd=s.types[t];const r=15&e,n=s.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(s.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.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&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_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 a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,r,n;a("_parseConnect");const o={},i=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(i.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(i.protocolVersion=this._list.readUInt8(this._pos),i.protocolVersion>=128&&(i.bridgeMode=!0,i.protocolVersion=i.protocolVersion-128),3!==i.protocolVersion&&4!==i.protocolVersion&&5!==i.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"));o.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;const c=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),u=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(o.will)i.will={},i.will.retain=c,i.will.qos=u;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(u)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(i.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,i.keepalive=this._parseNum(),-1===i.keepalive)return this._emitError(new Error("Packet too short"));if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.properties=e)}const f=this._parseString();if(null===f)return this._emitError(new Error("Packet too short"));if(i.clientId=f,a("_parseConnect: packet.clientId: %s",i.clientId),o.will){if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(i.will.topic=e,a("_parseConnect: packet.will.topic: %s",i.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));i.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",i.will.payload)}if(o.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));i.username=n,a("_parseConnect: packet.username: %s",i.username)}if(o.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));i.password=r}return this.settings=i,a("_parseConnect: complete"),i}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;const 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&s.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){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const 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){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,r,n,o,i,l,c;if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(r=this._parseByte(),5===this.settings.protocolVersion){if(192&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(l=0!==(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),i=0!==(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),o=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,o>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:t,qos:n},5===this.settings.protocolVersion?(c.nl=l,c.rap=i,c.rh=o):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const 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;){const e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!s.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(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const 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;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const 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){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const 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(!s.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const 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(),!s.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,r=0,n=1,o=0,i=!1;const l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),o+=n*(t&s.VARBYTEINT_MASK),n*=128,0===(t&s.VARBYTEINT_FIN_MASK)){i=!0;break}if(this._list.length<=r)break}return!i&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),i=!!i&&(e?{bytes:r,value:o}:o),a("_parseVarByteNum: result: %o",i),i}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_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(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const 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(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t])}return r}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_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)),a("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){a("_emitError",e),this.error=e,this.emit("error",e)}}e.exports=l},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),o=r(9675),i=r(76),s=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,i,e)}},3132:(e,t,r)=>{const n=r(5399),{Buffer:o}=r(8287),i=o.allocUnsafe(0),s=o.from([0]),a=r(6172),l=r(3225).nextTick,c=r(7833)("mqtt-packet:writeToStream"),u=a.cache,f=a.generateNumber,d=a.generateCache,h=a.genBufVariableByteInt,p=a.generate4ByteBuffer;let m=E,g=!0;function y(e,t,r){switch(c("generate called"),t.cork&&(t.cork(),l(b,t)),g&&(g=!1,d()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){const r=e||{},i=r.protocolId||"MQTT";let s=r.protocolVersion||4;const a=r.will;let l=r.clean;const c=r.keepalive||0,u=r.clientId||"",f=r.username,d=r.password,h=r.properties;void 0===l&&(l=!0);let p,g,y=0;if(!i||"string"!=typeof i&&!o.isBuffer(i))return t.destroy(new Error("Invalid protocolId")),!1;if(y+=i.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(y+=1,("string"==typeof u||o.isBuffer(u))&&(u||s>=4)&&(u||l))y+=o.byteLength(u)+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 c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(y+=2,y+=1,5===s){if(p=I(t,h),!p)return!1;y+=p.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(y+=o.byteLength(a.topic)+2,y+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?y+=o.byteLength(a.payload):y+=a.payload.length}if(g={},5===s){if(g=I(t,a.properties),!g)return!1;y+=g.length}}let b=!1;if(null!=f){if(!$(f))return t.destroy(new Error("Invalid username")),!1;b=!0,y+=o.byteLength(f)+2}if(null!=d){if(!b)return t.destroy(new Error("Username is required to use password")),!1;if(!$(d))return t.destroy(new Error("Invalid password")),!1;y+=T(d)+2}t.write(n.CONNECT_HEADER),w(t,y),k(t,i),r.bridgeMode&&(s+=128),t.write(131===s?n.VERSION131:132===s?n.VERSION132:4===s?n.VERSION4:5===s?n.VERSION5:n.VERSION3);let _=0;return _|=null!=f?n.USERNAME_MASK:0,_|=null!=d?n.PASSWORD_MASK:0,_|=a&&a.retain?n.WILL_RETAIN_MASK:0,_|=a&&a.qos?a.qos<<n.WILL_QOS_SHIFT:0,_|=a?n.WILL_FLAG_MASK:0,_|=l?n.CLEAN_SESSION_MASK:0,t.write(o.from([_])),m(t,c),5===s&&p.write(),k(t,u),a&&(5===s&&g.write(),v(t,a.topic),k(t,a.payload)),null!=f&&k(t,f),null!=d&&k(t,d),!0}(e,t);case"connack":return function(e,t,r){const i=r?r.protocolVersion:4,a=e||{},l=5===i?a.reasonCode:a.returnCode,c=a.properties;let u=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let f=null;if(5===i){if(f=I(t,c),!f)return!1;u+=f.length}return t.write(n.CONNACK_HEADER),w(t,u),t.write(a.sessionPresent?n.SESSIONPRESENT_HEADER:s),t.write(o.from([l])),null!=f&&f.write(),!0}(e,t,r);case"publish":return function(e,t,r){c("publish: packet: %o",e);const s=r?r.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?n.RETAIN_MASK:0,f=a.topic,d=a.payload||i,h=a.messageId,p=a.properties;let g=0;if("string"==typeof f)g+=o.byteLength(f)+2;else{if(!o.isBuffer(f))return t.destroy(new Error("Invalid topic")),!1;g+=f.length+2}if(o.isBuffer(d)?g+=d.length:g+=o.byteLength(d),l&&"number"!=typeof h)return t.destroy(new Error("Invalid messageId")),!1;l&&(g+=2);let y=null;if(5===s){if(y=I(t,p),!y)return!1;g+=y.length}return t.write(n.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),w(t,g),m(t,T(f)),t.write(f),l>0&&m(t,h),null!=y&&y.write(),c("publish: payload: %o",d),t.write(d)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,c=s.dup&&"pubrel"===a?n.DUP_MASK:0;let u=0;const f=s.reasonCode,d=s.properties;let h=5===i?3:2;if("pubrel"===a&&(u=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===i&&"object"==typeof d){if(p=O(t,d,r,h),!p)return!1;h+=p.length}return t.write(n.ACKS[a][u][c][0]),3===h&&(h+=0!==f?1:-1),w(t,h),m(t,l),5===i&&2!==h&&t.write(o.from([f])),null!==p?p.write():4===h&&t.write(o.from([0])),!0}(e,t,r);case"subscribe":return function(e,t,r){c("subscribe: packet: ");const i=r?r.protocolVersion:4,s=e||{},a=s.dup?n.DUP_MASK:0,l=s.messageId,u=s.subscriptions,f=s.properties;let d=0;if("number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;d+=2;let h=null;if(5===i){if(h=I(t,f),!h)return!1;d+=h.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,n=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof n)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===i){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}d+=o.byteLength(r)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),t.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,d),m(t,l),null!==h&&h.write();let p=!0;for(const e of u){const r=e.topic,s=e.qos,a=+e.nl,l=+e.rap,c=e.rh;let u;v(t,r),u=n.SUBSCRIBE_OPTIONS_QOS[s],5===i&&(u|=a?n.SUBSCRIBE_OPTIONS_NL:0,u|=l?n.SUBSCRIBE_OPTIONS_RAP:0,u|=c?n.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(o.from([u]))}return p}(e,t,r);case"suback":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,c=s.properties;let u=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;u+=1}let f=null;if(5===i){if(f=O(t,c,r,u),!f)return!1;u+=f.length}return t.write(n.SUBACK_HEADER),w(t,u),m(t,a),null!==f&&f.write(),t.write(o.from(l))}(e,t,r);case"unsubscribe":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.unsubscriptions,u=s.properties;let f=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(f+=2,"object"!=typeof c||!c.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<c.length;e+=1){if("string"!=typeof c[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;f+=o.byteLength(c[e])+2}let d=null;if(5===i){if(d=I(t,u),!d)return!1;f+=d.length}t.write(n.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,f),m(t,a),null!==d&&d.write();let h=!0;for(let e=0;e<c.length;e++)h=v(t,c[e]);return h}(e,t,r);case"unsuback":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.granted,u=s.properties,f=s.cmd;let d=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===i){if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.destroy(new Error("Invalid qos vector")),!1;d+=1}}let h=null;if(5===i){if(h=O(t,u,r,d),!h)return!1;d+=h.length}return t.write(n.ACKS[f][0][l][0]),w(t,d),m(t,a),null!==h&&h.write(),5===i&&t.write(o.from(c)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(n.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===i?1:0,u=null;if(5===i){if(u=O(t,l,r,c),!u)return!1;c+=u.length}return t.write(o.from([n.codes.disconnect<<4])),w(t,c),5===i&&t.write(o.from([a])),null!==u&&u.write(),!0}(e,t,r);case"auth":return function(e,t,r){const i=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===i?1:0;5!==i&&t.destroy(new Error("Invalid mqtt version for auth packet"));const u=O(t,l,r,c);return!!u&&(c+=u.length,t.write(o.from([n.codes.auth<<4])),w(t,c),t.write(o.from([a])),null!==u&&u.write(),!0)}(e,t,r);default:return t.destroy(new Error("Unknown command")),!1}}function b(e){e.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>m===E,set(e){e?(u&&0!==Object.keys(u).length||(g=!0),m=E):(g=!1,m=A)}});const _={};function w(e,t){if(t>n.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let r=_[t];return r||(r=h(t),t<16384&&(_[t]=r)),c("writeVarByteInt: writing to stream: %o",r),e.write(r)}function v(e,t){const r=o.byteLength(t);return m(e,r),c("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){v(e,t),v(e,r)}function E(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){const r=f(t);return c("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?v(e,t):t?(m(e,t.length),e.write(t)):m(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){P(e,{},0)}};let r=0;function i(t,r){let i=0;switch(n.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=2;break;case"binary":if(r&&null===r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=1+o.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=1+o.byteLength(h(r));break;case"string":if("string"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=3+o.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;i+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce((e,r)=>e+(3+o.byteLength(t.toString())+2+o.byteLength(r.toString())),0):e+=3+o.byteLength(t.toString())+2+o.byteLength(r[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${r}`)),!1}return i}if(t)for(const e in t){let n=0,o=0;const s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(o=i(e,s[t]),!o)return!1;n+=o}else{if(o=i(e,s),!o)return!1;n=o}if(!n)return!1;r+=n}}return{length:o.byteLength(h(r))+r,write(){P(e,t,r)}}}function O(e,t,r,n){const o=["reasonString","userProperties"],i=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=I(e,t);if(i)for(;n+s.length>i;){const r=o.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,r){switch(n.propertiesTypes[t]){case"byte":e.write(o.from([n.properties[t]])),e.write(o.from([+r]));break;case"int8":e.write(o.from([n.properties[t]])),e.write(o.from([r]));break;case"binary":e.write(o.from([n.properties[t]])),k(e,r);break;case"int16":e.write(o.from([n.properties[t]])),m(e,r);break;case"int32":e.write(o.from([n.properties[t]])),function(e,t){const r=p(t);c("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(o.from([n.properties[t]])),w(e,r);break;case"string":e.write(o.from([n.properties[t]])),v(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(i=>{const s=r[i];Array.isArray(s)?s.forEach(r=>{e.write(o.from([n.properties[t]])),S(e,i.toString(),r.toString())}):(e.write(o.from([n.properties[t]])),S(e,i.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${r}`)),!1}}function P(e,t,r){w(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function T(e){return e?e instanceof o?e.length:o.byteLength(e):0}function $(e){return"string"==typeof e||e instanceof o}e.exports=y},3141:(e,t,r)=>{"use strict";var n=r(5003).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},3144:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(76),s=r(7119);e.exports=s||n.call(i,o)},3158:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:s}=r(4469),{Buffer:a}=r(8287),{inspect:l}=r(7797);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const 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 a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const 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}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,o=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(i(t,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}i(t,a,r-e),e-=a.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},3175:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(7732));t.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,o.default)(t),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;const 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)}}},3225:(e,t,r)=>{"use strict";var n=r(2045);void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,o)});default:for(i=new Array(a-1),s=0;s<i.length;)i[s++]=arguments[s];return n.nextTick(function(){e.apply(null,i)})}}}:e.exports=n},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),i=r(6653),s=r(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3425:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(2768),{isIterable:i,isNodeStream:s,isWebStream:a}=r(6801),{pipelineImpl:l}=r(3616),{finished:c}=r(6364);r(5244),e.exports={finished:c,pipeline:function(...e){return new o((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!i(u)&&!a(u)){const t=n(e);o=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:o,end:c})})}}},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),l=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${l}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9096),o=r(4807);t.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new n.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new o.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const 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){const t=this.topicToAlias[e];return void 0!==t&&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]}}},3513:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:o}=r(2768),{validateInteger:i}=r(4947),{ERR_INVALID_ARG_VALUE:s}=r(9157).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,i){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!o(a)||a<0)throw new s(i?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?l=t:a=t}}},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const o=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${o} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),o)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>i,nanoid:()=>a,random:()=>o,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o=e=>crypto.getRandomValues(new Uint8Array(e)),i=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let t=r(o),a=0|o;for(;a--;)if(s+=e[t[a]&n]||"",s.length===i)return s}}},s=(e,t=21)=>i(e,t,o),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3616:(e,t,r)=>{const n=r(5606),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:s,SymbolDispose:a}=r(2768),l=r(6364),{once:c}=r(9862),u=r(7302),f=r(2648),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:b}=r(9157),{validateFunction:_,validateAbortSignal:w}=r(4947),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(6801),P=globalThis.AbortController||r(5568).AbortController;let T,$,x;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function N(e){if(v(e))return e;if(E(e))return async function*(e){$||($=r(9214)),yield*$.prototype[s].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let o,s=null;const a=e=>{if(e&&(o=e),s){const e=s;s=null,e()}},c=()=>new i((e,t)=>{o?t(o):s=()=>{o?t(o):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,r,{end:n}){k(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const s=new P,l=s.signal,c=null==i?void 0:i.signal,u=[];function d(){B(new b)}let g,y,_;w(c,"options.signal"),x=x||r(9862).addAbortListener,c&&(g=x(c,d));const R=[];let $,L=0;function F(e){B(e,0===--L)}function B(e,r){var o;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(o=g)||void 0===o||o[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,_))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==i?void 0:i.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&F(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if($=z({signal:l}),!v($))throw new p("Iterable, AsyncIterable or Stream","source",$)}else $=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if($=k($)?N(null===(W=$)||void 0===W?void 0:W.readable):N($),$=z($,{signal:l}),H){if(!v($,!0))throw new p("AsyncIterable",`transform[${V-1}]`,$)}else{var q;T||(T=r(5258));const X=new T({objectMode:!0}),Z=null===(q=$)||void 0===q?void 0:q.then;if("function"==typeof Z)L++,Z.call($,e=>{_=e,null!=e&&X.write(e),K&&X.end(),n.nextTick(F)},e=>{X.destroy(e),n.nextTick(F,e)});else if(v($,!0))L++,C($,X,F,{end:K});else{if(!O($)&&!k($))throw new p("AsyncIterable or Promise","destination",$);{const re=$.readable||$;L++,C(re,X,F,{end:K})}}$=X;const{destroy:ee,cleanup:te}=j($,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E($)){L+=2;const ne=D($,z,F,{end:K});S(z)&&Q&&u.push(ne)}else if(k($)||O($)){const oe=$.readable||$;L++,C(oe,z,F,{end:K})}else{if(!v($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,C($,z,F,{end:K})}$=z}else if(I(z)){if(E($))L++,M(N($),z,F,{end:K});else if(O($)||v($))L++,M($,z,F,{end:K});else{if(!k($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,M($.readable,z,F,{end:K})}$=z}else $=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),$}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",()=>{i||r(new y)}),e.pipe(t,{end:!1}),o){function s(){i=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const 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)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:L,pipeline:function(...e){return L(e,c(function(e){return _(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},3628:(e,t,r)=>{"use strict";var n=r(8648),o=r(1064),i=r(7176);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=l(r,o,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const f=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},f),e.pass(f,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;const{gen:c,keyword:u,schema:f,parentSchema:d,$data:h,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!h&&t.compile?t.compile.call(p.self,f,d,p):t.validate,g=l(c,u,m),y=c.let("valid");function b(r=(t.async?n._`await `:n.nil)){const s=p.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!h||!1===t.schema);c.assign(y,n._`${r}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function _(e){var r;c.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,function(){if(!1===t.errors)b(),t.modifying&&a(e),_(()=>e.error());else{const r=t.async?function(){const e=c.let("ruleErrs",null);return c.try(()=>b(n._`await `),t=>c.assign(y,!1).if(n._`${t} instanceof ${p.ValidationError}`,()=>c.assign(e,n._`${t}.errors`),()=>c.throw(t))),e}():function(){const e=n._`${g}.errors`;return c.assign(e,null),b(n.nil),e}();t.modifying&&a(e),_(()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}(e,r))}}),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3681:(e,t,r)=>{"use strict";e.exports=o;var n=r(9083);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(6698)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),l=r(4227),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:l,validateName:c,opts:d,self:h}=o,{root:p}=l;if(("#"===r||"#/"===r)&&s===p.baseId)return function(){if(l===p)return f(e,c,l,l.$async);const r=t.scopeValue("root",{ref:p});return f(e,i._`${r}.validate`,p,p.$async)}();const m=a.resolveRef.call(h,p,s,r);if(void 0===m)throw new n.default(o.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=u(e,t);f(e,r,t,t.$async)}(m):function(n){const o=t.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,r,n){const{gen:a,it:c}=e,{allErrors:u,schemaEnv:f,opts:d}=c,h=d.passContext?s.default.this:i.nil;function p(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const t=a.var("props",i._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,i.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const t=a.var("items",i._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,i.Name)}}n?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try(()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(r,!0)},e=>{a.if(i._`!(${e} instanceof ${c.ValidationError})`,()=>a.throw(e)),p(e),u||a.assign(r,!1)}),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,h),()=>m(t),()=>p(t))}t.getValidate=u,t.callRef=f,t.default=c},3779:()=>{},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),l=r(2586);class c{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=d.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,f=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let h;e.$async&&(h=f.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();g=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const t of this._compilations)if(h(t,e))return t}function h(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return y.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new c({schema:t,schemaId:r,root:e,baseId:o})}return y.call(this,r,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=p.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new c({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=f.call(this,i):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!g.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:l}=this.opts;return i=i||new c({schema:r,schemaId:l,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3885:(e,t,r)=>{"use strict";e.exports=r(9844)()},3918:(e,t,r)=>{"use strict";var n=r(2045);function o(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o,i;n=e,o=t,i=r[t],(o=a(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function l(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},u(e)}function f(e,t,r){return f=d()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&h(o,r.prototype),o},f.apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e){return m="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},m(e)}var g=r(537).inspect,y=r(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var _="",w="",v="",S="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var I=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(I,e);var r,o,a,u,f=(r=I,o=d(),function(){var e,t=p(r);if(o){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function I(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,I),"object"!==m(e)||null===e)throw new y("options","Object",e);var r=e.message,o=e.operator,i=e.stackStartFn,s=e.actual,a=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(_="[34m",w="[32m",S="[39m",v="[31m"):(_="",w="",S="",v="")),"object"===m(s)&&null!==s&&"object"===m(a)&&null!==a&&"stack"in s&&s instanceof Error&&"stack"in a&&a instanceof Error&&(s=A(s),a=A(a)),"deepStrictEqual"===o||"strictEqual"===o)t=f.call(this,function(e,t,r){var o="",i="",s=0,a="",l=!1,c=k(e),u=c.split("\n"),f=k(t).split("\n"),d=0,h="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===f.length&&u[0]!==f[0]){var p=u[0].length+f[0].length;if(p<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(u[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===f[0][d];)d++;d>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var g=u[u.length-1],y=f[f.length-1];g===y&&(d++<2?a="\n ".concat(g).concat(a):o=g,u.pop(),f.pop(),0!==u.length&&0!==f.length);)g=u[u.length-1],y=f[f.length-1];var A=Math.max(u.length,f.length);if(0===A){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(_,"...").concat(S);I.length>27;)I.pop();return"".concat(E.notIdentical,"\n\n").concat(I.join("\n"),"\n")}d>3&&(a="\n".concat(_,"...").concat(S).concat(a),l=!0),""!==o&&(a="\n ".concat(o).concat(a),o="");var O=0,R=E[r]+"\n".concat(w,"+ actual").concat(S," ").concat(v,"- expected").concat(S),P=" ".concat(_,"...").concat(S," Lines skipped");for(d=0;d<A;d++){var T=d-s;if(u.length<d+1)T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(f[d-2]),O++),i+="\n ".concat(f[d-1]),O++),s=d,o+="\n".concat(v,"-").concat(S," ").concat(f[d]),O++;else if(f.length<d+1)T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(u[d-2]),O++),i+="\n ".concat(u[d-1]),O++),s=d,i+="\n".concat(w,"+").concat(S," ").concat(u[d]),O++;else{var $=f[d],x=u[d],j=x!==$&&(!b(x,",")||x.slice(0,-1)!==$);j&&b($,",")&&$.slice(0,-1)===x&&(j=!1,x+=","),j?(T>1&&d>2&&(T>4?(i+="\n".concat(_,"...").concat(S),l=!0):T>3&&(i+="\n ".concat(u[d-2]),O++),i+="\n ".concat(u[d-1]),O++),s=d,i+="\n".concat(w,"+").concat(S," ").concat(x),o+="\n".concat(v,"-").concat(S," ").concat($),O+=2):(i+=o,o="",1!==T&&0!==d||(i+="\n ".concat(x),O++))}if(O>20&&d<A-2)return"".concat(R).concat(P,"\n").concat(i,"\n").concat(_,"...").concat(S).concat(o,"\n")+"".concat(_,"...").concat(S)}return"".concat(R).concat(l?P:"","\n").concat(i).concat(o).concat(a).concat(h)}(s,a,o));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=E[o],h=k(s).split("\n");if("notStrictEqual"===o&&"object"===m(s)&&null!==s&&(d=E.notStrictEqualObject),h.length>30)for(h[26]="".concat(_,"...").concat(S);h.length>27;)h.pop();t=1===h.length?f.call(this,"".concat(d," ").concat(h[0])):f.call(this,"".concat(d,"\n\n").concat(h.join("\n"),"\n"))}else{var p=k(s),g="",O=E[o];"notDeepEqual"===o||"notEqual"===o?(p="".concat(E[o],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(g="".concat(k(a)),p.length>512&&(p="".concat(p.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?p="".concat(O,"\n\n").concat(p,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),t=f.call(this,"".concat(p).concat(g))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=a,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(c(t),i),t.stack,t.name="AssertionError",l(t)}return a=I,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,i(i({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),I}(u(Error),g.custom);e.exports=I},3936:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(6370),i=n(r(1428)),s=n(r(7833)),a=n(r(6968)),l=(0,s.default)("mqttjs:tls");t.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0!==i.default.isIP(t.host)||t.servername||(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,l("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=function(e){const{host:t,port:r,socksProxy:n,...i}=e;if(void 0!==n){const s=(0,a.default)(t,r,n,{timeout:e.socksTimeout});return(0,o.connect)({...i,socket:s})}return(0,o.connect)(e)}(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)}),r.on("error",n),r}},3942:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:o}=r(4469),{isIterable:i,isNodeStream:s,isWebStream:a}=r(5980),{pipelineImpl:l}=r(4867),{finished:c}=r(577);r(9037),e.exports={finished:c,pipeline:function(...e){return new o((t,r)=>{let o,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!i(u)&&!a(u)){const t=n(e);o=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:o,end:c})})}}},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===r.length)return;const f=r.length>=u.loopRequired;if(c.allErrors?function(){if(f||l)e.block$data(o.nil,d);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(f||l){const r=t.let("valid",!0);e.block$data(r,()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(i,(0,n.propertyInData)(t,a,r,u.ownProperties)),t.if((0,o.not)(i),()=>{e.error(),t.break()})},o.nil)}(i,r)),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(c,t,c.opts.strictRequired)}}function d(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,u.ownProperties),()=>e.error())})}}};t.default=s},4035:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9092)(),s=r(9957),a=r(5795);if(i){var l=o("RegExp.prototype.exec"),c={},u=function(){throw c},f={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=u),n=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{l(e,f)}catch(e){return e===c}}}else{var d=o("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===d(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),l=r(3835),c=r(9029),u=r(6939),f=r(208),d=r(4227),h=r(3837),p=r(5944),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function w(e){var t,r,n,o,i,s,a,l,c,u,f,d,h,g,y,b,_,w,v,S,E,A,k,I,O;const R=e.strict,P=null===(t=e.code)||void 0===t?void 0:t.optimize,T=!0===P||void 0===P?1:P||0,$=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,x=null!==(o=e.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:R)||void 0===s||s,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:R)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:R)&&void 0!==u?u:"log",strictTuples:null!==(d=null!==(f=e.strictTuples)&&void 0!==f?f:R)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:R)&&void 0!==g&&g,code:e.code?{...e.code,optimize:T,regExp:$}:{optimize:T,regExp:$},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(k=e.validateFormats)||void 0===k||k,unicodeRegExp:null===(I=e.unicodeRegExp)||void 0===I||I,int32range:null===(O=e.int32range)||void 0===O||O,uriResolver:x}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...w(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&I.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),A.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=h;"id"===r&&(n={...h},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const r=await c.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:r});if(t=l.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return(0,d.eachItem)(r,e=>$.call(this,e)),this;j.call(this,t);const n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>$.call(this,e,n):e=>n.type.forEach(t=>$.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=C(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,u.normalizeId)(i||r);const c=u.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function A(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function k(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function I(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of g)delete e[t];return e}v.ValidationError=i.default,v.MissingRefError=s.default,t.default=v;const R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function $(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?x.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function x(e,t,r){const n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function j(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,N]}}},4133:(e,t,r)=>{"use strict";var n=r(487),o=r(8452),i=r(3003),s=r(6642),a=r(2464),l=n(s(),Number);o(l,{getPolyfill:s,implementation:i,shim:a}),e.exports=l},4148:(e,t,r)=>{"use strict";var n=r(2045);function o(e){return o="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},o(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!==o(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}var l,c,u=r(9597).codes,f=u.ERR_AMBIGUOUS_ARGUMENT,d=u.ERR_INVALID_ARG_TYPE,h=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,m=u.ERR_MISSING_ARGS,g=r(3918),y=r(537).inspect,b=r(537).types,_=b.isPromise,w=b.isRegExp,v=r(9133)(),S=r(9394)(),E=r(8075)("RegExp.prototype.test");function A(){var e=r(2299);l=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var k=!1,I=e.exports=T,O={};function R(e){if(e.message instanceof Error)throw e.message;throw new g(e)}function P(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new g({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[T,t.length].concat(t))}I.fail=function e(t,r,o,i,s){var a,l=arguments.length;if(0===l?a="Failed":1===l?(o=t,t=void 0):(!1===k&&(k=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===l&&(i="!=")),o instanceof Error)throw o;var c={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:s||e};void 0!==o&&(c.message=o);var u=new g(c);throw a&&(u.message=a,u.generatedMessage=!0),u},I.AssertionError=g,I.ok=T,I.equal=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");t!=r&&R({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},I.notEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");t==r&&R({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},I.deepEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),l(t,r)||R({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},I.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),l(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},I.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),c(t,r)||R({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},I.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");void 0===l&&A(),c(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},I.strictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");S(t,r)||R({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},I.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new m("actual","expected");S(t,r)&&R({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var $=s(function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&E(t[e],n[e])?o[e]=n[e]:o[e]=t[e])})});function x(e,t,r,n){if("function"!=typeof t){if(w(t))return E(t,e);if(2===arguments.length)throw new d("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new g({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new h("error",t,"may not be an empty object");return void 0===l&&A(),s.forEach(function(o){"string"==typeof e[o]&&w(t[o])&&E(t[o],e[o])||function(e,t,r,n,o,i){if(!(r in e)||!c(e[r],t[r])){if(!n){var s=new $(e,o),a=new $(t,o,e),l=new g({actual:s,expected:a,operator:"deepStrictEqual",stackStartFn:i});throw l.actual=e,l.expected=t,l.operator=i.name,l}R({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}(e,t,o,r,s,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function j(e){if("function"!=typeof e)throw new d("fn","Function",e);try{e()}catch(e){return e}return O}function N(e){return _(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!N(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!N(e))throw new d("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return O}).catch(function(e){return e})})}function M(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new d("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new d("error",["Object","Error","Function","RegExp"],r);if(t===O){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";R({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!x(t,r,n,e))throw t}function L(e,t,r,n){if(t!==O){if("string"==typeof r&&(n=r,r=void 0),!r||x(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";R({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function D(e,t,r,n,i){if(!w(t))throw new d("regexp","RegExp",t);var s="match"===i;if("string"!=typeof e||E(t,e)!==s){if(r instanceof Error)throw r;var a=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(o(e)," (").concat(y(e),")"):(s?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(t),". Input:\n\n").concat(y(e),"\n"));var l=new g({actual:e,expected:t,message:r,operator:i,stackStartFn:n});throw l.generatedMessage=a,l}}function F(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[F,t.length].concat(t))}I.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];M.apply(void 0,[e,j(t)].concat(n))},I.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return C(t).then(function(t){return M.apply(void 0,[e,t].concat(n))})},I.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];L.apply(void 0,[e,j(t)].concat(n))},I.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return C(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},I.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new g({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},I.match=function e(t,r,n){D(t,r,n,e,"match")},I.doesNotMatch=function e(t,r,n){D(t,r,n,e,"doesNotMatch")},I.strict=v(F,I,{equal:I.strictEqual,deepEqual:I.deepStrictEqual,notEqual:I.notStrictEqual,notDeepEqual:I.notDeepStrictEqual}),I.strict.strict=I.strict},4152:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEventEmitter=void 0;const o=n(r(7007)),i=r(4723);class s{}t.TypedEventEmitter=s,(0,i.applyMixin)(s,o.default)},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||p(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,l)=>{const c=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return l!==n.Name||c instanceof n.Name?c:o(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach(r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>{e.if(n._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),f(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=f;const d={};var h;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h||(t.Type=h={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===h.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},4233:e=>{"use strict";const t=function*(){}.constructor;e.exports=()=>t},4257:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){a=!1,c=!0,s||i.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){s=!1,f=!0,a||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",p),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",d),t.on("finish",u),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",u),t.removeListener("abort",p),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:o}=t,i={cmd:"pubcomp",messageId:o};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(i,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._releaseIncomingQoS2Publish(o),e._sendPacket(i,n)}))})}},4269:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(9157),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(4947),d=r(2768).Symbol("kWeak"),h=r(2768).Symbol("kResistStopPropagation"),{finished:p}=r(6364),m=r(9848),{addAbortSignalNoValidate:g}=r(5121),{isWritable:y,isNodeStream:b}=r(6801),{deprecate:_}=r(9862),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:P}=r(2768),T=P("kEmpty"),$=P("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=S(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(9862).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,m()}function m(){h-=1,g()}function g(){f&&!d&&h<n&&a.length<o&&(f(),f=null)}!async function(){try{for await(let t of s){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===T)continue;t=O(t)}catch(e){t=I(e)}h+=1,R(t,m,p),a.push(t),u&&(u(),u=null),!d&&(a.length>=o||h>=n)&&await new k(e=>{f=e})}a.push($)}catch(e){const t=I(e);R(t,m,p),a.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===$)return;if(i.aborted)throw new l;e!==T&&(yield e),a.shift(),g()}await new k(e=>{u=e})}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of N.call(this,e,t))return!0;return!1}function N(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,async function(t,r){return await e(t,r)?t:T},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:_(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({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&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:N,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!y(e))throw new o("stream",e,"must be writable");const r=m(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.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(const r of x.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let m=!1;try{for await(const n of this){var g;if(m=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!m&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of N.call(this,e,t))return r}}},4347:(e,t,r)=>{"use strict";var n=r(2045);function o(e,t){s(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4469:e=>{"use strict";class t 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}}e.exports={AggregateError:t,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,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(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,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,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},4474:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(4469),{EventEmitter:i}=r(7007);function s(e){i.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(s.prototype,i.prototype),o(s,i),s.prototype.pipe=function(e,t){const 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",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:l}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:l}=t;u(c.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(u(s instanceof n.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class o extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=o},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},4723:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.MQTTJS_VERSION=t.nextTick=t.ErrorWithSubackPacket=t.ErrorWithReasonCode=void 0,t.applyMixin=function(e,t,r=!1){const n=[t];for(;;){const e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(const t of n)for(const n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};class o extends Error{code;constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,o.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}t.ErrorWithReasonCode=o;class i extends Error{packet;constructor(e,t){super(e),this.packet=t,Object.setPrototypeOf(this,i.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}}t.ErrorWithSubackPacket=i,t.nextTick="function"==typeof n?.nextTick?n.nextTick:e=>{setTimeout(e,0)},t.MQTTJS_VERSION=r(2860).version},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=l;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),l=r.let("fType"),u=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(l,n._`${s}.type || "string"`).assign(u,n._`${s}.validate`),()=>r.assign(l,n._`"string"`).assign(u,s)),e.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${u}`,function(){const e=f.$async?n._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:n._`${u}(${o})`,r=n._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return n._`${u} && ${u} !== true && ${l} === ${t} && !${r}`}()))}():function(){const i=d.formats[s];if(!i)return void function(){if(!1!==c.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}d.logger.warn(e())}();if(!0===i)return;const[a,l,h]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return n._`await ${h}(${o})`}return"function"==typeof l?n._`${h}(${o})`:n._`${h}.test(${o})`}())}())}};t.default=o},4765:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},4803:(e,t,r)=>{"use strict";var n=r(8859),o=r(9675),i=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return i(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=i(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=i(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},4807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberAllocator=void 0,t.NumberAllocator=class{used;min;max;lowWaterMark;constructor(e,t){this.min=e,this.max=t,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return!(e<this.min||e>this.max||this.used.has(e)||(this.used.add(e),0))}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}}},4834:e=>{"use strict";const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),48!==r){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){const o=n(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function a(e){if(function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e)<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},o=[],a=[];let l=!1,c=!1,u=s;for(let n=0;n<e.length;n++){const s=e[n];if("["!==s&&"]"!==s)if(":"!==s)if("%"===s){if(!u(a,o,r))break;u=i}else a.push(s);else{if(!0===l&&(c=!0),!u(a,o,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(l=!0),o.push(":")}}return a.length&&(u===i?r.zone=a.join(""):c?o.push(a.join("")):o.push(n(a))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}e.exports={nonSimpleDomain:o,recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){const t=a(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e;const r=[];let n=-1,o=0;for(;o=t.length;){if(1===o){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===o&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n}},4867:(e,t,r)=>{const n=r(5606),{ArrayIsArray:o,Promise:i,SymbolAsyncIterator:s,SymbolDispose:a}=r(4469),l=r(577),{once:c}=r(7797),u=r(1787),f=r(7323),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:b}=r(2074),{validateFunction:_,validateAbortSignal:w}=r(1580),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(5980),P=globalThis.AbortController||r(5568).AbortController;let T,$,x;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function N(e){if(v(e))return e;if(E(e))return async function*(e){$||($=r(2729)),yield*$.prototype[s].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let o,s=null;const a=e=>{if(e&&(o=e),s){const e=s;s=null,e()}},c=()=>new i((e,t)=>{o?t(o):s=()=>{o?t(o):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(o!==e?d(o,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,r,{end:n}){k(t)&&(t=t.writable);const o=t.getWriter();try{for await(const t of e)await o.ready,o.write(t).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,i){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const s=new P,l=s.signal,c=null==i?void 0:i.signal,u=[];function d(){B(new b)}let g,y,_;w(c,"options.signal"),x=x||r(7797).addAbortListener,c&&(g=x(c,d));const R=[];let $,L=0;function F(e){B(e,0===--L)}function B(e,r){var o;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(o=g)||void 0===o||o[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,_))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==i?void 0:i.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&F(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if($=z({signal:l}),!v($))throw new p("Iterable, AsyncIterable or Stream","source",$)}else $=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if($=k($)?N(null===(W=$)||void 0===W?void 0:W.readable):N($),$=z($,{signal:l}),H){if(!v($,!0))throw new p("AsyncIterable",`transform[${V-1}]`,$)}else{var q;T||(T=r(519));const X=new T({objectMode:!0}),Z=null===(q=$)||void 0===q?void 0:q.then;if("function"==typeof Z)L++,Z.call($,e=>{_=e,null!=e&&X.write(e),K&&X.end(),n.nextTick(F)},e=>{X.destroy(e),n.nextTick(F,e)});else if(v($,!0))L++,C($,X,F,{end:K});else{if(!O($)&&!k($))throw new p("AsyncIterable or Promise","destination",$);{const re=$.readable||$;L++,C(re,X,F,{end:K})}}$=X;const{destroy:ee,cleanup:te}=j($,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E($)){L+=2;const ne=D($,z,F,{end:K});S(z)&&Q&&u.push(ne)}else if(k($)||O($)){const oe=$.readable||$;L++,C(oe,z,F,{end:K})}else{if(!v($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,C($,z,F,{end:K})}$=z}else if(I(z)){if(E($))L++,M(N($),z,F,{end:K});else if(O($)||v($))L++,M($,z,F,{end:K});else{if(!k($))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$);L++,M($.readable,z,F,{end:K})}$=z}else $=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(d),$}function D(e,t,r,{end:o}){let i=!1;if(t.on("close",()=>{i||r(new y)}),e.pipe(t,{end:!1}),o){function s(){i=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const 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)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:L,pipeline:function(...e){return L(e,c(function(e){return _(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},4947:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:i,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:g}=r(2768),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(9157),{normalizeEncoding:E}=r(9862),{isAsyncFunction:A,isArrayBufferView:k}=r(9862).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),P=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=!1)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,o=4294967295;if(e<n||e>o)throw new v(t,`>= ${n} && <= ${o}`,e)});function $(e,t){if("string"!=typeof e)throw new _(t,"string",e)}const x=y((e,t,r)=>{if(!o(r,e)){const n=i(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function j(e,t){if("boolean"!=typeof e)throw new _(t,"boolean",e)}function N(e,t,r){return null!=e&&d(e,t)?e[t]:r}const C=y((e,t,r=null)=>{const o=N(r,"allowArray",!1),i=N(r,"allowFunction",!1);if(!N(r,"nullable",!1)&&null===e||!o&&n(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new _(t,"Object",e)}),M=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new _(t,"a dictionary",e)}),L=y((e,t,r=0)=>{if(!n(e))throw new _(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),D=y((e,t="buffer")=>{if(!k(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}),F=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new _(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new _(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!h(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return T(e,t),e},validateArray:L,validateStringArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)$(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++){const n=e[r],o=`${t}[${r}]`;if(null==n)throw new _(o,"AbortSignal",n);F(n,o)}},validateBoolean:j,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){const 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:B,validateInt32:P,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new _(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:x,validatePlainFunction:U,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($(e,t),void 0===I[e]){if(void 0!==I[m(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:$,validateUint32:T,validateUndefined:W,validateUnion:function(e,t,r){if(!o(r,e))throw new _(t,`('${i(r,"|")}')`,e)},validateAbortSignal:F,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const o=e[n];V(o,"hints"),r+=o,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"')}}},4959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),o=[0,16,128,131,135,144,145,151,153],i=(e,t,r,o,i=148)=>{o?.discardParsedPackets(),o&&!o.isCurrent()||e._cleanUp(!0),r(),e.emit("error",new n.ErrorWithReasonCode(t,i))},s=(e,t,r)=>{r(),e.emit("error",t)};t.default=(e,t,r,n)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let a=t.topic.toString();const l=t.payload,{qos:c}=t,{messageId:u}=t,{options:f}=e;if(5===e.options.protocolVersion){let o;if(t.properties&&(o=t.properties.topicAlias),void 0!==o){const t=e.topicAliasRecv;if(!t)return e.log("handlePublish :: received unexpected topic alias. alias: %d",o),void i(e,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);if(0===a.length){if(!(o>0&&o<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",o),void i(e,`Received Topic Alias ${o} is outside the valid range 1-65535`,r,n);{const s=t.getTopicByAlias(o);if(!s)return e.log("handlePublish :: unregistered topic alias. alias: %d",o),void i(e,"Received unregistered Topic Alias",r,n,130);a=s,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,o)}}else{if(!t.put(a,o))return e.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",o,t.max),void i(e,`Received Topic Alias ${o} is outside the advertised Topic Alias Maximum range 1-${t.max}`,r,n);e.log("handlePublish :: registered topic: %s - alias: %d",a,o)}}}switch(e.log("handlePublish: qos %d",c),c){case 2:f.customHandleAcks(a,l,t,(i,a)=>{if("number"==typeof i&&(a=i,i=null),i)return s(e,i,r);if(-1===o.indexOf(a))return s(e,new Error("Wrong reason code for pubrec"),r);if(a)e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:a},r);else{if(!e._trackIncomingQoS2Publish(u,r,n))return;e.incomingStore.put(t,()=>{e._sendPacket({cmd:"pubrec",messageId:u},r)})}});break;case 1:f.customHandleAcks(a,l,t,(n,i)=>("number"==typeof n&&(i=n,n=null),n?s(e,n,r):-1===o.indexOf(i)?s(e,new Error("Wrong reason code for puback"),r):(i||e.emit("message",a,l,t),void e.handleMessage(t,t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:i},r)}))));break;case 0:e.emit("message",a,l,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},5003:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5016:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(2768);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(9157).codes,s=r(2648),{getHighWaterMark:a}=r(3513);n(c.prototype,s.prototype),n(c,s);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}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 f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5034:(e,t,r)=>{"use strict";var n,o=r(2045);function i(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(4257),a=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function g(e){o.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(t,r){o.nextTick(function(){e[c]?r(e[c]):t(p(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(p(void 0,!0)):t[d](r,n)},n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(b,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[f]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[a]=null,r[l]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[u]=!0}),e.on("readable",g.bind(null,r)),r}},5121:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(2768),{AbortError:o,codes:i}=r(9157),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(6801),c=r(6364),{ERR_INVALID_ARG_TYPE:u}=i;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const i=s(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{f=f||r(9862).addAbortListener;const o=f(e,i);c(t,o[n])}return t}},5224:(e,t,r)=>{const n=r(5606),o=r(8287),{isReadable:i,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(6801),p=r(6364),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=r(9157),{destroyer:b}=r(7302),_=r(2648),w=r(9214),v=r(7602),{createDeferredPromise:S}=r(9862),E=r(2070),A=globalThis.Blob||o.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(2768);class R extends _{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function P(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,o,a,l,c,u=!!i(t),f=!!s(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&b(t,e),d(e)}),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(o){const e=o;o=null,e()}})),u&&(p(t,e=>{u=!1,e&&b(t,e),d(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new m),a=null,n=null,o=null,null===l?i(e):(l=i,b(r,e),b(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return P({readable:t});if(u(t))return P({writable:t});if(l(t))return P({writable:!1,readable:!1});if(d(t))return P({readable:w.fromWeb(t)});if(h(t))return P({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:s}=function(e){let{promise:t,resolve:r}=S();const o=new I,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(i.aborted)throw new m(void 0,{cause:i.reason});({promise:t,resolve:r}=S()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:o,final:i,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{b(t,e)});return t=new R({objectMode:!0,readable:!1,write:o,final(e){i(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return P({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{b(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),o=130,i=(e,t,r)=>{e.log("handleAuth :: %s",t.message),r?.discardParsedPackets(),r&&!r.isCurrent()||e._cleanUp(!0),e.emit("error",t)};t.default=(e,t,r)=>{const{options:s}=e,a=s.protocolVersion,l=5===a?t.reasonCode:t.returnCode;if(5!==a)return void i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,o),r);const c=e._authenticationMethod;c?t.properties?.authenticationMethod===c?e.handleAuth(t,(t,s)=>{if(t)i(e,t,r);else{if(0!==l)return 24===l?s?(e.reconnecting=!1,void e._sendPacket(s)):void i(e,new n.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",o),r):void i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${l} is not one a broker may send`,o),r);e.log("handleAuth :: authentication exchange completed successfully")}}):i(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${c}" sent in CONNECT`,o),r):i(e,new n.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",o),r)}},5244:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:s}=r(2768),{promisify:{custom:a}}=r(9862),{streamReturningOperators:l,promiseReturningOperators:c}=r(4269),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(9157),f=r(9848),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(3513),{pipeline:p}=r(3616),{destroyer:m}=r(7302),g=r(6364),y=r(3425),b=r(6801),_=e.exports=r(8745).Stream;_.isDestroyed=b.isDestroyed,_.isDisturbed=b.isDisturbed,_.isErrored=b.isErrored,_.isReadable=b.isReadable,_.isWritable=b.isWritable,_.Readable=r(9214);for(const v of i(l)){const S=l[v];function E(...e){if(new.target)throw u();return _.Readable.from(s(S,this,e))}o(E,"name",{__proto__:null,value:S.name}),o(E,"length",{__proto__:null,value:S.length}),o(_.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}o(I,"name",{__proto__:null,value:k.name}),o(I,"length",{__proto__:null,value:k.length}),o(_.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}_.Writable=r(7602),_.Duplex=r(2648),_.Transform=r(5016),_.PassThrough=r(5258),_.pipeline=p;const{addAbortSignal:w}=r(5121);_.addAbortSignal=w,_.finished=g,_.destroy=m,_.compose=f,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=h,o(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(g,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),_.Stream=_,_._isUint8Array=function(e){return e instanceof Uint8Array},_._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},5258:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(2768);e.exports=i;const o=r(5016);function i(e){if(!(this instanceof i))return new i(e);o.call(this,e)}n(i.prototype,o.prototype),n(i,o),i.prototype._transform=function(e,t,r){r(null,e)}},5267:(e,t,r)=>{"use strict";var n,o=r(2463).F,i=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var u,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var d=t.map(function(e,o){var i=o<t.length-1;return function(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(4257)),n(e,{readable:t,writable:o},function(e){if(e)return i(e);a=!0,i()});var l=!1;return function(t){if(!a&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new s("pipe"))}}(e,i,o>0,function(e){u||(u=e),e&&d.forEach(l),i||(d.forEach(l),f(u))})});return t.reduce(c)}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:l,it:c}=e,{opts:u}=c,f=(0,n.allSchemaProperties)(r),d=f.filter(e=>(0,i.alwaysValidSchema)(c,r[e]));if(0===f.length||d.length===f.length&&(!c.opts.unevaluated||!0===c.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,p=t.name("valid");!0===c.props||c.props instanceof o.Name||(c.props=(0,s.evaluatedPropsToName)(t,c.props));const{props:m}=c;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(r){t.forIn("key",a,i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,()=>{const n=d.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},p),c.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):n||c.allErrors||t.if((0,o.not)(p),()=>t.break())})})}!function(){for(const e of f)h&&g(e),c.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}()}};t.default=a},5345:e=>{"use strict";e.exports=URIError},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5373:(e,t,r)=>{"use strict";var n=r(8636),o=r(2642),i=r(4765);e.exports={formats:i,parse:o,stringify:n}},5399:(e,t,r)=>{const n=e.exports,{Buffer:o}=r(8287);n.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"},n.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},n.requiredHeaderFlagsErrors={};for(const e in n.requiredHeaderFlags){const t=n.requiredHeaderFlags[e];n.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+n.types[e]+" packet"}n.codes={};for(const e in n.types){const t=n.types[e];n.codes[t]=e}n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=o.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=o.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=o.from([n.codes.connect<<n.CMD_SHIFT]),n.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},n.propertiesCodes={};for(const e in n.properties){const t=n.properties[e];n.propertiesCodes[t]=e}function i(e){return[0,1,2].map(t=>[0,1].map(r=>[0,1].map(i=>{const s=o.alloc(1);return s.writeUInt8(n.codes[e]<<n.CMD_SHIFT|(r?n.DUP_MASK:0)|t<<n.QOS_SHIFT|i,0,!0),s})))}n.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"},n.PUBLISH_HEADER=i("publish"),n.SUBSCRIBE_HEADER=i("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=i("unsubscribe"),n.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},n.SUBACK_HEADER=o.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=o.from([3]),n.VERSION4=o.from([4]),n.VERSION5=o.from([5]),n.VERSION131=o.from([131]),n.VERSION132=o.from([132]),n.QOS=[0,1,2].map(e=>o.from([e])),n.EMPTY={pingreq:o.from([n.codes.pingreq<<4,0]),pingresp:o.from([n.codes.pingresp<<4,0]),disconnect:o.from([n.codes.disconnect<<4,0])},n.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"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.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"},n.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"},n.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"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:l}=e;l.items=!0;const c=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${c} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(l,i)){const i=r.var("valid",n._`${c} <= ${t.length}`);r.if((0,n.not)(i),()=>function(i){r.forRange("i",t.length,c,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),l.allErrors||r.if((0,n.not)(i),()=>r.break())})}(i)),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5568:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.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];l.push(new h(e,t)),1!==l.length||c||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5670:(e,t,r)=>{"use strict";const n=r(8287),o=r(9584),i=r(2635);let s,a,l;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const c=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let 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}(t,e);s=wx.connectSocket({url:c,protocols:[r]}),a=function(){const e=new o.Transform;return e._write=(e,t,r)=>{s.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{s.close({success(){e()}})},e}(),l=new i.BufferedDuplex(t,a,s),l._destroy=(e,t)=>{s.close({success(){t&&t(e)}})};const u=l.destroy;return l.destroy=(e,t)=>(l.destroy=u,setTimeout(()=>{s.close({fail(){l._destroy(e,t)}})},0),l),s.onOpen(()=>{l.socketReady()}),s.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?n.Buffer.from(t):n.Buffer.from(t,"utf8"),a.push(t)}),s.onClose(()=>{l.emit("close"),l.end(),l.destroy()}),s.onError(e=>{const t=new Error(e.errMsg);l.destroy(t)}),l}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function c(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(l(e,t,r))):i}function u(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(c(r,o,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map(o=>(0,n.and)(c(e,t,o,r.ownProperties),n._`${i} = ${o}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${l(e,t,r)}`:i},t.noPropertyInData=c,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter(r=>!(0,o.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:l},c,u,f){const d=f?n._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const p=n._`${d}, ${r.object(...h)}`;return u!==n.nil?n._`${c}.call(${u}, ${p})`:n._`${c}(${p})`};const f=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?f:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(s){const l=t.const("len",n._`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)})}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,o.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},l);t.assign(a,n._`${a} || ${l}`),e.mergeValidEvaluated(s,l)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},5767:(e,t,r)=>{"use strict";var n=r(2682),o=r(9209),i=r(487),s=r(6556),a=r(5795),l=r(3628),c=s("Object.prototype.toString"),u=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,d=o(),h=s("String.prototype.slice"),p=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},m={__proto__:null};n(d,u&&a&&l?function(e){var t=new f[e];if(Symbol.toStringTag in t&&l){var r=l(t),n=a(r,Symbol.toStringTag);if(!n&&r){var o=l(r);n=a(o,Symbol.toStringTag)}m["$"+e]=i(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(m["$"+e]=i(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=h(c(e),8,-1);return p(d,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(m,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return a?function(e){var t=!1;return n(m,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}},5769:(e,t,r)=>{const n=r(5606),o=r(8287),{isReadable:i,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:h}=r(5980),p=r(577),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=r(2074),{destroyer:b}=r(1787),_=r(7323),w=r(2729),v=r(8601),{createDeferredPromise:S}=r(7797),E=r(1401),A=globalThis.Blob||o.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(4469);class R extends _{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function P(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,o,a,l,c,u=!!i(t),f=!!s(r);function d(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&b(t,e),d(e)}),c._write=function(e,t,o){r.write(e,t)?o():n=o},c._final=function(e){r.end(),o=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(o){const e=o;o=null,e()}})),u&&(p(t,e=>{u=!1,e&&b(t,e),d(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,i){e||null===l||(e=new m),a=null,n=null,o=null,null===l?i(e):(l=i,b(r,e),b(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return P({readable:t});if(u(t))return P({writable:t});if(l(t))return P({writable:!1,readable:!1});if(d(t))return P({readable:w.fromWeb(t)});if(h(t))return P({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:o,final:i,destroy:s}=function(e){let{promise:t,resolve:r}=S();const o=new I,i=o.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:o,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(i.aborted)throw new m(void 0,{cause:i.reason});({promise:t,resolve:r}=S()),yield o}}(),{signal:i}),write(e,t,n){const o=r;r=null,o({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:o,final:i,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{b(t,e)});return t=new R({objectMode:!0,readable:!1,write:o,final(e){i(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(d(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return P({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const o=null==t?void 0:t.then;if("function"==typeof o){let e;return O(o,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{b(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)})}};t.default=o},5880:e=>{"use strict";e.exports=Math.pow},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},5980:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(4469),s=i("nodejs.stream.destroyed"),a=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(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 m(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||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function _(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!_(e)&&h(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!_(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 k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:_,kIsDestroyed:s,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,o,i,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0: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 m(e)?!(!_(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return m(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:m,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;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return m(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:k,willEmitClose:function(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),l=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,l=t.let("valid",!1),c=t.let("passing",null),u=t.name("_valid");e.setParams({passing:c}),t.block(function(){a.forEach((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(n._`${u} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${i}]`).else(),t.if(u,()=>{t.assign(l,!0),t.assign(c,i),a&&e.mergeEvaluated(a,n.Name)})})}),e.result(l,()=>e.reset(),()=>e.error(!0))}};t.default=i},6171:(e,t,r)=>{const n=r(1072),o=r(9372),i=r(8665),s=r(7007),{nanoid:a}=r(3561);class l extends s{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:o=a(8),broker:s="mqtts://broker.hivemq.com:8883",log:c="console",bestEffort:u=!1,version:f="",mqttClientId:d=null}={}){super(),this._validateDomain(n),this._validateAgent(o),this._username=e,this._password=t,this._token=r,this._agent=o,this._domain=n,this._broker=s,this._qos=u?0:1,this._version=f,this._mqttClientId=d||`va3${l._createHash(this._domain+this._agent)}`,"console"===c?(this._log=console,this._log.debug=()=>{}):this._log=c,this._baseTopic=`${this._domain}/${this._agent}`,i.onCallback(this._handleVrpcCallback.bind(this)),this._handleDisposeFailed=({instance:e,className:t,error:r})=>this._log.warn(r,`Dispose of deleted instance ${t}::${e} failed: ${r.message}`),i.on("disposeFailed",this._handleDisposeFailed),this._isolatedInstances=new Map,this._sharedInstances=new Map,this._connectGeneration=0,this._serving=!1,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=a()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=o.connect(this._broker,this._options),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){i.off("disposeFailed",this._handleDisposeFailed);try{if(!this._client||!this._client.connected)return void this.emit("end");const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});const e=this._getClasses();for(const t of e){const e=`${this._baseTopic}/${t}/__classInfo__`;this._mqttPublish(e,null,{retain:!0})}}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:3})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t,r){this._client.subscribe(e,{qos:this._qos,...t},(n,o)=>{if(n)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${n.message}`);else{const r=Array.isArray(e)?e:[e],i=o.filter(e=>128===e.qos).map(e=>e.topic);i.length>0&&((n=new Error(`Could not subscribe all ${r.length} topic(s) but got error qos=128 on following ${i.length} topic(s): ${i}`)).code="SUBSCRIBE_FAILED",n.subscribeOptions=t,this._log.error(n),this.emit("error",n));const s=o.filter(e=>e.qos<this._qos);s.length>0&&((n=new Error(`Could not subscribe all ${r.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`)).code="SUBSCRIBE_REDUCED_QOS",n.subscribeOptions=t,this._log.warn(n),this.emit("error",n)),0===o.length&&this._log.debug(`Already subscribed to topic '${e}'`)}r&&r()})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return i._getClassesArray()}_getInstances(e){return i._getInstancesArray(e)}_getMemberFunctions(e){return i._getMemberFunctionsArray(e)}_getStaticFunctions(e){return i._getStaticFunctionsArray(e)}_getMetaData(e){return i._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._serving?e():(this.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:o,a:i}=e,s=r.startsWith("__e__")?r.slice(5):t;try{this._log.debug(`Forwarding callback to: ${s} with payload:`,e),this._mqttPublish(s,l._stringifySafely({a:i,r:n,e:o,i:r,v:3}))}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${s} because of: ${e.message}`)}}static _stringifySafely(e){let t;const{c:r,f:n}=e;try{t=JSON.stringify(e)}catch(o){this._log.debug(`Failed serialization of return value for: ${r}::${n}, because: ${o.message}`),e.r="__vrpc::not-serializable__",t=JSON.stringify(e)}return t}_handleConnect(){this._log.info("[OK]");const e=++this._connectGeneration,t=[];try{const e=this._generateTopics();e.length>0&&t.push(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}for(const[e,{className:r}]of i._instances.entries())t.push(this._methodsTopic(r,e));let r=t.length;const n=()=>{if(e===this._connectGeneration){this._publishAgentInfoMessage();for(const e of this._getClasses())this._publishClassInfoMessage(e);this._serving=!0,this.emit("connect")}};if(0!==r)for(const e of t)this._mqttSubscribe(e,void 0,()=>{r-=1,0===r&&n()});else n()}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:3};try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();return t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})}),e}_handleMessage(e,t){try{const r=JSON.parse(t.toString());this._log.debug(`Message arrived with topic: ${e} and payload:`,r);const n=e.split("/"),[,,o,s,a]=n;if(4===n.length&&"__clientInfo__"===n[3])return void this._handleClientInfoMessage(e,r);if(5!==n.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);switch(r.c="__static__"===s?o:s,r.f=a,i._call(r)&&this._mqttSubscribe(`${r.s}/__clientInfo__`),a){case"__createIsolated__":{const e=r.r;this._subscribeToMethodsOfNewInstance(o,e),this._registerIsolatedInstance(e,r.s);break}case"__createShared__":{const e=r.r;this._hasSharedInstance(e)||(this._subscribeToMethodsOfNewInstance(o,e),this._publishClassInfoMessage(o)),this._registerSharedInstance(e,r.s);break}case"__delete__":this._unsubscribeMethodsOfDeletedInstance(o,s),this._unregisterInstance(r.a[0],r.s)&&this._publishClassInfoMessage(o)}const{a:c,r:u,e:f,i:d,v:h}=r,p=f?{a:c,r:u,e:f,i:d,v:h}:{a:c,r:u,i:d,v:h};this._mqttPublish(r.s,l._stringifySafely(p))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){i._unregisterClient(r);const e=this._isolatedInstances.get(r);e&&e.forEach(e=>{const t=i._instances.get(e),r={c:t&&t.className,f:"__delete__",a:[e],r:null,s:i.LOCAL_SENDER};i._call(r),r.r&&(this._unsubscribeMethodsOfDeletedInstance(t.className,e),this._log.debug(`Auto-deleted isolated instance: ${e}`))}),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):(this._isolatedInstances.set(t,new Set([e])),this._sharedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.info(`Tracking lifetime of client: ${t}`))}_registerSharedInstance(e,t){const r=this._sharedInstances.get(t);r?r.add(e):(this._sharedInstances.set(t,new Set([e])),this._isolatedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${t}`))}_hasSharedInstance(e){for(const[,t]of this._sharedInstances)if(t.has(e))return!0;return!1}_unregisterInstance(e,t){const r=this._isolatedInstances.get(t);if(r&&r.has(e))return r.delete(e),0===r.size&&(this._isolatedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)),!1;let n=!1;return this._sharedInstances.forEach(async r=>{r.has(e)&&(n=!0,r.delete(e),0===r.size&&(this._sharedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)))}),!!n||(this._log.warn(`Failed un-registering not registered instance: ${e}`),!1)}_methodsTopic(e,t){return`${this._baseTopic}/${e}/${t}/+`}_subscribeToMethodsOfNewInstance(e,t){const r=this._methodsTopic(e,t);this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=this._methodsTopic(e,t);this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this._serving=!1,this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=l},6172:(e,t,r)=>{const{Buffer:n}=r(8287),o={},i=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:o,generateCache:function(){for(let e=0;e<65536;e++)o[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const o=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),i?o.subarray(0,r):o.slice(0,r)},generate4ByteBuffer:function(e){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6188:e=>{"use strict";e.exports=Math.max},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6269:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:o}=r(4469);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:i}=r(2074).codes,s=r(7323),{getHighWaterMark:a}=r(2100);n(c.prototype,s.prototype),n(c,s);const l=o("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}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 f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new i("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},6357:(e,t,r)=>{"use strict";const{pipeline:n}=r(4867),o=r(7323),{destroyer:i}=r(1787),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(5980),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(2074),g=r(577);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,b,_,w;const v=e[0],S=n(e,function(e){const t=_;_=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||d(S)||u(S));if(w=new o({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;g(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(b){const e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{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,t){e||null===_||(e=new h),b=null,r=null,y=null,null===_?t(e):(_=t,s(S)&&i(S,e))},w}},6364:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:o,codes:i}=r(9157),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=i,{kEmptyObject:l,once:c}=r(9862),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:h}=r(4947),{Promise:p,PromisePrototypeThen:m,SymbolDispose:g}=r(2768),{isClosed:y,isReadable:b,isReadableNodeStream:_,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:P,kIsClosedPromise:T}=r(6801);let $;const x=()=>{};function j(e,t,i){var h,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),f(i,"callback"),u(t.signal,"options.signal"),i=c(i),w(e)||k(e))return function(e,t,i){let s=!1,a=x;if(t.signal)if(a=()=>{s=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{$=$||r(9862).addAbortListener;const n=$(t.signal,a),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>i.apply(e,t))};return m(e[T].promise,l,l),x}(e,t,i);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const j=null!==(h=t.readable)&&void 0!==h?h:_(e),N=null!==(p=t.writable)&&void 0!==p?p:A(e),C=e._writableState,M=e._readableState,L=()=>{e.writable||B()};let D=P(e)&&_(e)===j&&A(e)===N,F=I(e,!1);const B=()=>{F=!0,e.destroyed&&(D=!1),(!D||e.readable&&!j)&&(j&&!U||i.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(D=!1),(!D||e.writable&&!N)&&(N&&!F||i.call(e))},q=t=>{i.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?i.call(e,t):j&&!U&&_(e,!0)&&!v(e,!1)?i.call(e,new a):!N||F||I(e,!1)?void i.call(e):i.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?N&&!C&&(e.on("end",L),e.on("close",L)):(e.on("complete",B),D||e.on("abort",z),e.req?G():e.on("request",G)),D||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=C&&C.errorEmitted||null!=M&&M.errorEmitted?D||n.nextTick(H):(j||D&&!b(e)||!F&&!1!==E(e))&&(N||D&&!E(e)||!U&&!1!==b(e))?M&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{i=x,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",L),e.removeListener("close",L),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=i;K(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{$=$||r(9862).addAbortListener;const n=$(t.signal,s),o=i;i=c((...t)=>{n[g](),o.apply(e,t)})}}return K}e.exports=j,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p((r,o)=>{const i=j(e,t,e=>{n&&i(),e?o(e):r()})})}},6370:()=>{},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),l=r(3025),c=r(9713),u=r(8660),f=r(117),d=r(5333),h=r(7923),p=r(6505),m=r(6163),g=r(5844),y=r(1239),b=r(4426);t.default=function(e=!1){const t=[h.default,p.default,m.default,g.default,y.default,b.default,c.default,u.default,l.default,f.default,d.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),o=r(3126),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),o=r(8452);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6585:e=>{var t=1e3,r=60*t,n=60*r,o=24*n,i=7*o;function s(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\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(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=o?s(l,c,o,"day"):c>=n?s(l,c,n,"hour"):c>=r?s(l,c,r,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6644:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:l,parentSchema:c,it:u}=e,{oneOf:f}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!f)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),p=t.const("tag",n._`${r}${(0,n.getProperty)(d)}`);function m(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${p} == "string"`,()=>function(){const r=function(){var e;const t={},r=o(c);let n=!0;for(let t=0;t<f.length;t++){let c=f[t];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){const e=c.$ref;if(c=i.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof i.SchemaEnv&&(c=c.schema),void 0===c)throw new s.default(u.opts.uriResolver,u.baseId,e)}const h=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[d];if("object"!=typeof h)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||o(c)),l(h,t)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(d)}function l(e,t){if(e.const)h(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const r of e.enum)h(r,t)}}function h(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${p} === ${e}`),t.assign(h,m(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:p,tagName:d}),t.endIf()}(),()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:p,tagName:d})),e.ok(h)}};t.default=l},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6801:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:i}=r(2768),s=i("nodejs.stream.destroyed"),a=i("nodejs.stream.errored"),l=i("nodejs.stream.readable"),c=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function h(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 m(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||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function _(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!_(e)&&h(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!_(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 k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:_,kIsDestroyed:s,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,o,i,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:c,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0: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 m(e)?!(!_(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[o]:"function"==typeof e[n]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return m(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:m,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;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return m(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:k,willEmitClose:function(e){if(!m(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},6887:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.isReactNativeBrowser=t.isWebWorker=void 0;const o=()=>Boolean("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&"undefined"==typeof Deno),i=()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product,s="undefined"!=typeof window&&("undefined"!=typeof navigator&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&n?.versions?!Object.prototype.hasOwnProperty.call(n.versions,"electron"):void 0!==window.document)||o()||i();t.isWebWorker=o(),t.isReactNativeBrowser=i(),t.default=s},6891:(e,t,r)=>{"use strict";var n,o=r(2045);e.exports=k,k.ReadableState=A,r(7007).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},a=r(1396),l=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(7199);i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,d,h,p=r(1766),m=r(4347),g=r(6644).getHighWaterMark,y=r(2463).F,b=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(k,a);var S=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(e,t,o){n=n||r(8101),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3141).I),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function k(e){if(n=n||r(8101),!(this instanceof k))return new k(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function I(e,t,r,n,o){i("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,$(e)))}}(e,a);else if(o||(s=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)a.endEmitted?S(e,new v):O(e,a,t,!0);else if(a.ended)S(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):x(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,x(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),x(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=m.destroy,k.prototype._undestroy=m.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),I(this,e,t,!1,r)},k.prototype.unshift=function(e){return I(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){f||(f=r(3141).I);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var R=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick($,e))}function $(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function x(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){i("readable nexttick read 0"),e.read(0)}function M(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(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);var r}function F(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):T(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){S(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===o.stdout||e===o.stderr?m:l;function l(){i("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",function t(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",f),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var u=!1;function f(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),m(),e.removeListener("error",d),0===s(e,"error")&&S(e,t)}function h(){e.removeListener("finish",p),m()}function p(){i("onfinish"),e.removeListener("close",h),m()}function m(){i("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?T(this):n.reading||o.nextTick(C,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(N,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(N,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(M,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5034)),d(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=D,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===h&&(h=r(968)),h(k,e,t)})},6897:(e,t,r)=>{"use strict";var n=r(453),o=r(41),i=r(592)(),s=r(5795),a=r(9675),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var u=s(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},6912:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(4959)),i=n(r(5228)),s=n(r(495)),a=n(r(1021)),l=n(r(4264)),c=r(4723);t.default=(e,t,r,n)=>{const{options:u}=e,f=u.properties?.maximumPacketSize,d=1+(e=>e<128?1:e<16384?2:e<2097152?3:4)(h=t.length)+h;var h;if(5===u.protocolVersion&&f&&f<d)return e.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",t.cmd,d,f),n?.discardParsedPackets(),e._cleanUp(!0),r(),e.emit("error",new c.ErrorWithReasonCode(`exceeding packets size ${t.cmd}: ${d} bytes, maximumPacketSize is ${f}`,149)),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,o.default)(e,t,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing();try{(0,a.default)(e,t)}finally{r()}break;case"pubrel":e.reschedulePing(),(0,l.default)(e,t,r);break;case"connack":try{(0,s.default)(e,t,n)}finally{r()}break;case"auth":e.reschedulePing();try{(0,i.default)(e,t,n)}finally{r()}break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(l))return!0;if("object"==typeof r&&l(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=c(e)),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=h(t));const n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=f;const d=/#\/?$/;function h(e){return e?e.replace(d,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,r){return r=h(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=h(e[r]||t),a={"":s},l=u(n,s,!1),c={},f=new Set;return i(e,{allKeys:!0},(e,t,n,o)=>{if(void 0===o)return;const i=l+t;let s=a[o];function u(t){const r=this.opts.uriResolver.resolve;if(t=h(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(e,n.schema,t):t!==h(i)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=i),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s}),c;function d(e,t,r){if(void 0!==t&&!o(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},6968:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){p("SOCKS connection to %s:%d via %s",e,t,r);const o=new m;return async function(e,t,r,n,o={}){const i=o.lookup??(0,d.promisify)(f.lookup),[s,a]=function(e){const t=new URL(e);if(t.pathname||t.hash||t.search)throw g(new Error("bad SOCKS URL"));const[r,n]=function(e){switch(e){case"socks5h:":return[5,!0];case"socks4a:":return[4,!0];case"socks5:":return[5,!1];case"socks4:":return[4,!1];default:return[void 0,!1]}}(t.protocol);if(!r)throw g(new Error("bad SOCKS URL: invalid protocol"));const o=parseInt(t.port,10);if(Number.isNaN(o))throw g(new Error("bad SOCKS URL: invalid port"));return[{host:t.hostname,port:o,type:r},n]}(r);a||(p("resolving %s locally",e),e=(await i(e,{family:4===s.type?4:0})).address),p("establishing SOCKS%d connection to %s:%d via %s:%d",s.type,e,t,s.host,s.port);const l=new u.SocksClient({command:"connect",destination:{host:e,port:t},proxy:{...s},timeout:o.timeout});l.connect(),l.on("established",({socket:e})=>n._start(e)),l.on("error",e=>{p("SOCKS failed: %s",e),n.destroy(g(e))})}(e,t,r,o,n).catch(e=>{p("SOCKS failed: %s",e),o.destroy(e)}),o};const l=a(r(7833)),c=r(8310),u=r(9122),f=s(r(9288)),d=r(537),h=a(r(4148)),p=(0,l.default)("mqttjs:socks");class m extends c.Duplex{_flowing=!1;_socket;constructor(){super({autoDestroy:!1}),this.cork()}_start(e){p("proxy stream started"),(0,h.default)(!this._socket),this.destroyed?e.destroy(this.errored):(this._socket=e,this._flowing||e.pause(),e.on("data",this._onData),e.on("end",this._onEnd),e.on("error",this._onError),e.on("close",this._onClose),e.emit("connect"),this.uncork())}_write(e,t,r){(0,h.default)(this._socket),this._socket.write(e,r)}_read(e){this._flowing=!0,this._socket?.resume?.()}_destroy(e,t){this._socket?.destroy?.(e),t(e)}_onData=e=>{(0,h.default)(this._socket),this._flowing=this.push(e),this._flowing||this._socket.pause()};_onEnd=()=>{p("proxy stream received EOF"),this.push(null)};_onClose=()=>{p("proxy stream closed"),this.destroy()};_onError=e=>{p("proxy stream died with error %s",e),this.destroy(e)}}function g(e){try{return void 0===e.code&&(e.code="SOCKS"),e}catch{return e}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,s,c;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}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 f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):p(o,o.length)}function h(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 m(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 o(i){n.once&&e.removeEventListener(t,o),r(i)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=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||o(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 l(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){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=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(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(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||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 o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);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 d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),l=r(4003),c=r(1163),u=r(617),f=r(7935),d=r(8643),h=[n.default,o.default,i.default,s.default,a.default,l.default,c.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,d.default];t.default=h},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,o,i,s,a,l,c,u,f,d){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in o(s,a,l,c,u,f,d),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)r(e,o,i,p[m],a+"/"+h+"/"+m,l,a,h,s,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)r(e,o,i,p[g],a+"/"+h+"/"+n(g),l,a,h,s,g)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,o,i,p,a+"/"+h,l,a,h,s)}i(s,a,l,c,u,f,d)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,o=r(3126),i=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&i&&i(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},7199:()=>{},7244:(e,t,r)=>{"use strict";var n=r(9092)(),o=r(6556)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},s=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},a=function(){return i(arguments)}();i.isLegacyArguments=s,e.exports=a?i:s},7302:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:s}=r(9157),{Symbol:a}=r(2768),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(6801),d=a("kDestroy"),h=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t,r){let o=!1;function i(t){if(o)return;o=!0;const i=e._readableState,s=e._writableState;p(t,s,i),s&&(s.closed=!0),i&&(i.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(y,e)}try{e._destroy(t||null,i)}catch(t){i(t)}}function g(e,t){b(e,t),y(e)}function y(e){const 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){const 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 _(e,t,r){const o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),r?n.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function r(r){if(t)return void _(e,null!=r?r:new i);t=!0;const o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(d,r):r?_(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(h)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(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?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,i=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?m(this,e,t):this.once(d,function(r){m(this,o(r,e),t)}),this)},undestroy:function(){const 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:_}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,l="maxLength"===t?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${c} ${l} ${s}`)}};t.default=s},7323:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:i,ObjectSetPrototypeOf:s}=r(4469);e.exports=c;const a=r(2729),l=r(8601);s(c.prototype,a.prototype),s(c,a);{const e=i(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.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}let u,f;function d(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...o(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(l.prototype,"writableLength")},writableFinished:{__proto__:null,...o(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(l.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 d().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5769)),f(e,"body")}},7396:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),o=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,o,{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++){const 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){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(e>this.length||e<0)return;const 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,r,o){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof o||o>this.length)&&(o=this.length),r>=this.length)return e||n.alloc(0);if(o<=0)return e||n.alloc(0);const i=!!e,s=this._offset(r),a=o-r;let l=a,c=i&&t||0,u=s[1];if(0===r&&o===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-u)return i?this._bufs[s[0]].copy(e,t,u,u+l):this._bufs[s[0]].slice(u,u+l);i||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-u;if(!(l>r)){this._bufs[t].copy(e,c,u,u+l),c+=r;break}this._bufs[t].copy(e,c,u),c+=r,l-=r,u&&(u=0)}return e.length>c?e.slice(0,c):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();const r=this._offset(e),n=this._offset(t),o=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),0!==r[1]&&(o[0]=o[0].slice(r[1])),this._new(o)},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(){const 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,r){if(null==e)return this;if(e.buffer)t.call(this,n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){const[n,o]=r?[e.length-1,-1]:[0,1];for(let i=n;i>=0&&i<e.length;i+=o)this._attach(e[i],t,r)}else if(this._isBufferList(e)){const[n,o]=r?[e._bufs.length-1,-1]:[0,1];for(let i=n;i>=0&&i<e._bufs.length;i+=o)this._attach(e._bufs[i],t,r)}else"number"==typeof e&&(e=e.toString()),t.call(this,n.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,r){if(void 0===r&&"string"==typeof t&&(r=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=n.from([e]):"string"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.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;const o=this._offset(t);let i=o[0],s=o[1];for(;i<this._bufs.length;i++){const t=this._bufs[i];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([i,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([i,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(){const 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(const 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[o]},e.exports=i},7419:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},7487:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=n.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 i(e){var t;switch(this.encoding=function(e){var t=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 t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 l(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 c(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 u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.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||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=s(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=s(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=s(t[n]))>=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)},i.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}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=a(e),s=i[0],l=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,f=l>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(c(e,a,a+s>l?l:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(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 l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(l(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7602:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(2768);e.exports=N,N.WritableState=x;const{EventEmitter:h}=r(7007),p=r(8745).Stream,{Buffer:m}=r(8287),g=r(7302),{addAbortSignal:y}=r(5121),{getHighWaterMark:b,getDefaultHighWaterMark:_}=r(3513),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(9157).codes,{errorOrDestroy:P}=g;function T(){}c(N.prototype,p.prototype),c(N,p);const $=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,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,j(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[$]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function N(e){const t=this instanceof r(2648);if(!t&&!s(N,this))return new N(e);this._writableState=new x(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,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new R(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=T)}if(null===t)throw new I;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return i.ending?s=new O:i.destroyed&&(s=new A("write")),s?(n.nextTick(o,s),P(e,s,!0),s):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const 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:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==T&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),U(t),P(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(L,e,r,t,i):L(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(F,r.afterWriteTickInfo)):B(e,r,1,i))):P(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(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&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[$].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?T:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===a?r:o(r,a);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),j(t)}else{do{const{chunk:n,encoding:o,callback:s}=r[a];r[a++]=null,M(e,t,!1,i?1:n.length,n,o,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(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,r){q(t)&&(function(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 r=!1;function o(o){if(r)P(e,null!=o?o:S());else if(r=!0,t.pendingcb--,o){const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e](o);P(e,o,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},a(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(N,d,{__proto__:null,value:function(e){return!!s(this,e)||this===N&&e&&e._writableState instanceof x}}),N.prototype.pipe=function(){P(this,new E)},N.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},N.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!m.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},N.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},N.prototype._writev=null,N.prototype.end=function(e,t,r){const o=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof i&&(s=r)}return o.corked&&(o.corked=1,this.uncork()),s||(o.errored||o.ending?o.finished?s=new k("end"):o.destroyed&&(s=new A("end")):(o.ending=!0,V(this,o,!0),o.ended=!0)),"function"==typeof r&&(s||o.finished?n.nextTick(r,s):o[$].push(r)),this},l(N.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(){const 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(){const 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)}}});const H=g.destroy;let G;function K(){return void 0===G&&(G={}),G}N.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[$].length)&&n.nextTick(U,r),H.call(this,e,t),this},N.prototype._undestroy=g.undestroy,N.prototype._destroy=function(e,t){t(e)},N.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},N.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},N.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7653:(e,t,r)=>{"use strict";var n=r(8452),o=r(487),i=r(9211),s=r(9394),a=r(6576),l=o(s(),Object);n(l,{getPolyfill:s,implementation:i,shim:a}),e.exports=l},7712:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(2074),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(1580),d=r(4469).Symbol("kWeak"),h=r(4469).Symbol("kResistStopPropagation"),{finished:p}=r(577),m=r(6357),{addAbortSignalNoValidate:g}=r(982),{isWritable:y,isNodeStream:b}=r(5980),{deprecate:_}=r(7797),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:P}=r(4469),T=P("kEmpty"),$=P("kEof");function x(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let o=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(o=S(t.highWaterMark)),u(n,"options.concurrency",1),u(o,"options.highWaterMark",0),o+=n,async function*(){const i=r(7797).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:i};let u,f,d=!1,h=0;function p(){d=!0,m()}function m(){h-=1,g()}function g(){f&&!d&&h<n&&a.length<o&&(f(),f=null)}!async function(){try{for await(let t of s){if(d)return;if(i.aborted)throw new l;try{if(t=e(t,c),t===T)continue;t=O(t)}catch(e){t=I(e)}h+=1,R(t,m,p),a.push(t),u&&(u(),u=null),!d&&(a.length>=o||h>=n)&&await new k(e=>{f=e})}a.push($)}catch(e){const t=I(e);R(t,m,p),a.push(t)}finally{d=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===$)return;if(i.aborted)throw new l;e!==T&&(yield e),a.shift(),g()}await new k(e=>{u=e})}}finally{d=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of N.call(this,e,t))return!0;return!1}function N(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return x.call(this,async function(t,r){return await e(t,r)?t:T},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:_(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({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&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:N,flatMap:function(e,t){const r=x.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:x,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!y(e))throw new o("stream",e,"must be writable");const r=m(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.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(const r of x.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,r){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(o=r.signal)&&void 0!==o&&o.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this,[h]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let m=!1;try{for await(const n of this){var g;if(m=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!m&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of N.call(this,e,t))return r}}},7720:(e,t,r)=>{"use strict";var n=r(4765),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=1024;e.exports={arrayToObject:a,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"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(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(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<a.length;u+=l){for(var f=a.length>=l?a.slice(u,u+l):a,d=[],h=0;h<f.length;++h){var p=f.charCodeAt(h);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||i===n.RFC1738&&(40===p||41===p)?d[d.length]=f.charAt(h):p<128?d[d.length]=s[p]:p<2048?d[d.length]=s[192|p>>6]+s[128|63&p]:p<55296||p>=57344?d[d.length]=s[224|p>>12]+s[128|p>>6&63]+s[128|63&p]:(h+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(h)),d[d.length]=s[240|p>>18]+s[128|p>>12&63]+s[128|p>>6&63]+s[128|63&p])}c+=d.join("")}return c},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(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach(function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r}),t):Object.keys(r).reduce(function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t},s)}}},7732:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const a=r(9993),l=s(r(6887)),c={set:a.setInterval,clear:a.clearInterval},u={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};t.default=e=>{switch(e){case"native":return u;case"worker":return c;default:return!l.default||l.isWebWorker||l.isReactNativeBrowser?u:c}}},7797:(e,t,r)=>{"use strict";const n=r(8287),{format:o,inspect:i}=r(2858),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(2074),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(4469),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,d=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||n.Blob,p=void 0!==h?function(e){return e instanceof h}:function(e){return!1},m=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,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:o,inspect:i,types:{isAsyncFunction:e=>e instanceof d,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return m(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{m(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7829:(e,t,r)=>{"use strict";const n=r(9037),o=r(3942),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},7833:(e,t,r)=>{var n=r(2045);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i||(t.UsedValueState=i={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const l=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,n.setValue(t,{property:o,itemIndex:l}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let l=n.nil;for(const c in e){const u=e[c];if(!u)continue;const f=s[c]=s[c]||new Map;u.forEach(e=>{if(f.has(e))return;f.set(e,i.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=n._`${l}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);l=n._`${l}${s}${this.opts._n}`}f.set(e,i.Completed)})}return l}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:l}=e;if(void 0===r)return;const c=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${c}`);let u=n._`${c} === undefined`;"empty"===l.useDefaults&&(u=n._`${u} || ${c} === null || ${c} === ""`),i.if(u,n._`${c} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>i(e,r,t.default))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:l}=e;s||l&&"object"==typeof l?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${l} !== ${r}`)}};t.default=s},7969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9584),o={objectMode:!0},i={clean:!0};t.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...i,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(o),t=[];let r=!1,i=0;return this._inflights.forEach((e,r)=>{t.push(e)}),e._read=()=>{!r&&i<t.length?e.push(t[i++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){const 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){const 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()}}},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),o=r(487),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8101:(e,t,r)=>{"use strict";var n=r(2045),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(6891),s=r(1999);r(6698)(u,i);for(var a=o(s.prototype),l=0;l<a.length;l++){var c=a[l];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},8184:(e,t,r)=>{"use strict";var n=r(6556),o=r(9721)(/^\s*(?:function)?\*/),i=r(9092)(),s=r(3628),a=n("Object.prototype.toString"),l=n("Function.prototype.toString"),c=r(4233);e.exports=function(e){if("function"!=typeof e)return!1;if(o(l(e)))return!0;if(!i)return"[object GeneratorFunction]"===a(e);if(!s)return!1;var t=c();return t&&s(e)===t.prototype}},8203:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.streamBuilder=t.browserStreamBuilder=void 0;const o=r(8287),i=n(r(1591)),s=n(r(7833)),a=r(9584),l=n(r(6887)),c=r(2635),u=(0,s.default)("mqttjs:ws"),f=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function d(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){const t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),l.default||e.forceNativeWebSocket||"wss"!==e.protocol||f.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}t.streamBuilder=(e,t)=>{u("streamBuilder");const r=h(t);r.hostname=r.hostname||r.host||"localhost";const n=d(r,e),o=function(e,t,r){u("createWebSocket"),u(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";let o;return u(`creating new Websocket for url: ${t} and protocol: ${n}`),o=r.createWebsocket?r.createWebsocket(t,[n],r):new i.default(t,[n],r.wsOptions),o}(0,n,r),s=i.default.createWebSocketStream(o,r.wsOptions);return s.url=n,o.on("close",()=>{s.destroy()}),s},t.browserStreamBuilder=(e,t)=>{let r;u("browserStreamBuilder");const n=function(e){const t=h(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const 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),i=n.browserBufferSize||524288,s=t.browserBufferTimeout||1e3,l=!t.objectMode,f=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=d(t,e);let o;return o=t.createWebsocket?t.createWebsocket(n,[r],t):new WebSocket(n,[r]),o.binaryType="arraybuffer",o}(e,t),p=function(e){const t=new a.Transform({objectMode:e.objectMode});return t._write=function e(t,r,n){if(f.bufferedAmount>i)return void setTimeout(e,s,t,r,n);l&&"string"==typeof t&&(t=o.Buffer.from(t,"utf8"));try{f.send(t)}catch(e){return n(e)}n()},t._flush=function(e){f.close(),e()},t}(t);t.objectMode||(p._writev=c.writev.bind(p)),p.on("close",()=>{f.close()});const m=void 0!==f.addEventListener;function g(){u("WebSocket onOpen"),r instanceof c.BufferedDuplex&&r.socketReady()}function y(e){u("WebSocket onClose",e),r.end(),r.destroy()}function b(e){u("WebSocket onError",e);const t=new Error("WebSocket error");t.event=e,r.destroy(t)}async function _(e){if(!p||!p.readable||!p.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?o.Buffer.from(t):t instanceof Blob?o.Buffer.from(await new Response(t).arrayBuffer()):o.Buffer.from(t,"utf8"),p.push(t)}return f.readyState===f.OPEN?(r=p,r.socket=f):(r=new c.BufferedDuplex(t,p,f),m?f.addEventListener("open",g):f.onopen=g),m?(f.addEventListener("close",y),f.addEventListener("error",b),f.addEventListener("message",_)):(f.onclose=y,f.onerror=b,f.onmessage=_),r}},8287:(e,t,r)=>{"use strict";const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(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 f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(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(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const o=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.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 u(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 f(e){return u(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(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,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(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);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:H(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,o){let i,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 c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return K(G(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(i=l));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:r=e[o+1],n=e[o+2],a=e[o+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&&(i=l))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"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(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.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 o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const 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)y(this,t,t+1);return this},l.prototype.swap32=function(){const 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)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const 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)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.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===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(i,s),c=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==u[e]){i=c[e],s=u[e];break}return i<s?-1:s<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.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)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function T(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function $(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function x(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 j(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;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,o){W(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;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 M(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const 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);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),l.prototype.readBigUInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const 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)}),l.prototype.readBigInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const 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)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeBigUInt64LE=X(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=X(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(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},l.prototype.writeBigInt64LE=X(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=X(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.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)return 0;if(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);const o=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),o},l.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&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const 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 o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=l.isBuffer(e)?e:l.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%s]}return this};const F={};function B(e,t,r){F[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 U(e){let t="",r=e.length;const 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 W(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function q(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=U(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=U(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8310:(e,t,r)=>{e.exports=o;var n=r(7007).EventEmitter;function o(){n.call(this)}r(6698)(o,n),o.Readable=r(6891),o.Writable=r(1999),o.Duplex=r(8101),o.Transform=r(9083),o.PassThrough=r(3681),o.finished=r(4257),o.pipeline=r(5267),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",l));var s=!1;function a(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:o,recomposeAuthority:i,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:l}=r(4834),{SCHEMES:c,getSchemeHandler:u}=r(343);function f(e,t,r,n){const i={};return n||(e=p(d(e,r),r),t=p(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=u(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&s.push(r.scheme,":");const l=i(r);if(void 0!==l&&("suffix"!==n.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){const r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let i=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const s=e.match(h);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(!1===a(o.host)){const e=n(o.host);o.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||void 0!==o.query||o.path?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const t=u(r.scheme||o.scheme);if(!(r.unicodeSupport||t&&t.unicodeSupport)&&o.host&&(r.domainHost||t&&t.domainHost)&&!1===i&&l(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),void 0!==o.host&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),t&&t.parse&&t.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=d(p(e,t),t):"object"==typeof e&&(e=p(d(e,t),t)),e},resolve:function(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=f(p(e,n),p(t,n),n,!0);return n.skipEscape=!0,d(o,n)},resolveComponent:f,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=d(s(p(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=d(s(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=d(s(p(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=d(s(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:p};e.exports=m,e.exports.default=m,e.exports.fastUri=m},8389:function(e,t){!function(e){"use strict";var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,o=1073741824,i=new WeakMap,s=function(e,t){return function(i){var s=t.get(i),a=void 0===s?i.size:s<o?s+1:0;if(!i.has(a))return e(i,a);if(i.size<n){for(;i.has(a);)a=Math.floor(Math.random()*o);return e(i,a)}if(i.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;i.has(a);)a=Math.floor(Math.random()*r);return e(i,a)}}((t=i,function(e,r){return t.set(e,r),r}),i),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s}(t)},8403:(e,t,r)=>{"use strict";var n=r(1189),o=r(1333)(),i=r(6556),s=r(9612),a=i("Array.prototype.push"),l=i("Object.prototype.propertyIsEnumerable"),c=o?s.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=s(e);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var u=s(arguments[i]),f=n(u),d=o&&(s.getOwnPropertySymbols||c);if(d)for(var h=d(u),p=0;p<h.length;++p){var m=h[p];l(u,m)&&a(f,m)}for(var g=0;g<f.length;++g){var y=f[g];if(l(u,y)){var b=u[y];r[y]=b}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,s=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=s.call(i,Object.getOwnPropertySymbols(t)));for(var a=0;a<i.length;a+=1)c(e,i[a],t[i[a]],r[i[a]])};u.supportsDescriptors=!!l,e.exports=u},8577:(e,t,r)=>{var n=r(2045);const o=r(1072),{nanoid:i}=r(3561),s=r(9372),a=r(7007),l=r(3530);class c extends a{constructor({token:e,password:t,username:r,domain:n,agent:o="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:c=12e3,log:u="console",bestEffort:f=!0,mqttClientId:d=null,identity:h=null,keepalive:p=30,requiresSchema:m=!1,tls:g=null}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(o.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(h&&h.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=d){if("string"!=typeof d||0===d.length)throw new Error("The mqttClientId must be a non-empty string");if(d.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=o,this._domain=n,this._broker=s,this._timeout=c,this._identity=h,this._keepalive=p,this._qos=this._qos=f?0:1,this._requiresSchema=m,this._instance=i(8),this._mqttClientId=d||this._createMqttClientId(),this._tls=g,this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=i(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._subscribeRetrier=new l({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log}),this._callbackIds=new WeakMap,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}static _tlsOptions(e){if(!e)return{rejectUnauthorized:!1};const t={rejectUnauthorized:!1!==e.rejectUnauthorized};return e.ca&&(t.ca=e.ca),t}async connect(){if(this._client&&this._client.connected)return;let e=this._username,t=this._password;this._token&&(e=e||this._generateUserName(),t=this._token);const r={username:e,password:t,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,...c._tlsOptions(this._tls),connectTimeout:this._timeout,reconnectOnConnackError:!0,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===e&&delete r.username,void 0===t&&delete r.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,r),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t)=>{if(0!==t.length)try{const r=e.split("/"),[n,o,i,s]=r;if(n!==this._domain)return void this._log.warn(`Received message from foreign domain: ${n}`);if("__agentInfo__"===i){const{status:e,hostname:r,version:i}=JSON.parse(t.toString());this._createIfNotExist(o),this._agents[o].status=e,this._agents[o].hostname=r,this._agents[o].version=i,"offline"===e&&this._clearCachedSubscriptions({lostAgent:o}),this.emit("agent",{domain:n,agent:o,status:e,hostname:r,version:i})}else if("__classInfo__"===s||"__classInfoConcise__"===s){const e=JSON.parse(t.toString());this._createIfNotExist(o);const r=this._agents[o].classes[i],s=e.instances||[],a=r?r.instances:[],l=a.filter(e=>!s.includes(e)),c=s.filter(e=>!a.includes(e));this._agents[o].classes[i]=e;const{className:u,instances:f,memberFunctions:d,staticFunctions:h,meta:p}=e;0!==l.length&&(this.emit("instanceGone",l,{domain:n,agent:o,className:u}),l.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:o,className:u}))),0!==c.length&&this.emit("instanceNew",c,{domain:n,agent:o,className:u}),this.emit("class",{domain:n,agent:o,className:u,instances:f,memberFunctions:d,staticFunctions:h,meta:p||{}})}else{const{i:e,a:r,e:n,r:o}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:o})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),new Promise((e,t)=>{const r=setTimeout(()=>{this._client.end(!0,()=>{t(new Error(`Connection trial timed out (> ${this._timeout} ms)`))})},this._timeout);this._client.once("connect",()=>{clearTimeout(r),e()})})}async create({className:e,instance:t=i(8),args:r=[],agent:n=this._agent,cacheProxy:o=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},l=await this._getProxy(n,e,a);return t&&o&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:l}),l}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:o}=await this._getInstanceData(e,t);return this._createProxy(n,o,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),o={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},i=`${this._domain}/${r}/${n}/__static__/__delete__`;this._mqttPublish(i,JSON.stringify(o)),delete this._proxies[`${r}/${n}/${e}`];const s=await this._handleAgentAnswer(o,r);return!0===s&&this._forgetInstance({agent:r,className:n,instance:e}),s}_forgetInstance({agent:e,className:t,instance:r}){const n=this._agents[e]&&this._agents[e].classes[t];if(!n||!Array.isArray(n.instances))return;if(!n.instances.includes(r))return;n.instances=n.instances.filter(e=>e!==r);const o=this._domain;this.emit("instanceGone",[r],{domain:o,agent:e,className:t}),this._clearCachedSubscriptions({lostInstance:r,agent:e,className:t})}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!o)return;const i={c:e,f:t,a:o,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},s=`${this._domain}/${n}/${e}/__static__/${t}`;return await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(i)),this._handleAgentAnswer(i,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};if("*"===n){const n=[],i=this.getAvailableAgents();for(const s of i){const i=`${this._domain}/${s}/${e}/__static__/__callAll__`,a=await this._wrapArguments({agent:s,className:e,functionName:t,args:r});if(!a)continue;o.a=[t,...a],await this._waitUntilClassIsOnline(s,e),this._mqttPublish(i,JSON.stringify(o));const l=await this._handleAgentAnswer(o,s);n.push(...l)}return n}const i=`${this._domain}/${n}/${e}/__static__/__callAll__`,s=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(s)return o.a=[t,...s],await this._waitUntilClassIsOnline(n,e),this._mqttPublish(i,JSON.stringify(o)),this._handleAgentAnswer(o,n)}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){return this._token=e,this._agent=t,this._client&&await new Promise(e=>this._client.end(!1,{},e)),this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r){const r=`${this._domain}/${e}/${t}/__classInfo__`;this._mqttPublish(r,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:3})),this._eventEmitter.removeAllListeners(),this.removeAllListeners();const e=this._client;return this._client=null,new Promise(t=>e.end(!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_getCallbackId(e,{readOnly:t=!1}={}){if(!this._callbackIds.has(e)){if(t)return null;this._callbackIds.set(e,i(8))}return this._callbackIds.get(e)}_generateUserName(){return`${this._domain}:client@${o.hostname()}-${o.platform()}-js`}_createMqttClientId(){const e=o.arch()+o.homedir()+o.hostname()+JSON.stringify(o.networkInterfaces())+o.platform()+o.release()+o.totalmem()+o.type(),t=c._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${o.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect()))})}async _mqttSubscribe(e,t){return new Promise((r,n)=>{this._client.subscribe(e,{qos:this._qos,...t},(o,i)=>{if(o){if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${o.message}`),"client disconnecting"===o.message){const e=`Failed to subscribe, because: ${o.message}`;this._log.error(e),this.emit("error",o),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect(),n(new Error(e))}}else{const n=Array.isArray(e)?e:[e],s=i.filter(e=>128===e.qos).map(e=>e.topic);s.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${s.length} topic(s): ${s}`)).code="SUBSCRIBE_FAILED",o.subscribeOptions=t,this._log.error(o.message),this.emit("error",o),this._subscribeRetrier.schedule(s,t)),this._subscribeRetrier.granted(i.filter(e=>128!==e.qos).map(e=>e.topic));const a=i.filter(e=>e.qos<this._qos);a.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${a.length} topic(s): ${JSON.stringify(a)}`)).code="SUBSCRIBE_REDUCED_QOS",o.subscribeOptions=t,this._log.warn(o.message),this.emit("error",o)),0===i.length&&this._log.debug(`Already subscribed to: ${e}`),r()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i:o}=r,i=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(i,JSON.stringify(r)),new Promise((r,i)=>{const s=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(o),i(new Error(s))},this._timeout);this._eventEmitter.once(o,({e:o,r:s})=>{if(clearTimeout(a),o){const{message:r,cause:s}=c._prepareError(o);i(new Error(`[vrpc ${e}-${t}-${n}]: ${r}`,{cause:s}))}else{const n=this._createProxy(e,t,s);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let o=null;const i=()=>{this._hasClassOnline(e,t)&&(o&&clearTimeout(o),this.removeListener("class",i),r())};o=setTimeout(()=>{this.removeListener("class",i),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",i)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,o=`${this._instance}-${this._proxyId++}`,i={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:o};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{i[s]="removeAllListeners"!==s?async(...i)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:s,args:i});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async t=>{if(!t)throw new Error("VRPC does not support removing all listeners");Object.keys(this._cachedSubscriptions).filter(e=>{const n=this._cachedSubscriptions[e];return n.instance===r&&n.event===t}).forEach(e=>{const t=`__e__${e}`;this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]});try{const o={c:r,f:s,a:[t],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(o)),this._handleAgentAnswer(o,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(i.vrpcOn=async(i,...s)=>{if(!a.has(i))throw new Error("Bad magic");const l=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:"vrpcOn",args:[i,...s]});if(l)try{const t={c:r,f:i,a:l.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${i}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${i}" because: ${e.message}`)}},i.vrpcOff=n=>{const o=`__e__${this._domain}/${e}/${t}/${r}-${n}`;this._eventEmitter.removeAllListeners(o)}),i}async _handleAgentAnswer({i:e,c:t,f:r},n){return new Promise((o,i)=>{const s=`Function call "${t}::${r}()" on agent "${n}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(e),i(new Error(s))},this._timeout);this._eventEmitter.once(e,e=>{if(clearTimeout(a),e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else{const s=e.r;"string"==typeof s&&"__p__"===s.substring(0,5)?this._eventEmitter.once(s,e=>{if(e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else o(e.r)}):o(s)}})})}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const o=n=>(i,{agent:s,className:a})=>{if(i.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",o),r({agent:s,className:a,instance:e})}},i=setTimeout(()=>{this.removeListener("instanceNew",o(i));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",o(i))})}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:o,args:i}){const s=[],a=/^(on|notify|monitor|signal)/.test(o),l=/^(off|remove|unmonitor|unsignal)/.test(o);for(const[c,u]of i.entries()){if(this._isFunction(u)){const f=u;if("vrpcOn"===o||"on"===o&&1===c&&"string"==typeof i[0]||a){const n="string"==typeof i[0]?i[0]:o,a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:f});s.push(a);continue}if(("off"===o||"removeListener"===o)&&1===c&&"string"==typeof i[0]||l){const e=await this._offRemoteEvent({callback:f});if(!e&&("off"===o||"removeListener"===o))return null;s.push(e||null);continue}{const r=`__f__${n||`${e}-${t}`}-${o}-${c}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;s.push(r),this._eventEmitter.once(r,({a:e})=>u.apply(null,e));continue}}if(this._isEmitter(u)){const{emitter:n,event:o}=u;let i=(...e)=>n.emit(o,...e);if(this._emitterListener.has(n)){const e=this._emitterListener.get(n);e.has(o)?i=e.get(o):e.set(o,i)}else this._emitterListener.set(n,new Map([[o,i]]));const a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:o,callback:i});s.push(a);continue}s.push(u)}return s}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:o}){const i=`${e}-${t}-${r||"__static__"}-${n}-${this._getCallbackId(o)}`,s=c._createHash(i,12),a=`${this._vrpcConnectionId}/${s}`,l=`__e__${a}`,u=({a:e})=>o.apply(null,e);return 0===this._eventEmitter.listenerCount(l)&&this._eventEmitter.on(l,u),this._cachedSubscriptions[a]?this._cachedSubscriptions[a].listeners.push({callback:o,handler:u}):this._cachedSubscriptions[a]={agent:e,className:t,instance:r,event:n,listeners:[{callback:o,handler:u}]},l}async _offRemoteEvent({callback:e}){if(!this._getCallbackId(e,{readOnly:!0}))return null;let t=null;return Object.keys(this._cachedSubscriptions).forEach(r=>{const n=`__e__${r}`,o=this._cachedSubscriptions[r],i=o.listeners.findIndex(t=>t.callback===e);-1!==i&&(o.listeners.splice(i,1),0===o.listeners.length&&(delete this._cachedSubscriptions[r],this._eventEmitter.removeAllListeners(n)),t=n)}),t}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){Object.keys(this._cachedSubscriptions).filter(o=>{const i=this._cachedSubscriptions[o];return void 0!==e?i.agent===e:i.instance===t&&i.agent===r&&i.className===n}).forEach(e=>{const t=`__e__${e}`;this._log.debug(`Clearing subscriptions for obsolete topic: ${e}`),this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._getInstanceFromCache(e,t);if(!r){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return r}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:o}=r[n];if(o&&o.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:o}=this._agents[r];if(n&&"offline"!==o)for(const o in n){if(t.className&&o!==t.className)continue;const{instances:i}=n[o];if(i&&i.includes(e))return{agent:r,className:o,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=c},8601:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:o,Error:i,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=r(4469);e.exports=N,N.WritableState=x;const{EventEmitter:h}=r(7007),p=r(4474).Stream,{Buffer:m}=r(8287),g=r(1787),{addAbortSignal:y}=r(982),{getHighWaterMark:b,getDefaultHighWaterMark:_}=r(2100),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(2074).codes,{errorOrDestroy:P}=g;function T(){}c(N.prototype,p.prototype),c(N,p);const $=f("kOnFinished");function x(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const o=!(!e||!1!==e.decodeStrings);this.decodeStrings=!o,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,j(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[$]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function N(e){const t=this instanceof r(7323);if(!t&&!s(N,this))return new N(e);this._writableState=new x(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,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,o){const i=e._writableState;if("function"==typeof r)o=r,r=i.defaultEncoding;else{if(r){if("buffer"!==r&&!m.isEncoding(r))throw new R(r)}else r=i.defaultEncoding;"function"!=typeof o&&(o=T)}if(null===t)throw new I;if(!i.objectMode)if("string"==typeof t)!1!==i.decodeStrings&&(t=m.from(t,r),r="buffer");else if(t instanceof m)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return i.ending?s=new O:i.destroyed&&(s=new A("write")),s?(n.nextTick(o,s),P(e,s,!0),s):(i.pendingcb++,function(e,t,r,n,o){const i=t.objectMode?1:r.length;t.length+=i;const 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:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==T&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,i,t,r,o))}function M(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),U(t),P(e,r)}function D(e,t){const r=e._writableState,o=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?n.nextTick(L,e,r,t,i):L(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&W(e,r),o?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},n.nextTick(F,r.afterWriteTickInfo)):B(e,r,1,i))):P(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(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&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[$].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:i}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?T:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===a?r:o(r,a);i.allBuffers=t.allBuffers,M(e,t,!0,t.length,i,"",n),j(t)}else{do{const{chunk:n,encoding:o,callback:s}=r[a];r[a++]=null,M(e,t,!1,i?1:n.length,n,o,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(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,r){q(t)&&(function(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 r=!1;function o(o){if(r)P(e,null!=o?o:S());else if(r=!0,t.pendingcb--,o){const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e](o);P(e,o,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[$].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},a(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(N,d,{__proto__:null,value:function(e){return!!s(this,e)||this===N&&e&&e._writableState instanceof x}}),N.prototype.pipe=function(){P(this,new E)},N.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},N.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!m.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},N.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},N.prototype._writev=null,N.prototype.end=function(e,t,r){const o=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof i&&(s=r)}return o.corked&&(o.corked=1,this.uncork()),s||(o.errored||o.ending?o.finished?s=new k("end"):o.destroyed&&(s=new A("end")):(o.ending=!0,V(this,o,!0),o.ended=!0)),"function"==typeof r&&(s||o.finished?n.nextTick(r,s):o[$].push(r)),this},l(N.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(){const 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(){const 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)}}});const H=g.destroy;let G;function K(){return void 0===G&&(G={}),G}N.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[$].length)&&n.nextTick(U,r),H.call(this,e,t),this},N.prototype._undestroy=g.undestroy,N.prototype._destroy=function(e,t){t(e)},N.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},N.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},N.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8636:(e,t,r)=>{"use strict";var n=r(920),o=r(7720),i=r(4765),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},m=function e(t,r,i,s,a,c,f,d,m,g,y,b,_,w,v,S,E,A){for(var k,I=t,O=A,R=0,P=!1;void 0!==(O=O.get(p))&&!P;){var T=O.get(t);if(R+=1,void 0!==T){if(T===R)throw new RangeError("Cyclic object value");P=!0}void 0===O.get(p)&&(R=0)}if("function"==typeof g?I=g(r,I):I instanceof Date?I=_(I):"comma"===i&&l(I)&&(I=o.maybeMap(I,function(e){return e instanceof Date?_(e):e})),null===I){if(c)return m&&!S?m(r,h.encoder,E,"key",w):r;I=""}if("string"==typeof(k=I)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||o.isBuffer(I))return m?[v(S?r:m(r,h.encoder,E,"key",w))+"="+v(m(I,h.encoder,E,"value",w))]:[v(r)+"="+v(String(I))];var $,x=[];if(void 0===I)return x;if("comma"===i&&l(I))S&&m&&(I=o.maybeMap(I,m)),$=[{value:I.length>0?I.join(",")||null:void 0}];else if(l(g))$=g;else{var j=Object.keys(I);$=y?j.sort(y):j}var N=d?String(r).replace(/\./g,"%2E"):String(r),C=s&&l(I)&&1===I.length?N+"[]":N;if(a&&l(I)&&0===I.length)return C+"[]";for(var M=0;M<$.length;++M){var L=$[M],D="object"==typeof L&&L&&void 0!==L.value?L.value:I[L];if(!f||null!==D){var F=b&&d?String(L).replace(/\./g,"%2E"):String(L),B=l(I)?"function"==typeof i?i(C,F):C:C+(b?"."+F:"["+F+"]");A.set(t,R);var U=n();U.set(p,A),u(x,e(D,B,i,s,a,c,f,d,"comma"===i&&S&&l(I)?null:m,g,y,b,_,w,v,S,E,U))}}return x};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"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 r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,o=i.formatters[r],c=h.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:c,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(r=c.filter);var f=[];if("object"!=typeof o||null===o)return"";var d=a[c.arrayFormat],p="comma"===d&&c.commaRoundTrip;r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var g=n(),y=0;y<r.length;++y){var b=r[y],_=o[b];c.skipNulls&&null===_||u(f,m(_,b,d,p,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=f.join(c.delimiter),v=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:l,it:c}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=c.opts.loopEnum;let f;const d=()=>null!=f?f:f=(0,o.useFunc)(t,i.default);let h;if(u||s)h=t.let("valid"),e.block$data(h,function(){t.assign(h,!1),t.forOf("v",l,e=>t.if(n._`${d()}(${r}, ${e})`,()=>t.assign(h,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);h=(0,n.or)(...a.map((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${d()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o)))}e.pass(h)}};t.default=s},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:f,opts:d}=u;if(u.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(u,r))return;const h=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${l}[${e}]`)}function g(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(f||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(u,r)){const r=t.name("valid");"failing"===d.removeAdditional?(y(n,r,!1),t.if((0,o.not)(r),()=>{e.reset(),m(n)})):(y(n,r),f||t.if((0,o.not)(r),()=>t.break()))}}}function y(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",l,r=>{h.length||p.length?t.if(function(r){let i;if(h.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=h.length?(0,o.or)(...h.map(e=>o._`${r} === ${e}`)):o.nil;return p.length&&(i=(0,o.or)(i,...p.map(t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,o.not)(i)}(r),()=>g(r)):g(r)}),e.ok(o._`${c} === ${i.default.errors}`)}};t.default=a},8665:(e,t,r)=>{const n=r(3282),o=r(7007),{nanoid:i}=r(3561);"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol.for("nodejs.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol.for("nodejs.asyncDispose"));const s="__global__",a="vrpc";class l{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let o=l._extractStaticFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),o.push("__createIsolated__"),o.push("__createShared__"),o.push("__callAll__"),o.push("__delete__");let i=l._extractMemberFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),l._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:o,memberFunctions:i,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[a]||(window[a]={}),window[a][t]=e;const r=l._functionRegistry.get(s),n=r?[...r.staticFunctions,t]:[t];l._functionRegistry.set(s,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let o=l._extractMemberFunctions(e);n&&(o=o.filter(e=>!e.startsWith("_"))),l._functionRegistry.has(t)||l._functionRegistry.set(t,{memberFunctions:o,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),l._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=i(8),args:r=[],isIsolated:n=!1}={}){const o={c:e,a:[t,...r]},s=n?l._handleCreateIsolated(o):l._handleCreateShared(o);if(o.e)throw new Error(o.e);return s}static delete(e){if("string"==typeof e)return l._delete(e);if("object"==typeof e){for(const[t,r]of l._instances)if(r.instance===e)return l._delete(t);return!1}}static getInstance(e){const t=l._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return l._getClassesArray()}static getAvailableInstances(e){return l._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return l._call(t),JSON.stringify(t)}static onCallback(e){l._callback=e}static on(e,t){l._emitter.on(e,t)}static once(e,t){l._emitter.once(e,t)}static off(e,t){l._emitter.off(e,t)}static removeAllListeners(e){l._emitter.removeAllListeners(e)}static _call(e){switch(l._mustTrackClient=!1,e.f){case"__createIsolated__":l._handleCreateIsolated(e);break;case"__createShared__":l._handleCreateShared(e);break;case"__callAll__":l._handleCallAll(e);break;case"__delete__":l._handleDelete(e);break;default:l._handleCall(e)}return l._mustTrackClient}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==l.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i){if(!i.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return l._assertOwner(i,e,n),e.r=n,i.instance}t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),l._emitter.emit("create",{args:o,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=t.message}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i&&i.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,l._emitter.emit("create",{args:o,className:r,isIsolated:!1,instance:n})}catch(t){e.e=t.message}return t}static _handleCallAll(e){try{const t=[];for(const[r,{className:n,instance:o,isIsolated:i}]of l._instances){if(n!==e.c||i)continue;let s=!0,a=null;try{const t=l._unwrapArguments(e,r);t&&(s=o[t[0]].apply(o,t.slice(1)),s=l.sanitizeEventListenerReturnValues(s))}catch(e){a=e.message}l._isPromise(s)?t.push(s.then(e=>({id:r,val:e,err:null})).catch(e=>({id:r,err:e,val:null}))):t.push({id:r,val:s,err:a})}this._handlePromise(e,Promise.allSettled(t).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=t.message}}static sanitizeEventListenerReturnValues(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}static _handleDelete(e){try{const t=e.a[0];l._assertOwner(l._instances.get(t),e,t),l._emitter.emit("beforeDelete",{instance:t,className:e.c});const{ended:r,disposed:n}=l._end(t);l._emitter.emit("delete",{instance:t,className:e.c}),n&&e.s!==l.LOCAL_SENDER?l._handlePromise(e,n.then(()=>r)):e.r=r}catch(t){e.e=t.message}}static _handleCall(e){try{l._assertOwner(l._instances.get(e.c),e,e.c)}catch(t){const{message:r,cause:n}=t;return void(e.e={message:r,cause:n})}if("removeAllListeners"===e.f)return l._removeAllListeners(e.a[0],e.s,e.c),void(e.r=!0);if(!l._functionRegistry.has(e.c)&&!l._instances.has(e.c))throw new Error(`Could not find context: ${e.c}`);const t=l._unwrapArguments(e);if(!t)return void(e.r=!0);if(e.c===s){try{const r=window[a][e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}return}const r=l._functionRegistry.get(e.c);if(void 0!==r){const{Klass:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find static function: ${e.f}`);try{const r=n[e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}else{const r=l._instances.get(e.c);if(void 0===r)throw new Error(`Could not find context: ${e.c}`);const{instance:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find member function: ${e.f}`);try{let r=n[e.f].apply(n,t);r=l.sanitizeEventListenerReturnValues(r),l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}}static _create(e,t,...r){const n=l._instances.get(t);if(n)return n.instance;const{Klass:o,withNew:i,schema:s}=l._getClassEntry(e);return null!==s&&l._validate(s,...r),i?new o(...r):o(...r)}static _delete(e){return l._end(e).ended}static _end(e){const t=l._instances.get(e);return t?(l._instances.delete(e),l._detachListeners(e,t.instance),{ended:!0,disposed:l._dispose(e,t)}):{ended:!1,disposed:null}}static _detachListeners(e,t){const r=l._listeners[e];if(delete l._listeners[e],r&&l._isFunction(t.removeListener))for(const{event:e,listener:n,clients:o}of Object.values(r))try{l._removeTimes(t,e,n,o.length)}catch(e){}}static _removeTimes(e,t,r,n){for(let o=0;o<Math.max(1,n);o++)e.removeListener(t,r)}static _dispose(e,{instance:t,className:r}){const n=t=>l._emitter.emit("disposeFailed",{instance:e,className:r,error:t});let o,i;try{l._isFunction(t[Symbol.asyncDispose])?o=t[Symbol.asyncDispose]():l._isFunction(t[Symbol.dispose])&&(o=t[Symbol.dispose]())}catch(e){return n(e),null}if(!l._isPromise(o))return null;const s=new Promise(e=>{i=setTimeout(()=>{n(new Error(`dispose did not settle within ${l.DISPOSE_TIMEOUT} ms`)),e()},l.DISPOSE_TIMEOUT)}),a=o.then(()=>{},e=>n(e));return Promise.race([a,s]).then(()=>clearTimeout(i))}static _unregisterClient(e){Object.entries(l._listeners).forEach(([t,r])=>{Object.entries(r).forEach(([r,n])=>{const{listener:o,event:i}=n,s=n.clients.filter(t=>t!==e),a=n.clients.length-s.length;if(0!==a&&(n.clients=s,0===s.length)){const e=l._instances.get(t),n=e&&e.instance;n&&n.removeListener&&l._removeTimes(n,i,o,a),delete l._listeners[t][r]}})})}static _validate(e,t){if(l._ajv||(l._ajv=new n({useDefaults:!0})),!l._ajv.validate(e,t))throw new Error(l._ajv.errorsText())}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,o=n?t:e.c,i=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const e of i)if("string"==typeof e)if(e.startsWith("__f__"))a.push(l._generateCallback({clientId:r,isCallAll:n,instanceId:o,eventId:e}));else if(e.startsWith("__e__"))if("on"===s||"addListener"===s){l._mustTrackClient=!0;const t=l._holdsListener(o,e),s=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:i[0]});if(t)return null;a.push(s)}else if("off"===s||"removeListener"===s){const t=l._unregisterListener({clientId:r,instanceId:o,eventId:e});if(!t)return null;a.push(t)}else{l._mustTrackClient=!0;const t=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:null});a.push(t)}else a.push(e);else a.push(e);return a}static _speaksFor(e){const t=l._instances.get(e);if(!t)return()=>!0;const{instance:r}=t;return()=>{const t=l._instances.get(e);return void 0!==t&&t.instance===r}}static _holdsListener(e,t){const r=l._listeners[e];return Boolean(r&&r[t])}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n}){const o=l._speaksFor(r);return(...i)=>{if(!o())return;const s=n?[r,...i]:[...i];l._callback({a:s,s:t,i:e})}}static _registerListener({eventId:e,clientId:t,instanceId:r,event:n,isCallAll:o}){return l._listeners[r]?l._listeners[r][e]?(l._listeners[r][e].clients.push(t),l._listeners[r][e].listener):(l._listeners[r][e]={event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})},l._listeners[r][e].listener):(l._listeners[r]={[e]:{event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})}},l._listeners[r][e].listener)}static _generateListener({eventId:e,instanceId:t,isCallAll:r}){const n=l._speaksFor(t);return(...o)=>{if(!n())return;const i=r?[t,...o]:[...o];l._callback({a:i,i:e})}}static _unregisterListener({eventId:e,clientId:t,instanceId:r}){if(l._listeners[r]&&l._listeners[r][e]){const{listener:n,clients:o}=l._listeners[r][e],i=o.indexOf(t);if(-1!==i&&o.splice(i,1),0===o.length)return delete l._listeners[r][e],0===Object.keys(l._listeners[r]).length&&delete l._listeners[r],n}}static _removeAllListeners(e,t,r){const n=l._listeners[r];n&&Object.entries(n).forEach(([n,o])=>{o.event===e&&o.clients.includes(t)&&(o.clients=o.clients.filter(e=>e!==t),0===o.clients.length&&(l.getInstance(r).removeListener(o.event,o.listener),delete l._listeners[r][n]))})}static _handlePromise(e,t){try{const r=l._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${r}`;e.r=n,t.then(t=>l._callback({...e,r:t,i:n})).catch(t=>l._callback({...e,e:t.message,i:n}))}catch(t){e.data.e=t.message}}static _getClassEntry(e){const t=l._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!l._blackList.has(e)&&l._isFunction(t.prototype[e]));r=[...r,...e]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!l._blackList.has(e)&&l._isFunction(t[e]));r=[...r,...e]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})],t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(l._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return l._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=l._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}l._functionRegistry=new Map,l._instances=new Map,l._emitter=new o,l._correlationId=0,l._listeners={},l.DISPOSE_TIMEOUT=1e4,l._blackList=new Set(["caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),l.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=l},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,n._`[${r}]`),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){const{it:l}=e,{gen:u,compositeRule:f,allErrors:d}=l,h=c(e,r,o);(null!=i?i:f||d)?s(u,h):a(l,n._`[${h}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:l,compositeRule:u,allErrors:f}=o;s(l,c(e,r,n)),u||f||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",s,i.default.errors,s=>{e.const(l,n._`${i.default.vErrors}[${s}]`),e.if(n._`${l}.instancePath === undefined`,()=>e.assign(n._`${l}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath))),e.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${l}.schema`,r),e.assign(n._`${l}.data`,o))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[u(s,r),f(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:c,it:u}=e,{opts:f,propertyName:d,topSchemaRef:h,schemaPath:p}=u;o.push([l.keyword,s],[l.params,"function"==typeof t?t(e):t||n._`{}`]),f.messages&&o.push([l.message,"function"==typeof r?r(e):r]),f.verbose&&o.push([l.schema,c],[l.parentSchema,n._`${h}${p}`],[i.default.data,a]),d&&o.push([l.propertyName,d])}(e,t,a),o.object(...a)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[l.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},8745:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:o}=r(2768),{EventEmitter:i}=r(7007);function s(e){i.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}o(s.prototype,i.prototype),o(s,i),s.prototype.pipe=function(e,t){const 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",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},8835:(e,t,r)=>{"use strict";var n=r(9655);function o(){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 i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(5373);function b(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var b=e=l.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=a.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=i.exec(b);if(w){var v=(w=w[0]).toLowerCase();this.protocol=v,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===b.substr(0,2);!S||w&&m[w]||(b=b.substr(2),this.slashes=!0)}if(!m[w]&&(S||w&&!g[w])){for(var E,A,k=-1,I=0;I<f.length;I++)-1!==(O=b.indexOf(f[I]))&&(-1===k||O<k)&&(k=O);for(-1!==(A=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(E=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(E)),k=-1,I=0;I<u.length;I++){var O;-1!==(O=b.indexOf(u[I]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var P=this.hostname.split(/\./),T=(I=0,P.length);I<T;I++){var $=P[I];if($&&!$.match(d)){for(var x="",j=0,N=$.length;j<N;j++)$.charCodeAt(j)>127?x+="x":x+=$[j];if(!x.match(d)){var C=P.slice(0,I),M=P.slice(I+1),L=$.match(h);L&&(C.push(L[1]),M.unshift(L[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+D,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!p[v])for(I=0,T=c.length;I<T;I++){var B=c[I];if(-1!==b.indexOf(B)){var U=encodeURIComponent(B);U===B&&(U=escape(B)),b=b.split(B).join(U)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[v]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var V=this.search||"";this.path=D+V}return this.href=this.format(),this},o.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||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var d=u[f];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",y=r.search||"";r.path=p+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||r.host&&e.pathname,v=w,S=r.pathname&&r.pathname.split("/")||[],E=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===S[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=h;else if(h.length)S||(S=[]),S.pop(),S=S.concat(h),r.search=e.search,r.query=e.query;else if(null!=e.search)return E&&(r.host=S.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,I=0,O=S.length;O>=0;O--)"."===(A=S[O])?S.splice(O,1):".."===A?(S.splice(O,1),I++):I&&(S.splice(O,1),I--);if(!w&&!v)for(;I--;I)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var R,P=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(r.hostname=P?"":S.length?S.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),(w=w||r.host&&S.length)&&!P&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=b(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},8859:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,w=String.prototype.toUpperCase,v=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,k=Array.prototype.slice,I=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,$="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,j=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-I(-e):I(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return _.call(o,r,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var C=r(2634),M=C.custom,L=z(M)?M:null,D={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,o=D[n];return o+e+o}function U(e){return _.call(String(e),/"/g,""")}function W(e){return!$||!("object"==typeof e&&($ in e||void 0!==e[$]))}function q(e){return"[object Array]"===K(e)&&W(e)}function V(e){return"[object RegExp]"===K(e)&&W(e)}function z(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,a){var l=n||{};if(G(l,"quoteStyle")&&!G(D,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!G(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?N(t,S):S}if("bigint"==typeof t){var I=String(t)+"n";return w?N(t,I):I}var R=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=R&&R>0&&"object"==typeof t)return q(t)?"[Array]":"[Object]";var M,F=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(l,o);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(a=k.call(a)).push(r),n){var i={depth:l.depth};return G(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,a)}return e(t,l,o+1,a)}if("function"==typeof t&&!V(t)){var Y=function(e){if(e.name)return e.name;var t=y.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ne=re(t,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ne.length>0?" { "+A.call(ne,", ")+" }":"")}if(z(t)){var oe=T?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(t);return"object"!=typeof t||T?oe:X(oe)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ie="<"+v.call(String(t.nodeName)),se=t.attributes||[],ae=0;ae<se.length;ae++)ie+=" "+se[ae].name+"="+B(U(se[ae].value),"double",l);return ie+=">",t.childNodes&&t.childNodes.length&&(ie+="..."),ie+"</"+v.call(String(t.nodeName))+">"}if(q(t)){if(0===t.length)return"[]";var le=re(t,H);return F&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,F)+"]":"[ "+A.call(le,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&W(e)}(t)){var ce=re(t,H);return"cause"in Error.prototype||!("cause"in t)||x.call(t,"cause")?0===ce.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(ce,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+H(t.cause),ce),", ")+" }"}if("object"==typeof t&&m){if(L&&"function"==typeof t[L]&&C)return C(t,{depth:R-o});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return s&&s.call(t,function(e,r){ue.push(H(r,t,!0)+" => "+H(e,t))}),ee("Map",i.call(t),ue,F)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var fe=[];return u&&u.call(t,function(e){fe.push(H(e,t))}),ee("Set",c.call(t),fe,F)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===K(e)&&W(e)}(t))return X(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return X(H(O.call(t)));if(function(e){return"[object Boolean]"===K(e)&&W(e)}(t))return X(p.call(t));if(function(e){return"[object String]"===K(e)&&W(e)}(t))return X(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&W(e)}(t)&&!V(t)){var de=re(t,H),he=j?j(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",me=!he&&$&&Object(t)===t&&$ in t?b.call(K(t),8,-1):pe?"Object":"",ge=(he||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(me||pe?"["+A.call(E.call([],me||[],pe||[]),": ")+"] ":"");return 0===de.length?ge+"{}":F?ge+"{"+te(de,F)+"}":ge+"{ "+A.call(de,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return H.call(e,t)}function K(e){return m.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 J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(b.call(e,0,t.maxStringLength),t)+n}var o=F[t.quoteStyle||"single"];return o.lastIndex=0,B(_.call(_.call(e,o,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(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":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):A.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=q(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=G(e,o)?t(e[o],e):""}var i,s="function"==typeof R?R(e):[];if(T){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)G(e,l)&&(r&&String(Number(l))===l&&l<e.length||T&&i["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof R)for(var c=0;c<s.length;c++)x.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,s=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=s(e),a=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(n&&e.length>0)for(var g=0;g<e.length;++g)d.push(String(g));else for(var y in e)p&&"prototype"===y||!o.call(e,y)||d.push(String(y));if(l)for(var b=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),_=0;_<u.length;++_)b&&"constructor"===u[_]||!o.call(e,u[_])||d.push(u[_]);return d}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=$(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=$(this.rhs,e,t),this}get names(){return T(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(x(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>P(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class b extends g{}b.kind="else";class _ extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(j(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=$(this.condition,e,t),this}get names(){const e=super.names;return T(e,this.condition),this.else&&P(e,this.else.names),e}}_.kind="if";class w extends g{}w.kind="for";class v extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=$(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class S extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=T(super.names,this.from);return T(e,this.to)}}class E extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=$(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class A extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}A.kind="func";class k extends m{render(e){return"return "+super.render(e)}}k.kind="return";class I extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class O extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}O.kind="catch";class R extends g{render(e){return"finally"+super.render(e)}}function P(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function T(e,t){return t instanceof n._CodeOrName?P(e,t.names):e}function $(e,t,r){return e instanceof n.Name?i(e):(o=e)instanceof n._Code&&o._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${L(e)}`}R.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new l(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new S(i,s,t,r),()=>n(s))}forOf(e,t,r,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(s,n._`${e}[${t}]`),r(s)})}return this._for(new E("of",i,s,t),()=>r(s))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new E("in",i,s,t),()=>r(s))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new I;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new O(e),t(e)}return r&&(this._currNode=n.finally=new R,this.code(r)),this._endBlockNode(O,R)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new A(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=j;const N=M(t.operators.AND);t.and=function(...e){return e.reduce(N)};const C=M(t.operators.OR);function M(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${L(t)} ${e} ${L(r)}`}function L(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(C)}},9032:(e,t,r)=>{"use strict";var n=r(7244),o=r(8184),i=r(5767),s=r(5680);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),f=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),h=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var m=a(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function b(e){return"[object Set]"===u(e)}function _(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===u(e)}function A(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),t.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==k&&(void 0===I.working&&(I.working=I(new k)),I.working?I(e):e instanceof k)}function R(e){return g(e,f)}function P(e){return g(e,d)}function T(e){return g(e,h)}function $(e){return l&&g(e,p)}function x(e){return c&&g(e,m)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=R,t.isStringObject=P,t.isBooleanObject=T,t.isBigIntObject=$,t.isSymbolObject=x,t.isBoxedPrimitive=function(e){return R(e)||P(e)||T(e)||$(e)||x(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9037:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:o,ObjectKeys:i,ReflectApply:s}=r(4469),{promisify:{custom:a}}=r(7797),{streamReturningOperators:l,promiseReturningOperators:c}=r(7712),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(2074),f=r(6357),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=r(2100),{pipeline:p}=r(4867),{destroyer:m}=r(1787),g=r(577),y=r(3942),b=r(5980),_=e.exports=r(4474).Stream;_.isDestroyed=b.isDestroyed,_.isDisturbed=b.isDisturbed,_.isErrored=b.isErrored,_.isReadable=b.isReadable,_.isWritable=b.isWritable,_.Readable=r(2729);for(const v of i(l)){const S=l[v];function E(...e){if(new.target)throw u();return _.Readable.from(s(S,this,e))}o(E,"name",{__proto__:null,value:S.name}),o(E,"length",{__proto__:null,value:S.length}),o(_.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of i(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}o(I,"name",{__proto__:null,value:k.name}),o(I,"length",{__proto__:null,value:k.length}),o(_.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}_.Writable=r(8601),_.Duplex=r(7323),_.Transform=r(6269),_.PassThrough=r(519),_.pipeline=p;const{addAbortSignal:w}=r(982);_.addAbortSignal=w,_.finished=g,_.destroy=m,_.compose=f,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=h,o(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(g,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),_.Stream=_,_._isUint8Array=function(e){return e instanceof Uint8Array},_._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},9075:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:i,Uint8Array:s}=r(2768),{Buffer:a}=r(8287),{inspect:l}=r(9862);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const 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 a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const 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}*[o](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,o=0;do{const i=r.data;if(!(e>i.length)){e===i.length?(t+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(i,0,e),this.head=r,r.data=n(i,e));break}t+=i,e-=i.length,++o}while(null!==(r=r.next));return this.length-=o,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,o=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(i(t,a,r-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}i(t,a,r-e),e-=a.length,++o}while(null!==(n=n.next));return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},9083:(e,t,r)=>{"use strict";e.exports=u;var n=r(2463).F,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(8101);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new o("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9096:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const o="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i=new Set,s="object"==typeof n&&n?n:{},a=(e,t,r,n)=>{"function"==typeof s.emitWarning?s.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let l=globalThis.AbortController,c=globalThis.AbortSignal;if(void 0===l){c=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new c;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==s.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,a("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))}}Symbol("type");const u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),f=e=>u(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?d:null:null;class d extends Array{constructor(e){super(e),this.fill(0)}}class h{heap;length;static#e=!1;static create(e){const t=f(e);if(!t)return[];h.#e=!0;const r=new h(e,t);return h.#e=!1,r}constructor(e,t){if(!h.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class p{#t;#r;#n;#o;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#f;#d;#h;#p;#m;#g;#y;#b;#_;#w;#v;#S;#E;static unsafeExposeInternals(e){return{starts:e.#_,ttls:e.#w,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#f,next:e.#d,prev:e.#h,get head(){return e.#p},get tail(){return e.#m},free:e.#g,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,r,n,o)=>e.#k(t,r,n,o),moveToTail:t=>e.#I(t),indexes:t=>e.#O(t),rindexes:t=>e.#R(t),isStale:t=>e.#P(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#i}get memoMethod(){return this.#s}get dispose(){return this.#n}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:c,dispose:d,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:_=0,sizeCalculation:w,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:O}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const R=t?f(t):Array;if(!R)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=b,this.maxEntrySize=_||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!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.#s=S,void 0!==v&&"function"!=typeof v)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=v,this.#S=!!v,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#d=new R(t),this.#h=new R(t),this.#p=0,this.#m=0,this.#g=h.create(t),this.#a=0,this.#l=0,"function"==typeof d&&(this.#n=d),"function"==typeof m?(this.#o=m,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#v=!!this.#n,this.#E=!!this.#o,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#r&&!u(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=u(n)||0===n?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!i.has(e))(e)&&(i.add(e),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,p))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#$(){const e=new d(this.#t),t=new d(this.#t);this.#w=e,this.#_=t,this.#x=(r,n,i=o.now())=>{if(t[r]=0!==n?i:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout(()=>{this.#P(r)&&this.#j(this.#u[r],"expire")},n+1);e.unref&&e.unref()}},this.#N=r=>{t[r]=0!==e[r]?o.now():0},this.#C=(o,i)=>{if(e[i]){const s=e[i],a=t[i];if(!s||!a)return;o.ttl=s,o.start=a,o.now=r||n();const l=o.now-a;o.remainingTTL=s-l}};let r=0;const n=()=>{const e=o.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=o=>{const i=this.#c.get(o);if(void 0===i)return 0;const s=e[i],a=t[i];return s&&a?s-((r||n())-a):1/0},this.#P=o=>{const i=t[o],s=e[o];return!!s&&!!i&&(r||n())-i>s}}#N=()=>{};#C=()=>{};#x=()=>{};#P=()=>!1;#T(){const e=new d(this.#t);this.#l=0,this.#b=e,this.#M=t=>{this.#l-=e[t],e[t]=0},this.#L=(e,t,r,n)=>{if(this.#A(t))return 0;if(!u(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),!u(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#D=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#l>r;)this.#F(!0)}this.#l+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#M=e=>{};#D=(e,t,r)=>{};#L=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#B(t)&&(!e&&this.#P(t)||(yield t),t!==this.#p);)t=this.#h[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;this.#B(t)&&(!e&&this.#P(t)||(yield t),t!==this.#m);)t=this.#d[t]}#B(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#O())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*rentries(){for(const e of this.#R())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*keys(){for(const e of this.#O()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#R()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*values(){for(const e of this.#O())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}*rvalues(){for(const e of this.#R())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#O()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==o&&e(o,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(const r of this.#O()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}rforEach(e,t=this){for(const r of this.#R()){const n=this.#f[r],o=this.#A(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}purgeStale(){let e=!1;for(const t of this.#R({allowStale:!0}))this.#P(t)&&(this.#j(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const r=this.#f[t],n=this.#A(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#w&&this.#_){const e=this.#w[t],r=this.#_[t];if(e&&r){const t=e-(o.now()-r);i.ttl=t,i.start=Date.now()}}return this.#b&&(i.size=this.#b[t]),i}dump(){const e=[];for(const t of this.#O({allowStale:!0})){const r=this.#u[t],n=this.#f[t],i=this.#A(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const s={value:i};if(this.#w&&this.#_){s.ttl=this.#w[t];const e=o.now()-this.#_[t];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=o.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#L(e,t,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#j(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#m:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#F(!1):this.#a,this.#u[u]=e,this.#f[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#h[u]=this.#m,this.#m=u,this.#a++,this.#D(u,c,a),a&&(a.set="add"),l=!1;else{this.#I(u);const r=this.#f[u];if(t!==r){if(this.#S&&this.#A(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#v&&this.#n?.(t,e,"set"),this.#E&&this.#y?.push([t,e,"set"]))}else i||(this.#v&&this.#n?.(r,e,"set"),this.#E&&this.#y?.push([r,e,"set"]));if(this.#M(u),this.#D(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#A(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#w||this.#$(),this.#w&&(l||this.#x(u,n,o),a&&this.#C(a,u)),!i&&this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#f[this.#p];if(this.#F(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#F(e){const t=this.#p,r=this.#u[t],n=this.#f[t];return this.#S&&this.#A(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(n,r,"evict"),this.#E&&this.#y?.push([n,r,"evict"])),this.#M(t),e&&(this.#u[t]=void 0,this.#f[t]=void 0,this.#g.push(t)),1===this.#a?(this.#p=this.#m=0,this.#g.length=0):this.#p=this.#d[t],this.#c.delete(r),this.#a--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#c.get(e);if(void 0!==o){const e=this.#f[o];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#P(o))return r&&this.#N(o),n&&(n.has="hit",this.#C(n,o)),!0;n&&(n.has="stale",this.#C(n,o))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#c.get(e);if(void 0===n||!r&&this.#P(n))return;const o=this.#f[n];return this.#A(o)?o.__staleWhileFetching:o}#k(e,t,r,n){const o=void 0===t?void 0:this.#f[t];if(this.#A(o))return o;const i=new l,{signal:s}=r;s?.addEventListener("abort",()=>i.abort(s.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:n},c=(n,o=!1)=>{const{aborted:s}=i.signal,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!o?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!o)return u(i.signal.reason);const c=f;return this.#f[t]===f&&(void 0===n?c.__staleWhileFetching?this.#f[t]=c.__staleWhileFetching:this.#j(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,a.options))),n},u=n=>{const{aborted:o}=i.signal,s=o&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=f;if(this.#f[t]===f&&(l&&void 0!==c.__staleWhileFetching?s||(this.#f[t]=c.__staleWhileFetching):this.#j(e,"fetch")),a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};r.status&&(r.status.fetchDispatched=!0);const f=new Promise((t,n)=>{const s=this.#i?.(e,o,a);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),n),i.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})}).then(c,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),d=Object.assign(f,{__abortController:i,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#f[t]=d,d}#A(e){if(!this.#S)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:p,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#S)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:h,ignoreFetchAbort:d,status:g,signal:y};let _=this.#c.get(e);if(void 0===_){g&&(g.fetch="miss");const t=this.#k(e,_,b,p);return t.__returned=t}{const t=this.#f[_];if(this.#A(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#P(_);if(!m&&!o)return g&&(g.fetch="hit"),this.#I(_),n&&this.#N(_),g&&this.#C(g,_),t;const i=this.#k(e,_,b,p),s=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=o?"stale":"refresh",s&&o&&(g.returnedStale=!0)),s?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#s;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&void 0!==s)return s;const a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#f[s],a=this.#A(t);return i&&this.#C(i,s),this.#P(s)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(o||this.#j(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#N(s),t))}i&&(i.get="miss")}#U(e,t){this.#h[t]=e,this.#d[e]=t}#I(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#h[e],this.#d[e]),this.#U(this.#m,e),this.#m=e)}delete(e){return this.#j(e,"delete")}#j(e,t){let r=!1;if(0!==this.#a){const n=this.#c.get(e);if(void 0!==n)if(r=!0,1===this.#a)this.#W(t);else{this.#M(n);const r=this.#f[n];if(this.#A(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(r,e,t),this.#E&&this.#y?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#f[n]=void 0,n===this.#m)this.#m=this.#h[n];else if(n===this.#p)this.#p=this.#d[n];else{const e=this.#h[n];this.#d[e]=this.#d[n];const t=this.#d[n];this.#h[t]=this.#h[n]}this.#a--,this.#g.push(n)}}if(this.#E&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return r}clear(){return this.#W("delete")}#W(e){for(const t of this.#R({allowStale:!0})){const r=this.#f[t];if(this.#A(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#v&&this.#n?.(r,n,e),this.#E&&this.#y?.push([r,n,e])}}if(this.#c.clear(),this.#f.fill(void 0),this.#u.fill(void 0),this.#w&&this.#_&&(this.#w.fill(0),this.#_.fill(0)),this.#b&&this.#b.fill(0),this.#p=0,this.#m=0,this.#g.length=0,this.#l=0,this.#a=0,this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}t.LRUCache=p},9122:()=>{},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var s in o)i+=s;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9157:(e,t,r)=>{"use strict";const{format:n,inspect:o}=r(1077),{AggregateError:i}=r(2768),s=globalThis.AggregateError||i,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const 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 h(e,t,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return f(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[a]=!0,u[e]=o}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class m 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"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?i.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const e=i.pop();n+=`one of type ${i.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${o(r,{depth:-1})}`}else{let e=o(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),h("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=o(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),h("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),h("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const 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:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),h("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=d(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=d(n)),n+="n"}else n=o(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:m,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},9209:(e,t,r)=>{"use strict";var n=r(6578),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9214:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:o,NumberIsInteger:i,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:m}=r(2768);e.exports=G,G.ReadableState=H;const{EventEmitter:g}=r(7007),{Stream:y,prependListener:b}=r(8745),{Buffer:_}=r(8287),{addAbortSignal:w}=r(5121),v=r(6364);let S=r(9862).debuglog("stream",e=>{S=e});const E=r(9075),A=r(7302),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(3513),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:T,ERR_STREAM_PUSH_AFTER_EOF:$,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:j}=r(9157),{validateObject:N}=r(4947),C=m("kPaused"),{StringDecoder:M}=r(7419),L=r(2070);u(G.prototype,y.prototype),u(G,y);const D=()=>{},{errorOrDestroy:F}=A,B=1,U=16,W=32,q=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 H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),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 M(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(2648);this._readableState=new H(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&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const o=e._readableState;let i;if(0===(o.state&B)&&("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=_.from(t,r).toString(o.encoding):(t=_.from(t,r),r=""))):t instanceof _?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new R("chunk",["string","Buffer","Uint8Array"],t))),i)F(e,i);else if(null===t)o.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,o);else if(0!==(o.state&B)||t&&t.length>0)if(n)if(4&o.state)F(e,new x);else{if(o.destroyed||o.errored)return!1;Q(e,o,t,!0)}else if(o.ended)F(e,new $);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?Q(e,o,t,!1):Z(e,o)):Q(e,o,t,!1)}else n||(o.state&=-9,Z(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function Q(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&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("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,oe(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oe(e),t.flowing&&!t.reading&&e.read(0)}function oe(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function ie(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=D;function o(t){this===e?(n(),n=D):n=t}e.on("readable",o);const i=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=D});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(o)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",o),i()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(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 ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("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)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),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=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:i(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new T("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 S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,o=!!(64&t.state);if(S("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,S("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,S("reading, ended or constructing",o);else if(o){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(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&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new P("_read()")},G.prototype.pipe=function(e,t){const r=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),S("pipe count=%d opts=%j",o.pipes.length,t);const i=t&&!1===t.end||e===n.stdout||e===n.stderr?m:s;function s(){S("onend"),e.end()}let a;o.endEmitted?n.nextTick(i):r.once("end",i),e.on("unpipe",function t(n,i){S("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,S("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",u),l=!0,a&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(S("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(S("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),m(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),m()}function p(){S("onfinish"),e.removeListener("close",h),m()}function m(){S("unpipe"),r.unpipe(e)}return r.on("data",u),b(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():o.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=o(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){const r=y.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,S("on readable",o.length,o.reading),o.length?Y(this):o.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!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())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return ie(this)},G.prototype.iterator=function(e){return void 0!==e&&N(e,"options"),ie(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const 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}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[C]},set(e){this[C]=!!e}}}),G._fromList=se,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){A.destroyer(e,t),r(t)}}).wrap(e)}},9288:()=>{},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,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=r(0,o.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(s,arguments));return Object(t)===t?t:this}return o.apply(e,n(s,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9372:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const l=s(r(1676));t.default=l,a(r(1676),t)},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9584:(e,t,r)=>{"use strict";const n=r(5244),o=r(3425),i=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=i,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),e.exports.Stream=n.Stream,e.exports.default=e.exports},9597:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(u,r);var s,a,l,c=(a=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=i(a);if(l){var r=i(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function u(r,n,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),i=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o)),i.code=e,i}return s=u,Object.defineProperty(s,"prototype",{writable:!1}),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,o){var i,a,l,c,f;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))l="The ".concat(e," ").concat(i," ").concat(u(t,"type"));else{var d=("number"!=typeof f&&(f=0),f+1>(c=e).length||-1===c.indexOf(".",f)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(i," ").concat(u(t,"type"))}return l+". Received type ".concat(n(o))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(537));var o=a.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=l},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,s=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(f=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},9612:e=>{"use strict";e.exports=Object},9655:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,s=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function p(e){throw new RangeError(f[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(u,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function b(e){return m(e,function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)}).join("")}function _(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=a)e=d(e/35);return d(n+36*e/(e+38))}function S(e){var t,r,n,o,i,l,c,u,f,h,m=[],g=e.length,y=0,w=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&p("not-basic"),m.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(i=y,l=1,c=a;o>=g&&p("invalid-input"),((u=_(e.charCodeAt(o++)))>=a||u>d((s-y)/l))&&p("overflow"),y+=u*l,!(u<(f=c<=S?1:c>=S+26?26:c-S));c+=a)l>d(s/(h=a-f))&&p("overflow"),l*=h;S=v(y-i,t=m.length+1,0==i),d(y/t)>s-w&&p("overflow"),w+=d(y/t),y%=t,m.splice(y++,0,w)}return b(m)}function E(e){var t,r,n,o,i,l,c,u,f,m,g,b,_,S,E,A=[];for(b=(e=y(e)).length,t=128,r=0,i=72,l=0;l<b;++l)(g=e[l])<128&&A.push(h(g));for(n=o=A.length,o&&A.push("-");n<b;){for(c=s,l=0;l<b;++l)(g=e[l])>=t&&g<c&&(c=g);for(c-t>d((s-r)/(_=n+1))&&p("overflow"),r+=(c-t)*_,t=c,l=0;l<b;++l)if((g=e[l])<t&&++r>s&&p("overflow"),g==t){for(u=r,f=a;!(u<(m=f<=i?1:f>=i+26?26:f-i));f+=a)E=u-m,S=a-m,A.push(h(w(m+E%S,0))),u=d(E/S);A.push(h(w(u,0))),i=v(r,_,n==o),r=0,++n}++r,++t}return A.join("")}i={version:"1.4.1",ucs2:{decode:y,encode:b},decode:S,encode:E,toASCII:function(e){return g(e,function(e){return c.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return g(e,function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},9675:e=>{"use strict";e.exports=TypeError},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=i},9721:(e,t,r)=>{"use strict";var n=r(6556),o=r(4035),i=n("RegExp.prototype.exec"),s=r(9675);e.exports=function(e){if(!o(e))throw new s("`regex` must be a RegExp");return function(t){return null!==i(e,t)}}},9777:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=a(r(1278)),c=r(9584),u=a(r(3885)),f=a(r(7833)),d=s(r(128)),h=a(r(7969)),p=a(r(6912)),m=r(1021),g=a(r(579)),y=a(r(2639)),b=r(4723),_=r(4152),w=a(r(3175)),v=s(r(6887)),S=globalThis.setImmediate||((...e)=>{const t=e.shift();(0,b.nextTick)(()=>{t(...e)})}),E=65535,A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"};class k extends _.TypedEventEmitter{static VERSION=b.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in A)void 0===this.options[e]?this.options[e]=A[e]:this.options[e]=t[e];this.log=this.options.log||(0,f.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",k.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:k.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(l.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new g.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new h.default,this.incomingStore=t.incomingStore||new h.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=E;const r=t.properties?.receiveMaximum;void 0!==r&&(Number.isInteger(r)&&r>=1&&r<=E?this._receiveMaximum=r:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",r,E,E)),this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(t.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:e}=this,t=()=>{const 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 o=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(o=!1)),o?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._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,t,r){return!!this._incomingQoS2Ids.has(e)||(5===this.options.protocolVersion&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),r?.discardParsedPackets(),r&&!r.isCurrent()||this._cleanUp(!0),t(),this.emit("error",new b.ErrorWithReasonCode(`${m.ReasonCodes[147]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,147)),!1):(this._incomingQoS2Ids.add(e),!0))}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(0!==this._incomingQoS2Ids.size){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(const e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){const e=new c.Writable,t=l.default.parser(this.options);let r=null;const n=[],o={discardParsedPackets:()=>{n.length=0},isCurrent:()=>this._currentPump===o};this._currentPump=o,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});const i=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==o&&(this.log("work :: pump superseded, dropping %d queued packets",n.length),n.length=0);const e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,s,o);else{this.log("work :: no packets in queue");const e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},s=()=>{if(n.length)(0,b.nextTick)(i);else{const e=r;r=null,e&&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`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(void 0!==a.properties?.receiveMaximum&&(a.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(a.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=a.properties?.authenticationMethod,this._writePacket(a),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){const e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:o}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};const{qos:i,retain:s,dup:a,properties:l,cbStorePut:c}=r;if(this._checkDisconnecting(n))return this;const u=()=>{let r=0;if((1===i||2===i)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const u={cmd:"publish",topic:e,payload:t,qos:i,retain:s,messageId:r,dup:a};switch(5===o.protocolVersion&&(u.properties=l),this.log("publish :: qos",i),i){case 1:case 2:this.outgoing[u.messageId]={volatile:!1,cmd:"publish",cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,o)=>{this.publish(e,t,r,(e,t)=>{e?o(e):n(t)})})}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let o=!1,i=[];"string"==typeof e?i=e=[e]:Array.isArray(e)?i=e:"object"==typeof e&&(o=e.resubscribe,delete e.resubscribe,i=Object.keys(e));const s=d.validateTopics(i);if(null!==s)return S(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};const{properties:l}=t,c=[],u=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||o){const 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),c.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),u(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),u(t,e[t])}),!c.length)return r(null,[]),this;const f=(e,t)=>{const r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){const 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}const o=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cmd:"subscribe",cb:(r,o)=>{if(r)return void n(new b.ErrorWithSubackPacket(r.message,o));const{granted:i}=o;if(i.length!==e.length)return n(new b.ErrorWithSubackPacket(`Protocol error: suback granted ${i.length} reason code(s) for ${e.length} subscription(s)`,o)),void this._cleanUp(!0);for(let t=0;t<i.length;t+=1)e[t].qos=i[t];t(o)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),o},h=()=>{const e=this.options.subscribeBatchSize??c.length,t=[];for(let r=0;r<c.length;r+=e){const n=c.slice(r,r+e),o=this._nextId();if(null===o)return this.log("No messageId left"),!1;t.push(f(n,o))}return Promise.all(t).then(e=>{r(null,c,e.at(-1))}).catch(e=>{r(e,c,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,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;const n=d.validateTopics(e);if(null!==n)return S(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const o=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const o={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?o.unsubscriptions=[e]:Array.isArray(e)&&(o.unsubscriptions=e),this.options.resubscribe&&o.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(o.properties=t.properties),this.outgoing[o.messageId]={volatile:!0,cmd:"unsubscribe",cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,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);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const 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)},o=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.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,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");const 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._incomingQoS2Ids.clear(),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(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)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.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,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{const 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),S(()=>{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,o=e;if("publish"===o.cmd&&(o=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(o),n))return t&&t(n);this.outgoingStore.put(o,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);const 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");const r=l.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;const o=this._applyTopicAlias(e);if(o)t(o);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,u.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const o=n.qos||0;0===o&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):o>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"))}get serverProperties(){return this._serverProperties}get keepalive(){const e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");const 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++){const 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.options.clean&&(this.options.protocolVersion<4||!0===e.sessionPresent)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});const i=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?i():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cmd:e.cmd,cb(e,r){t&&t(e,r),i()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",i)};r.on("end",()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),i()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const 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()})}}t.default=k},9844:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function o(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const t=[],r=[],n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(s(Array.from(e),t))),n.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let i=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const l={};t.push(a),r.push(l);for(const s in a){const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=n.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=o(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const l={};t.push(a),r.push(l);for(const s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=n.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=o(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l};function s(e,s){const a=Object.keys(e),l=new Array(a.length);for(let c=0;c<a.length;c++){const u=a[c],f=e[u];if("object"!=typeof f||null===f)l[u]=f;else if(f.constructor!==Object&&(i=n.get(f.constructor)))l[u]=i(f,s);else if(ArrayBuffer.isView(f))l[u]=o(f);else{const e=t.indexOf(f);l[u]=-1!==e?r[e]:s(f)}}return l}}(e);const t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(n(Array.from(e),t))),t.set(Set,(e,t)=>new Set(n(Array.from(e),t))),e.constructorHandlers)for(const r of e.constructorHandlers)t.set(r[0],r[1]);let r=null;return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(r=t.get(i.constructor)))return r(i,e);const s={};for(const n in i){const a=i[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=o(a):s[n]=e(a)}return s}:function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(r=t.get(i.constructor)))return r(i,e);const s={};for(const n in i){if(!1===Object.hasOwnProperty.call(i,n))continue;const a=i[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=o(a):s[n]=e(a)}return s};function n(e,n){const i=Object.keys(e),s=new Array(i.length);for(let a=0;a<i.length;a++){const l=i[a],c=e[l];"object"!=typeof c||null===c?s[l]=c:c.constructor!==Object&&(r=t.get(c.constructor))?s[l]=r(c,n):ArrayBuffer.isView(c)?s[l]=o(c):s[l]=n(c)}return s}}},9848:(e,t,r)=>{"use strict";const{pipeline:n}=r(3616),o=r(2648),{destroyer:i}=r(7302),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:d}=r(6801),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=r(9157),g=r(6364);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return o.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=o.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=o.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||d(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,b,_,w;const v=e[0],S=n(e,function(e){const t=_;_=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||d(S)||u(S));if(w=new o({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;g(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(b){const e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{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,t){e||null===_||(e=new h),b=null,r=null,y=null,null===_?t(e):(_=t,s(S)&&i(S,e))},w}},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},9862:(e,t,r)=>{"use strict";const n=r(8287),{format:o,inspect:i}=r(1077),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(9157),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(2768),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,d=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||n.Blob,p=void 0!==h?function(e){return e instanceof h}:function(e){return!1},m=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,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:o,inspect:i,types:{isAsyncFunction:e=>e instanceof d,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return m(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{m(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},9868:(e,t,r)=>{"use strict";const n=r(7829).Duplex,o=r(6698),i=r(7396);function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const 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),n.call(this)}o(s,n),Object.assign(s.prototype,i.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},s.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)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof i||s.isBufferList(e)},s.isBufferList=i.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=i},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(6743);e.exports=i.call(n,o)},9993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearInterval:()=>b,clearTimeout:()=>_,setInterval:()=>w,setTimeout:()=>v});var n=r(8389);const o=(c=new WeakMap,i=e=>{if(c.has(e))return c.get(e);const t=new Map;return c.set(e,t),t},l=new WeakMap,s=e=>({...e,connect:({call:e})=>async()=>{const{port1:t,port2:r}=new MessageChannel,n=await e("connect",{port:t},[t]);return l.set(r,n),r},disconnect:({call:e})=>async t=>{const r=l.get(t);if(void 0===r)throw new Error("The given port is not connected.");await e("disconnect",{portId:r})},isSupported:({call:e})=>()=>e("isSupported")}),a=n.generateUniqueNumber,e=>{const t=s(e);return e=>{const r=i(e);e.addEventListener("message",({data:e})=>{const{id:t}=e;if(null!==t&&r.has(t)){const{reject:n,resolve:o}=r.get(t);r.delete(t),void 0===e.error?o(e.result):n(new Error(e.error.message))}}),(e=>"function"==typeof e.start)(e)&&e.start();const n=(t,n=null,o=[])=>new Promise((i,s)=>{const l=a(r);r.set(l,{reject:s,resolve:i}),null===n?e.postMessage({id:l,method:t},o):e.postMessage({id:l,method:t,params:n},o)}),o=(t,r,n=[])=>{e.postMessage({id:null,method:t,params:r},n)};let s={};for(const[e,r]of Object.entries(t))s={...s,[e]:r({call:n,notify:o})};return{...s}}});var i,s,a,l,c;const u=new Map([[0,null]]),f=new Map([[0,null]]),d=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(u),h=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(f),p=((e,t)=>r=>(n,o=0,...i)=>{const s=Symbol(),a=e(t);t.set(a,s);const l=()=>r(o,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(n(...i),t.get(a)===s&&l())});return l(),a})(n.generateUniqueNumber,u),m=((e,t)=>r=>(n,o=0,...i)=>{const s=Symbol(),a=e(t);return t.set(a,s),r(o,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(t.delete(a),n(...i))}),a})(n.generateUniqueNumber,f),g=o({clearInterval:({call:e})=>d(t=>e("clear",{timerId:t,timerType:"interval"})),clearTimeout:({call:e})=>h(t=>e("clear",{timerId:t,timerType:"timeout"})),setInterval:({call:e})=>p((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})),setTimeout:({call:e})=>m((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"}))}),y=(()=>{let e=null;return()=>{if(null!==e)return e;const t=new Blob(['(()=>{var e={455(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,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);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,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o(\'The handler of the method called "\'.concat(t,\'" returned an unexpected result.\'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o(\'The requested method called "\'.concat(e,\'" is not supported.\'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o(\'The handler of the method called "\'.concat(t,\'" returned no required result.\'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,()=>{n(),t.close(),u.delete(o)}),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o(\'The specified parameter called "portId" with the given value "\'.concat(e,\'" does not identify a port connected to this worker.\'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},m=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise(t=>{e.set(a,[r(n,u,i,e,t,a),t])})},f=new Map,h=d(globalThis.clearTimeout,f),p=new Map,w=d(globalThis.clearTimeout,p),v=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=m(f,performance,globalThis.setTimeout,v),T=m(p,performance,globalThis.setTimeout,v);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):w(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return e=(e=>{const t=new Worker(e);return g(t)})(r),setTimeout(()=>URL.revokeObjectURL(r)),e}})(),b=e=>y().clearInterval(e),_=e=>y().clearTimeout(e),w=(...e)=>y().setInterval(...e),v=(...e)=>y().setTimeout(...e)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1860)})());
|