var ge=Object.assign;(self.webpackChunkgms_ui=self.webpackChunkgms_ui||[]).push([[616],{13129:function(Q,Y,_){var w=_(34155);Y.formatArgs=L,Y.save=C,Y.load=b,Y.useColors=x,Y.storage=o(),Y.destroy=function(){var l=!1;return function(){l||(l=!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`."))}}(),Y.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function x(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function L(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+Q.exports.humanize(this.diff),!!this.useColors){var E="color: "+this.color;l.splice(1,0,E,"color: inherit");var A=0,y=0;l[0].replace(/%[a-zA-Z%]/g,function(P){P!=="%%"&&(A++,P==="%c"&&(y=A))}),l.splice(y,0,E)}}Y.log=console.debug||console.log||function(){};function C(l){try{l?Y.storage.setItem("debug",l):Y.storage.removeItem("debug")}catch(E){}}function b(){var l;try{l=Y.storage.getItem("debug")}catch(E){}return!l&&typeof w!="undefined"&&"env"in w&&(l={NODE_ENV:"production"}.DEBUG),l}function o(){try{return localStorage}catch(l){}}Q.exports=_(40323)(Y);var s=Q.exports.formatters;s.j=function(l){try{return JSON.stringify(l)}catch(E){return"[UnexpectedJSONParseError]: "+E.message}}},40323:function(Q,Y,_){var w=_(30352);function x(L){b.debug=b,b.default=b,b.coerce=y,b.disable=l,b.enable=s,b.enabled=E,b.humanize=_(57824),b.destroy=P,Object.keys(L).forEach(function(g){b[g]=L[g]}),b.names=[],b.skips=[],b.formatters={};function C(g){for(var v=0,S=0;S0)throw new Error("Invalid string. Length must be a multiple of 4");var S=g.indexOf("=");S===-1&&(S=v);var T=S===v?0:4-S%4;return[S,T]}function s(g){var v=o(g),S=v[0],T=v[1];return(S+T)*3/4-T}function l(g,v,S){return(v+S)*3/4-S}function E(g){var v,S=o(g),T=S[0],U=S[1],N=new x(l(g,T,U)),H=0,V=U>0?T-4:T,k;for(k=0;k>16&255,N[H++]=v>>8&255,N[H++]=v&255;return U===2&&(v=w[g.charCodeAt(k)]<<2|w[g.charCodeAt(k+1)]>>4,N[H++]=v&255),U===1&&(v=w[g.charCodeAt(k)]<<10|w[g.charCodeAt(k+1)]<<4|w[g.charCodeAt(k+2)]>>2,N[H++]=v>>8&255,N[H++]=v&255),N}function A(g){return _[g>>18&63]+_[g>>12&63]+_[g>>6&63]+_[g&63]}function y(g,v,S){for(var T,U=[],N=v;NV?V:H+N));return T===1?(v=g[S-1],U.push(_[v>>2]+_[v<<4&63]+"==")):T===2&&(v=(g[S-2]<<8)+g[S-1],U.push(_[v>>10]+_[v>>4&63]+_[v<<2&63]+"=")),U.join("")}},9668:function(Q,Y,_){"use strict";const{Buffer:w}=_(58478),x=Symbol.for("BufferList");function L(C){if(!(this instanceof L))return new L(C);L._init.call(this,C)}L._init=function(b){Object.defineProperty(this,x,{value:!0}),this._bufs=[],this.length=0,b&&this.append(b)},L.prototype._new=function(b){return new L(b)},L.prototype._offset=function(b){if(b===0)return[0,0];let o=0;for(let s=0;sthis.length||b<0)return;const o=this._offset(b);return this._bufs[o[0]][o[1]]},L.prototype.slice=function(b,o){return typeof b=="number"&&b<0&&(b+=this.length),typeof o=="number"&&o<0&&(o+=this.length),this.copy(null,0,b,o)},L.prototype.copy=function(b,o,s,l){if((typeof s!="number"||s<0)&&(s=0),(typeof l!="number"||l>this.length)&&(l=this.length),s>=this.length||l<=0)return b||w.alloc(0);const E=!!b,A=this._offset(s),y=l-s;let P=y,g=E&&o||0,v=A[1];if(s===0&&l===this.length){if(!E)return this._bufs.length===1?this._bufs[0]:w.concat(this._bufs,this.length);for(let S=0;ST)this._bufs[S].copy(b,g,v),g+=T;else{this._bufs[S].copy(b,g,v,v+P),g+=T;break}P-=T,v&&(v=0)}return b.length>g?b.slice(0,g):b},L.prototype.shallowSlice=function(b,o){if(b=b||0,o=typeof o!="number"?this.length:o,b<0&&(b+=this.length),o<0&&(o+=this.length),b===o)return this._new();const s=this._offset(b),l=this._offset(o),E=this._bufs.slice(s[0],l[0]+1);return l[1]===0?E.pop():E[E.length-1]=E[E.length-1].slice(0,l[1]),s[1]!==0&&(E[0]=E[0].slice(s[1])),this._new(E)},L.prototype.toString=function(b,o,s){return this.slice(o,s).toString(b)},L.prototype.consume=function(b){if(b=Math.trunc(b),Number.isNaN(b)||b<=0)return this;for(;this._bufs.length;)if(b>=this._bufs[0].length)b-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(b),this.length-=b;break}return this},L.prototype.duplicate=function(){const b=this._new();for(let o=0;othis.length?this.length:b;const s=this._offset(b);let l=s[0],E=s[1];for(;l=C.length){const P=A.indexOf(C,E);if(P!==-1)return this._reverseOffset([l,P]);E=A.length-C.length+1}else{const P=this._reverseOffset([l,E]);if(this._match(P,C))return P;E++}E=0}return-1},L.prototype._match=function(C,b){if(this.length-C * @license MIT */var w=_(79742),x=_(80645),L=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Y.Buffer=s,Y.SlowBuffer=N,Y.INSPECT_MAX_BYTES=50;var C=2147483647;Y.kMaxLength=C,s.TYPED_ARRAY_SUPPORT=b(),!s.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function b(){try{var u=new Uint8Array(1),a={foo:function(){return 42}};return Object.setPrototypeOf(a,Uint8Array.prototype),Object.setPrototypeOf(u,a),u.foo()===42}catch(i){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function o(u){if(u>C)throw new RangeError('The value "'+u+'" is invalid for option "size"');var a=new Uint8Array(u);return Object.setPrototypeOf(a,s.prototype),a}function s(u,a,i){if(typeof u=="number"){if(typeof a=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(u)}return l(u,a,i)}s.poolSize=8192;function l(u,a,i){if(typeof u=="string")return P(u,a);if(ArrayBuffer.isView(u))return v(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(M(u,ArrayBuffer)||u&&M(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(M(u,SharedArrayBuffer)||u&&M(u.buffer,SharedArrayBuffer)))return S(u,a,i);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=u.valueOf&&u.valueOf();if(n!=null&&n!==u)return s.from(n,a,i);var e=T(u);if(e)return e;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return s.from(u[Symbol.toPrimitive]("string"),a,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}s.from=function(u,a,i){return l(u,a,i)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function E(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function A(u,a,i){return E(u),u<=0?o(u):a!==void 0?typeof i=="string"?o(u).fill(a,i):o(u).fill(a):o(u)}s.alloc=function(u,a,i){return A(u,a,i)};function y(u){return E(u),o(u<0?0:U(u)|0)}s.allocUnsafe=function(u){return y(u)},s.allocUnsafeSlow=function(u){return y(u)};function P(u,a){if((typeof a!="string"||a==="")&&(a="utf8"),!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var i=H(u,a)|0,n=o(i),e=n.write(u,a);return e!==i&&(n=n.slice(0,e)),n}function g(u){for(var a=u.length<0?0:U(u.length)|0,i=o(a),n=0;n=C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");return u|0}function N(u){return+u!=u&&(u=0),s.alloc(+u)}s.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==s.prototype},s.compare=function(a,i){if(M(a,Uint8Array)&&(a=s.from(a,a.offset,a.byteLength)),M(i,Uint8Array)&&(i=s.from(i,i.offset,i.byteLength)),!s.isBuffer(a)||!s.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===i)return 0;for(var n=a.length,e=i.length,c=0,R=Math.min(n,e);ce.length?s.from(R).copy(e,c):Uint8Array.prototype.set.call(e,R,c);else if(s.isBuffer(R))R.copy(e,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=R.length}return e};function H(u,a){if(s.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||M(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);var i=u.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;for(var e=!1;;)switch(a){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return B(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return h(u).length;default:if(e)return n?-1:B(u).length;a=(""+a).toLowerCase(),e=!0}}s.byteLength=H;function V(u,a,i){var n=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,a>>>=0,i<=a))return"";for(u||(u="utf8");;)switch(u){case"hex":return oe(this,a,i);case"utf8":case"utf-8":return F(this,a,i);case"ascii":return fe(this,a,i);case"latin1":case"binary":return se(this,a,i);case"base64":return z(this,a,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,a,i);default:if(n)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function k(u,a,i){var n=u[a];u[a]=u[i],u[i]=n}s.prototype.swap16=function(){var a=this.length;if(a%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;ii&&(a+=" ... "),""},L&&(s.prototype[L]=s.prototype.inspect),s.prototype.compare=function(a,i,n,e,c){if(M(a,Uint8Array)&&(a=s.from(a,a.offset,a.byteLength)),!s.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof a);if(i===void 0&&(i=0),n===void 0&&(n=a?a.length:0),e===void 0&&(e=0),c===void 0&&(c=this.length),i<0||n>a.length||e<0||c>this.length)throw new RangeError("out of range index");if(e>=c&&i>=n)return 0;if(e>=c)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,e>>>=0,c>>>=0,this===a)return 0;for(var R=c-e,K=n-i,te=Math.min(R,K),ae=this.slice(e,c),he=a.slice(i,n),ue=0;ue2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,t(i)&&(i=e?0:u.length-1),i<0&&(i=u.length+i),i>=u.length){if(e)return-1;i=u.length-1}else if(i<0)if(e)i=0;else return-1;if(typeof a=="string"&&(a=s.from(a,n)),s.isBuffer(a))return a.length===0?-1:W(u,a,i,n,e);if(typeof a=="number")return a=a&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(u,a,i):Uint8Array.prototype.lastIndexOf.call(u,a,i):W(u,[a],i,n,e);throw new TypeError("val must be string, number or Buffer")}function W(u,a,i,n,e){var c=1,R=u.length,K=a.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(u.length<2||a.length<2)return-1;c=2,R/=2,K/=2,i/=2}function te(ce,pe){return c===1?ce[pe]:ce.readUInt16BE(pe*c)}var ae;if(e){var he=-1;for(ae=i;aeR&&(i=R-K),ae=i;ae>=0;ae--){for(var ue=!0,de=0;dee&&(n=e)):n=e;var c=a.length;n>c/2&&(n=c/2);for(var R=0;R>>0,isFinite(n)?(n=n>>>0,e===void 0&&(e="utf8")):(e=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var c=this.length-i;if((n===void 0||n>c)&&(n=c),a.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var R=!1;;)switch(e){case"hex":return ie(this,a,i,n);case"utf8":case"utf-8":return q(this,a,i,n);case"ascii":case"latin1":case"binary":return le(this,a,i,n);case"base64":return ne(this,a,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,a,i,n);default:if(R)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),R=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function z(u,a,i){return a===0&&i===u.length?w.fromByteArray(u):w.fromByteArray(u.slice(a,i))}function F(u,a,i){i=Math.min(u.length,i);for(var n=[],e=a;e239?4:c>223?3:c>191?2:1;if(e+K<=i){var te,ae,he,ue;switch(K){case 1:c<128&&(R=c);break;case 2:te=u[e+1],(te&192)==128&&(ue=(c&31)<<6|te&63,ue>127&&(R=ue));break;case 3:te=u[e+1],ae=u[e+2],(te&192)==128&&(ae&192)==128&&(ue=(c&15)<<12|(te&63)<<6|ae&63,ue>2047&&(ue<55296||ue>57343)&&(R=ue));break;case 4:te=u[e+1],ae=u[e+2],he=u[e+3],(te&192)==128&&(ae&192)==128&&(he&192)==128&&(ue=(c&15)<<18|(te&63)<<12|(ae&63)<<6|he&63,ue>65535&&ue<1114112&&(R=ue))}}R===null?(R=65533,K=1):R>65535&&(R-=65536,n.push(R>>>10&1023|55296),R=56320|R&1023),n.push(R),e+=K}return Z(n)}var ee=4096;function Z(u){var a=u.length;if(a<=ee)return String.fromCharCode.apply(String,u);for(var i="",n=0;nn)&&(i=n);for(var e="",c=a;cn&&(a=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),ii)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(a,i,n){a=a>>>0,i=i>>>0,n||re(a,i,this.length);for(var e=this[a],c=1,R=0;++R>>0,i=i>>>0,n||re(a,i,this.length);for(var e=this[a+--i],c=1;i>0&&(c*=256);)e+=this[a+--i]*c;return e},s.prototype.readUint8=s.prototype.readUInt8=function(a,i){return a=a>>>0,i||re(a,1,this.length),this[a]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(a,i){return a=a>>>0,i||re(a,2,this.length),this[a]|this[a+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(a,i){return a=a>>>0,i||re(a,2,this.length),this[a]<<8|this[a+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(a,i){return a=a>>>0,i||re(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(a,i){return a=a>>>0,i||re(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},s.prototype.readIntLE=function(a,i,n){a=a>>>0,i=i>>>0,n||re(a,i,this.length);for(var e=this[a],c=1,R=0;++R=c&&(e-=Math.pow(2,8*i)),e},s.prototype.readIntBE=function(a,i,n){a=a>>>0,i=i>>>0,n||re(a,i,this.length);for(var e=i,c=1,R=this[a+--e];e>0&&(c*=256);)R+=this[a+--e]*c;return c*=128,R>=c&&(R-=Math.pow(2,8*i)),R},s.prototype.readInt8=function(a,i){return a=a>>>0,i||re(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},s.prototype.readInt16LE=function(a,i){a=a>>>0,i||re(a,2,this.length);var n=this[a]|this[a+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(a,i){a=a>>>0,i||re(a,2,this.length);var n=this[a+1]|this[a]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(a,i){return a=a>>>0,i||re(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},s.prototype.readInt32BE=function(a,i){return a=a>>>0,i||re(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},s.prototype.readFloatLE=function(a,i){return a=a>>>0,i||re(a,4,this.length),x.read(this,a,!0,23,4)},s.prototype.readFloatBE=function(a,i){return a=a>>>0,i||re(a,4,this.length),x.read(this,a,!1,23,4)},s.prototype.readDoubleLE=function(a,i){return a=a>>>0,i||re(a,8,this.length),x.read(this,a,!0,52,8)},s.prototype.readDoubleBE=function(a,i){return a=a>>>0,i||re(a,8,this.length),x.read(this,a,!1,52,8)};function j(u,a,i,n,e,c){if(!s.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||au.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(a,i,n,e){if(a=+a,i=i>>>0,n=n>>>0,!e){var c=Math.pow(2,8*n)-1;j(this,a,i,n,c,0)}var R=1,K=0;for(this[i]=a&255;++K>>0,n=n>>>0,!e){var c=Math.pow(2,8*n)-1;j(this,a,i,n,c,0)}var R=n-1,K=1;for(this[i+R]=a&255;--R>=0&&(K*=256);)this[i+R]=a/K&255;return i+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,1,255,0),this[i]=a&255,i+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,2,65535,0),this[i]=a&255,this[i+1]=a>>>8,i+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,2,65535,0),this[i]=a>>>8,this[i+1]=a&255,i+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,4,4294967295,0),this[i+3]=a>>>24,this[i+2]=a>>>16,this[i+1]=a>>>8,this[i]=a&255,i+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,4,4294967295,0),this[i]=a>>>24,this[i+1]=a>>>16,this[i+2]=a>>>8,this[i+3]=a&255,i+4},s.prototype.writeIntLE=function(a,i,n,e){if(a=+a,i=i>>>0,!e){var c=Math.pow(2,8*n-1);j(this,a,i,n,c-1,-c)}var R=0,K=1,te=0;for(this[i]=a&255;++R>0)-te&255;return i+n},s.prototype.writeIntBE=function(a,i,n,e){if(a=+a,i=i>>>0,!e){var c=Math.pow(2,8*n-1);j(this,a,i,n,c-1,-c)}var R=n-1,K=1,te=0;for(this[i+R]=a&255;--R>=0&&(K*=256);)a<0&&te===0&&this[i+R+1]!==0&&(te=1),this[i+R]=(a/K>>0)-te&255;return i+n},s.prototype.writeInt8=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,1,127,-128),a<0&&(a=255+a+1),this[i]=a&255,i+1},s.prototype.writeInt16LE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,2,32767,-32768),this[i]=a&255,this[i+1]=a>>>8,i+2},s.prototype.writeInt16BE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,2,32767,-32768),this[i]=a>>>8,this[i+1]=a&255,i+2},s.prototype.writeInt32LE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,4,2147483647,-2147483648),this[i]=a&255,this[i+1]=a>>>8,this[i+2]=a>>>16,this[i+3]=a>>>24,i+4},s.prototype.writeInt32BE=function(a,i,n){return a=+a,i=i>>>0,n||j(this,a,i,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[i]=a>>>24,this[i+1]=a>>>16,this[i+2]=a>>>8,this[i+3]=a&255,i+4};function G(u,a,i,n,e,c){if(i+n>u.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(u,a,i,n,e){return a=+a,i=i>>>0,e||G(u,a,i,4,34028234663852886e22,-34028234663852886e22),x.write(u,a,i,n,23,4),i+4}s.prototype.writeFloatLE=function(a,i,n){return O(this,a,i,!0,n)},s.prototype.writeFloatBE=function(a,i,n){return O(this,a,i,!1,n)};function D(u,a,i,n,e){return a=+a,i=i>>>0,e||G(u,a,i,8,17976931348623157e292,-17976931348623157e292),x.write(u,a,i,n,52,8),i+8}s.prototype.writeDoubleLE=function(a,i,n){return D(this,a,i,!0,n)},s.prototype.writeDoubleBE=function(a,i,n){return D(this,a,i,!1,n)},s.prototype.copy=function(a,i,n,e){if(!s.isBuffer(a))throw new TypeError("argument should be a Buffer");if(n||(n=0),!e&&e!==0&&(e=this.length),i>=a.length&&(i=a.length),i||(i=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),a.length-i>>0,n=n===void 0?this.length:n>>>0,a||(a=0);var R;if(typeof a=="number")for(R=i;R55295&&i<57344){if(!e){if(i>56319){(a-=3)>-1&&c.push(239,191,189);continue}else if(R+1===n){(a-=3)>-1&&c.push(239,191,189);continue}e=i;continue}if(i<56320){(a-=3)>-1&&c.push(239,191,189),e=i;continue}i=(e-55296<<10|i-56320)+65536}else e&&(a-=3)>-1&&c.push(239,191,189);if(e=null,i<128){if((a-=1)<0)break;c.push(i)}else if(i<2048){if((a-=2)<0)break;c.push(i>>6|192,i&63|128)}else if(i<65536){if((a-=3)<0)break;c.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((a-=4)<0)break;c.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return c}function d(u){for(var a=[],i=0;i>8,e=i%256,c.push(e),c.push(n);return c}function h(u){return w.toByteArray(p(u))}function I(u,a,i,n){for(var e=0;e=a.length||e>=u.length);++e)a[e+i]=u[e];return e}function M(u,a){return u instanceof a||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===a.name}function t(u){return u!==u}var r=function(){for(var u="0123456789abcdef",a=new Array(256),i=0;i<16;++i)for(var n=i*16,e=0;e<16;++e)a[n+e]=u[i]+u[e];return a}()},52898:function(Q){"use strict";function Y(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.__proto__=s}var _={};function w(o,s,l){l||(l=Error);function E(y,P,g){return typeof s=="string"?s:s(y,P,g)}var A=function(y){Y(P,y);function P(g,v,S){return y.call(this,E(g,v,S))||this}return P}(l);A.prototype.name=l.name,A.prototype.code=o,_[o]=A}function x(o,s){if(Array.isArray(o)){var l=o.length;return o=o.map(function(E){return String(E)}),l>2?"one of ".concat(s," ").concat(o.slice(0,l-1).join(", "),", or ")+o[l-1]:l===2?"one of ".concat(s," ").concat(o[0]," or ").concat(o[1]):"of ".concat(s," ").concat(o[0])}else return"of ".concat(s," ").concat(String(o))}function L(o,s,l){return o.substr(!l||l<0?0:+l,s.length)===s}function C(o,s,l){return(l===void 0||l>o.length)&&(l=o.length),o.substring(l-s.length,l)===s}function b(o,s,l){return typeof l!="number"&&(l=0),l+s.length>o.length?!1:o.indexOf(s,l)!==-1}w("ERR_INVALID_OPT_VALUE",function(o,s){return'The value "'+s+'" is invalid for option "'+o+'"'},TypeError),w("ERR_INVALID_ARG_TYPE",function(o,s,l){var E;typeof s=="string"&&L(s,"not ")?(E="must not be",s=s.replace(/^not /,"")):E="must be";var A;if(C(o," argument"))A="The ".concat(o," ").concat(E," ").concat(x(s,"type"));else{var y=b(o,".")?"property":"argument";A='The "'.concat(o,'" ').concat(y," ").concat(E," ").concat(x(s,"type"))}return A+=". Received type ".concat(typeof l),A},TypeError),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),w("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w("ERR_STREAM_WRITE_AFTER_END","write after end"),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Q.exports.q=_},6510:function(Q,Y,_){"use strict";var w=_(34155),x=Object.keys||function(y){var P=[];for(var g in y)P.push(g);return P};Q.exports=l;var L=_(42813),C=_(79850);_(35717)(l,L);for(var b=x(C.prototype),o=0;o0)if(typeof r!="string"&&!n.objectMode&&Object.getPrototypeOf(r)!==o.prototype&&(r=l(r)),a)n.endEmitted?ie(t,new V):F(t,n,r,!0);else if(n.ended)ie(t,new N);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!u?(r=n.decoder.write(r),n.objectMode||r.length!==0?F(t,n,r,!1):j(t,n)):F(t,n,r,!1)}else a||(n.reading=!1,j(t,n))}return!n.ended&&(n.length=Z?t=Z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function se(t,r){return t<=0||r.length===0&&r.ended?0:r.objectMode?1:t!==t?r.flowing&&r.length?r.buffer.head.data.length:r.length:(t>r.highWaterMark&&(r.highWaterMark=fe(t)),t<=r.length?t:r.ended?r.length:(r.needReadable=!0,0))}J.prototype.read=function(t){y("read",t),t=parseInt(t,10);var r=this._readableState,u=t;if(t!==0&&(r.emittedReadable=!1),t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return y("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?h(this):$(this),null;if(t=se(t,r),t===0&&r.ended)return r.length===0&&h(this),null;var a=r.needReadable;y("need readable",a),(r.length===0||r.length-t0?i=f(t,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),u!==t&&r.ended&&h(this)),i!==null&&this.emit("data",i),i};function oe(t,r){if(y("onEofChunk"),!r.ended){if(r.decoder){var u=r.decoder.end();u&&u.length&&(r.buffer.push(u),r.length+=r.objectMode?1:u.length)}r.ended=!0,r.sync?$(t):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,re(t)))}}function $(t){var r=t._readableState;y("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(y("emitReadable",r.flowing),r.emittedReadable=!0,w.nextTick(re,t))}function re(t){var r=t._readableState;y("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,d(t)}function j(t,r){r.readingMore||(r.readingMore=!0,w.nextTick(G,t,r))}function G(t,r){for(;!r.reading&&!r.ended&&(r.length1&&M(a.pipes,t)!==-1)&&!K&&(y("false write response, pause",a.awaitDrain),a.awaitDrain++),u.pause())}function he(pe){y("onerror",pe),ce(),t.removeListener("error",he),C(t,"error")===0&&ie(t,pe)}le(t,"error",he);function ue(){t.removeListener("finish",de),ce()}t.once("close",ue);function de(){y("onfinish"),t.removeListener("close",ue),ce()}t.once("finish",de);function ce(){y("unpipe"),u.unpipe(t)}return t.emit("pipe",u),a.flowing||(y("pipe resume"),u.resume()),t};function O(t){return function(){var u=t._readableState;y("pipeOnDrain",u.awaitDrain),u.awaitDrain&&u.awaitDrain--,u.awaitDrain===0&&C(t,"data")&&(u.flowing=!0,d(t))}}J.prototype.unpipe=function(t){var r=this._readableState,u={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return t&&t!==r.pipes?this:(t||(t=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,t&&t.emit("unpipe",this,u),this);if(!t){var a=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var n=0;n0,a.flowing!==!1&&this.resume()):t==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,y("on readable",a.length,a.reading),a.length?$(this):a.reading||w.nextTick(m,this)),u},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(t,r){var u=b.prototype.removeListener.call(this,t,r);return t==="readable"&&w.nextTick(D,this),u},J.prototype.removeAllListeners=function(t){var r=b.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&w.nextTick(D,this),r};function D(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:t.listenerCount("data")>0&&t.resume()}function m(t){y("readable nexttick read 0"),t.read(0)}J.prototype.resume=function(){var t=this._readableState;return t.flowing||(y("resume"),t.flowing=!t.readableListening,p(this,t)),t.paused=!1,this};function p(t,r){r.resumeScheduled||(r.resumeScheduled=!0,w.nextTick(B,t,r))}function B(t,r){y("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),d(t),r.flowing&&!r.reading&&t.read(0)}J.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function d(t){var r=t._readableState;for(y("flow",r.flowing);r.flowing&&t.read()!==null;);}J.prototype.wrap=function(t){var r=this,u=this._readableState,a=!1;t.on("end",function(){if(y("wrapped end"),u.decoder&&!u.ended){var e=u.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),t.on("data",function(e){if(y("wrapped data"),u.decoder&&(e=u.decoder.write(e)),!(u.objectMode&&e==null)&&!(!u.objectMode&&(!e||!e.length))){var c=r.push(e);c||(a=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(c){return function(){return t[c].apply(t,arguments)}}(i));for(var n=0;n=r.length?(r.decoder?u=r.buffer.join(""):r.buffer.length===1?u=r.buffer.first():u=r.buffer.concat(r.length),r.buffer.clear()):u=r.buffer.consume(t,r.decoder),u}function h(t){var r=t._readableState;y("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,w.nextTick(I,r,t))}function I(t,r){if(y("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,r.readable=!1,r.emit("end"),t.autoDestroy)){var u=r._writableState;(!u||u.autoDestroy&&u.finished)&&r.destroy()}}typeof Symbol=="function"&&(J.from=function(t,r){return W===void 0&&(W=_(38869)),W(J,t,r)});function M(t,r){for(var u=0,a=t.length;u-1))throw new X(f);return this._writableState.defaultEncoding=f,this},Object.defineProperty(ne.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function F(d,f,h){return!d.objectMode&&d.decodeStrings!==!1&&typeof f=="string"&&(f=s.from(f,h)),f}Object.defineProperty(ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ee(d,f,h,I,M,t){if(!h){var r=F(f,I,M);I!==r&&(h=!0,M="buffer",I=r)}var u=f.objectMode?1:I.length;f.length+=u;var a=f.length0?this.tail.next=T:this.head=T,this.tail=T,++this.length}},{key:"unshift",value:function(S){var T={data:S,next:this.head};this.length===0&&(this.tail=T),this.head=T,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var T=this.head,U=""+T.data;T=T.next;)U+=S+T.data;return U}},{key:"concat",value:function(S){if(this.length===0)return l.alloc(0);for(var T=l.allocUnsafe(S>>>0),U=this.head,N=0;U;)P(U.data,T,N),N+=U.data.length,U=U.next;return T}},{key:"consume",value:function(S,T){var U;return SH.length?H.length:S;if(V===H.length?N+=H:N+=H.slice(0,S),S-=V,S===0){V===H.length?(++U,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=H.slice(V));break}++U}return this.length-=U,N}},{key:"_getBuffer",value:function(S){var T=l.allocUnsafe(S),U=this.head,N=1;for(U.data.copy(T),S-=U.data.length;U=U.next;){var H=U.data,V=S>H.length?H.length:S;if(H.copy(T,T.length-S,0,V),S-=V,S===0){V===H.length?(++N,U.next?this.head=U.next:this.head=this.tail=null):(this.head=U,U.data=H.slice(V));break}++N}return this.length-=N,T}},{key:y,value:function(S,T){return A(this,x({},T,{depth:0,customInspect:!1}))}}]),g}()},12214:function(Q,Y,_){"use strict";var w=_(34155);function x(l,E){var A=this,y=this._readableState&&this._readableState.destroyed,P=this._writableState&&this._writableState.destroyed;return y||P?(E?E(l):l&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,w.nextTick(o,this,l)):w.nextTick(o,this,l)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(g){!E&&g?A._writableState?A._writableState.errorEmitted?w.nextTick(C,A):(A._writableState.errorEmitted=!0,w.nextTick(L,A,g)):w.nextTick(L,A,g):E?(w.nextTick(C,A),E(g)):w.nextTick(C,A)}),this)}function L(l,E){o(l,E),C(l)}function C(l){l._writableState&&!l._writableState.emitClose||l._readableState&&!l._readableState.emitClose||l.emit("close")}function b(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(l,E){l.emit("error",E)}function s(l,E){var A=l._readableState,y=l._writableState;A&&A.autoDestroy||y&&y.autoDestroy?l.destroy(E):l.emit("error",E)}Q.exports={destroy:x,undestroy:b,errorOrDestroy:s}},37810:function(Q,Y,_){"use strict";var w=_(52898).q.ERR_STREAM_PREMATURE_CLOSE;function x(o){var s=!1;return function(){if(!s){s=!0;for(var l=arguments.length,E=new Array(l),A=0;A0;return l(H,k,X,function(W){U||(U=W),W&&N.forEach(E),!k&&(N.forEach(E),T(U))})});return v.reduce(A)}Q.exports=P},48425:function(Q,Y,_){"use strict";var w=_(52898).q.ERR_INVALID_OPT_VALUE;function x(C,b,o){return C.highWaterMark!=null?C.highWaterMark:b?C[o]:null}function L(C,b,o,s){var l=x(b,s,o);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var E=s?o:"highWaterMark";throw new w(E,l)}return Math.floor(l)}return C.objectMode?16:16*1024}Q.exports={getHighWaterMark:L}},79853:function(Q,Y,_){Q.exports=_(17187).EventEmitter},28850:function(Q,Y,_){Y=Q.exports=_(42813),Y.Stream=Y,Y.Readable=Y,Y.Writable=_(79850),Y.Duplex=_(6510),Y.Transform=_(14059),Y.PassThrough=_(4586),Y.finished=_(37810),Y.pipeline=_(66300)},48764:function(Q,Y,_){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var w=_(79742),x=_(80645),L=_(5826);Y.Buffer=s,Y.SlowBuffer=U,Y.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=_.g.TYPED_ARRAY_SUPPORT!==void 0?_.g.TYPED_ARRAY_SUPPORT:C(),Y.kMaxLength=b();function C(){try{var i=new Uint8Array(1);return i.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},i.foo()===42&&typeof i.subarray=="function"&&i.subarray(1,1).byteLength===0}catch(n){return!1}}function b(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(i,n){if(b()=b())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+b().toString(16)+" bytes");return i|0}function U(i){return+i!=i&&(i=0),s.alloc(+i)}s.isBuffer=function(n){return!!(n!=null&&n._isBuffer)},s.compare=function(n,e){if(!s.isBuffer(n)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(n===e)return 0;for(var c=n.length,R=e.length,K=0,te=Math.min(c,R);K>>1;case"base64":return r(i).length;default:if(c)return I(i).length;n=(""+n).toLowerCase(),c=!0}}s.byteLength=N;function H(i,n,e){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,n>>>=0,e<=n))return"";for(i||(i="utf8");;)switch(i){case"hex":return oe(this,n,e);case"utf8":case"utf-8":return F(this,n,e);case"ascii":return fe(this,n,e);case"latin1":case"binary":return se(this,n,e);case"base64":return z(this,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,n,e);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),c=!0}}s.prototype._isBuffer=!0;function V(i,n,e){var c=i[n];i[n]=i[e],i[e]=c}s.prototype.swap16=function(){var n=this.length;if(n%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e0&&(n=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(n+=" ... ")),""},s.prototype.compare=function(n,e,c,R,K){if(!s.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),c===void 0&&(c=n?n.length:0),R===void 0&&(R=0),K===void 0&&(K=this.length),e<0||c>n.length||R<0||K>this.length)throw new RangeError("out of range index");if(R>=K&&e>=c)return 0;if(R>=K)return-1;if(e>=c)return 1;if(e>>>=0,c>>>=0,R>>>=0,K>>>=0,this===n)return 0;for(var te=K-R,ae=c-e,he=Math.min(te,ae),ue=this.slice(R,K),de=n.slice(e,c),ce=0;ce2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=R?0:i.length-1),e<0&&(e=i.length+e),e>=i.length){if(R)return-1;e=i.length-1}else if(e<0)if(R)e=0;else return-1;if(typeof n=="string"&&(n=s.from(n,c)),s.isBuffer(n))return n.length===0?-1:X(i,n,e,c,R);if(typeof n=="number")return n=n&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(i,n,e):Uint8Array.prototype.lastIndexOf.call(i,n,e):X(i,[n],e,c,R);throw new TypeError("val must be string, number or Buffer")}function X(i,n,e,c,R){var K=1,te=i.length,ae=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(i.length<2||n.length<2)return-1;K=2,te/=2,ae/=2,e/=2}function he(ye,ve){return K===1?ye[ve]:ye.readUInt16BE(ve*K)}var ue;if(R){var de=-1;for(ue=e;uete&&(e=te-ae),ue=e;ue>=0;ue--){for(var ce=!0,pe=0;peR&&(c=R)):c=R;var K=n.length;if(K%2!=0)throw new TypeError("Invalid hex string");c>K/2&&(c=K/2);for(var te=0;teK)&&(c=K),n.length>0&&(c<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");for(var te=!1;;)switch(R){case"hex":return W(this,n,e,c);case"utf8":case"utf-8":return ie(this,n,e,c);case"ascii":return q(this,n,e,c);case"latin1":case"binary":return le(this,n,e,c);case"base64":return ne(this,n,e,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,n,e,c);default:if(te)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),te=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function z(i,n,e){return n===0&&e===i.length?w.fromByteArray(i):w.fromByteArray(i.slice(n,e))}function F(i,n,e){e=Math.min(i.length,e);for(var c=[],R=n;R239?4:K>223?3:K>191?2:1;if(R+ae<=e){var he,ue,de,ce;switch(ae){case 1:K<128&&(te=K);break;case 2:he=i[R+1],(he&192)==128&&(ce=(K&31)<<6|he&63,ce>127&&(te=ce));break;case 3:he=i[R+1],ue=i[R+2],(he&192)==128&&(ue&192)==128&&(ce=(K&15)<<12|(he&63)<<6|ue&63,ce>2047&&(ce<55296||ce>57343)&&(te=ce));break;case 4:he=i[R+1],ue=i[R+2],de=i[R+3],(he&192)==128&&(ue&192)==128&&(de&192)==128&&(ce=(K&15)<<18|(he&63)<<12|(ue&63)<<6|de&63,ce>65535&&ce<1114112&&(te=ce))}}te===null?(te=65533,ae=1):te>65535&&(te-=65536,c.push(te>>>10&1023|55296),te=56320|te&1023),c.push(te),R+=ae}return Z(c)}var ee=4096;function Z(i){var n=i.length;if(n<=ee)return String.fromCharCode.apply(String,i);for(var e="",c=0;cc)&&(e=c);for(var R="",K=n;Kc&&(n=c),e<0?(e+=c,e<0&&(e=0)):e>c&&(e=c),ee)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(n,e,c){n=n|0,e=e|0,c||re(n,e,this.length);for(var R=this[n],K=1,te=0;++te0&&(K*=256);)R+=this[n+--e]*K;return R},s.prototype.readUInt8=function(n,e){return e||re(n,1,this.length),this[n]},s.prototype.readUInt16LE=function(n,e){return e||re(n,2,this.length),this[n]|this[n+1]<<8},s.prototype.readUInt16BE=function(n,e){return e||re(n,2,this.length),this[n]<<8|this[n+1]},s.prototype.readUInt32LE=function(n,e){return e||re(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},s.prototype.readUInt32BE=function(n,e){return e||re(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},s.prototype.readIntLE=function(n,e,c){n=n|0,e=e|0,c||re(n,e,this.length);for(var R=this[n],K=1,te=0;++te=K&&(R-=Math.pow(2,8*e)),R},s.prototype.readIntBE=function(n,e,c){n=n|0,e=e|0,c||re(n,e,this.length);for(var R=e,K=1,te=this[n+--R];R>0&&(K*=256);)te+=this[n+--R]*K;return K*=128,te>=K&&(te-=Math.pow(2,8*e)),te},s.prototype.readInt8=function(n,e){return e||re(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},s.prototype.readInt16LE=function(n,e){e||re(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},s.prototype.readInt16BE=function(n,e){e||re(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},s.prototype.readInt32LE=function(n,e){return e||re(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},s.prototype.readInt32BE=function(n,e){return e||re(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},s.prototype.readFloatLE=function(n,e){return e||re(n,4,this.length),x.read(this,n,!0,23,4)},s.prototype.readFloatBE=function(n,e){return e||re(n,4,this.length),x.read(this,n,!1,23,4)},s.prototype.readDoubleLE=function(n,e){return e||re(n,8,this.length),x.read(this,n,!0,52,8)},s.prototype.readDoubleBE=function(n,e){return e||re(n,8,this.length),x.read(this,n,!1,52,8)};function j(i,n,e,c,R,K){if(!s.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>R||ni.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(n,e,c,R){if(n=+n,e=e|0,c=c|0,!R){var K=Math.pow(2,8*c)-1;j(this,n,e,c,K,0)}var te=1,ae=0;for(this[e]=n&255;++ae=0&&(ae*=256);)this[e+te]=n/ae&255;return e+c},s.prototype.writeUInt8=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[e]=n&255,e+1};function G(i,n,e,c){n<0&&(n=65535+n+1);for(var R=0,K=Math.min(i.length-e,2);R>>(c?R:1-R)*8}s.prototype.writeUInt16LE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=n&255,this[e+1]=n>>>8):G(this,n,e,!0),e+2},s.prototype.writeUInt16BE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=n&255):G(this,n,e,!1),e+2};function O(i,n,e,c){n<0&&(n=4294967295+n+1);for(var R=0,K=Math.min(i.length-e,4);R>>(c?R:3-R)*8&255}s.prototype.writeUInt32LE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=n>>>24,this[e+2]=n>>>16,this[e+1]=n>>>8,this[e]=n&255):O(this,n,e,!0),e+4},s.prototype.writeUInt32BE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=n&255):O(this,n,e,!1),e+4},s.prototype.writeIntLE=function(n,e,c,R){if(n=+n,e=e|0,!R){var K=Math.pow(2,8*c-1);j(this,n,e,c,K-1,-K)}var te=0,ae=1,he=0;for(this[e]=n&255;++te>0)-he&255;return e+c},s.prototype.writeIntBE=function(n,e,c,R){if(n=+n,e=e|0,!R){var K=Math.pow(2,8*c-1);j(this,n,e,c,K-1,-K)}var te=c-1,ae=1,he=0;for(this[e+te]=n&255;--te>=0&&(ae*=256);)n<0&&he===0&&this[e+te+1]!==0&&(he=1),this[e+te]=(n/ae>>0)-he&255;return e+c},s.prototype.writeInt8=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[e]=n&255,e+1},s.prototype.writeInt16LE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=n&255,this[e+1]=n>>>8):G(this,n,e,!0),e+2},s.prototype.writeInt16BE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=n&255):G(this,n,e,!1),e+2},s.prototype.writeInt32LE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=n&255,this[e+1]=n>>>8,this[e+2]=n>>>16,this[e+3]=n>>>24):O(this,n,e,!0),e+4},s.prototype.writeInt32BE=function(n,e,c){return n=+n,e=e|0,c||j(this,n,e,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),s.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=n&255):O(this,n,e,!1),e+4};function D(i,n,e,c,R,K){if(e+c>i.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function m(i,n,e,c,R){return R||D(i,n,e,4,34028234663852886e22,-34028234663852886e22),x.write(i,n,e,c,23,4),e+4}s.prototype.writeFloatLE=function(n,e,c){return m(this,n,e,!0,c)},s.prototype.writeFloatBE=function(n,e,c){return m(this,n,e,!1,c)};function p(i,n,e,c,R){return R||D(i,n,e,8,17976931348623157e292,-17976931348623157e292),x.write(i,n,e,c,52,8),e+8}s.prototype.writeDoubleLE=function(n,e,c){return p(this,n,e,!0,c)},s.prototype.writeDoubleBE=function(n,e,c){return p(this,n,e,!1,c)},s.prototype.copy=function(n,e,c,R){if(c||(c=0),!R&&R!==0&&(R=this.length),e>=n.length&&(e=n.length),e||(e=0),R>0&&R=this.length)throw new RangeError("sourceStart out of bounds");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),n.length-e=0;--te)n[te+e]=this[te+c];else if(K<1e3||!s.TYPED_ARRAY_SUPPORT)for(te=0;te>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var te;if(typeof n=="number")for(te=e;te55295&&e<57344){if(!R){if(e>56319){(n-=3)>-1&&K.push(239,191,189);continue}else if(te+1===c){(n-=3)>-1&&K.push(239,191,189);continue}R=e;continue}if(e<56320){(n-=3)>-1&&K.push(239,191,189),R=e;continue}e=(R-55296<<10|e-56320)+65536}else R&&(n-=3)>-1&&K.push(239,191,189);if(R=null,e<128){if((n-=1)<0)break;K.push(e)}else if(e<2048){if((n-=2)<0)break;K.push(e>>6|192,e&63|128)}else if(e<65536){if((n-=3)<0)break;K.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((n-=4)<0)break;K.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return K}function M(i){for(var n=[],e=0;e>8,R=e%256,K.push(R),K.push(c);return K}function r(i){return w.toByteArray(d(i))}function u(i,n,e,c){for(var R=0;R=n.length||R>=i.length);++R)n[R+e]=i[R];return R}function a(i){return i!==i}},25981:function(Q,Y,_){var w=_(48764).Buffer,x=_(34155),L=_(45723),C=_(12840),b=_(35717),o=_(31852),s=w.from&&w.from!==Uint8Array.from?w.from([0]):new w([0]),l=function(S,T){S._corked?S.once("uncork",T):T()},E=function(S,T){S._autoDestroy&&S.destroy(T)},A=function(S,T){return function(U){U?E(S,U.message==="premature close"?null:U):T&&!S._ended&&S.end()}},y=function(S,T){if(!S||S._writableState&&S._writableState.finished)return T();if(S._writableState)return S.end(T);S.end(),T()},P=function(){},g=function(S){return new L.Readable({objectMode:!0,highWaterMark:16}).wrap(S)},v=function(S,T,U){if(!(this instanceof v))return new v(S,T,U);L.Duplex.call(this,U),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!U||U.autoDestroy!==!1,this._forwardDestroy=!U||U.destroy!==!1,this._forwardEnd=!U||U.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,S&&this.setWritable(S),T&&this.setReadable(T)};b(v,L.Duplex),v.obj=function(S,T,U){return U||(U={}),U.objectMode=!0,U.highWaterMark=16,new v(S,T,U)},v.prototype.cork=function(){++this._corked==1&&this.emit("cork")},v.prototype.uncork=function(){this._corked&&--this._corked==0&&this.emit("uncork")},v.prototype.setWritable=function(S){if(this._unwrite&&this._unwrite(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.end();return}var T=this,U=C(S,{writable:!0,readable:!1},A(this,this._forwardEnd)),N=function(){var V=T._ondrain;T._ondrain=null,V&&V()},H=function(){T._writable.removeListener("drain",N),U()};this._unwrite&&x.nextTick(N),this._writable=S,this._writable.on("drain",N),this._unwrite=H,this.uncork()},v.prototype.setReadable=function(S){if(this._unread&&this._unread(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.push(null),this.resume();return}var T=this,U=C(S,{writable:!1,readable:!0},A(this)),N=function(){T._forward()},H=function(){T.push(null)},V=function(){T._readable2.removeListener("readable",N),T._readable2.removeListener("end",H),U()};this._drained=!0,this._readable=S,this._readable2=S._readableState?S:g(S),this._readable2.on("readable",N),this._readable2.on("end",H),this._unread=V,this._forward()},v.prototype._read=function(){this._drained=!0,this._forward()},v.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var S;this._drained&&(S=o(this._readable2))!==null;)this.destroyed||(this._drained=this.push(S));this._forwarding=!1}},v.prototype.destroy=function(S,T){if(T||(T=P),this.destroyed)return T(null);this.destroyed=!0;var U=this;x.nextTick(function(){U._destroy(S),T(null)})},v.prototype._destroy=function(S){if(S){var T=this._ondrain;this._ondrain=null,T?T(S):this.emit("error",S)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},v.prototype._write=function(S,T,U){if(!this.destroyed){if(this._corked)return l(this,this._write.bind(this,S,T,U));if(S===s)return this._finish(U);if(!this._writable)return U();this._writable.write(S)===!1?this._ondrain=U:this.destroyed||U()}},v.prototype._finish=function(S){var T=this;this.emit("preend"),l(this,function(){y(T._forwardEnd&&T._writable,function(){T._writableState.prefinished===!1&&(T._writableState.prefinished=!0),T.emit("prefinish"),l(T,S)})})},v.prototype.end=function(S,T,U){return typeof S=="function"?this.end(null,null,S):typeof T=="function"?this.end(S,null,T):(this._ended=!0,S&&this.write(S),!this._writableState.ending&&!this._writableState.destroyed&&this.write(s),L.Writable.prototype.end.call(this,U))},Q.exports=v},98965:function(Q){"use strict";function Y(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.__proto__=s}var _={};function w(o,s,l){l||(l=Error);function E(y,P,g){return typeof s=="string"?s:s(y,P,g)}var A=function(y){Y(P,y);function P(g,v,S){return y.call(this,E(g,v,S))||this}return P}(l);A.prototype.name=l.name,A.prototype.code=o,_[o]=A}function x(o,s){if(Array.isArray(o)){var l=o.length;return o=o.map(function(E){return String(E)}),l>2?"one of ".concat(s," ").concat(o.slice(0,l-1).join(", "),", or ")+o[l-1]:l===2?"one of ".concat(s," ").concat(o[0]," or ").concat(o[1]):"of ".concat(s," ").concat(o[0])}else return"of ".concat(s," ").concat(String(o))}function L(o,s,l){return o.substr(!l||l<0?0:+l,s.length)===s}function C(o,s,l){return(l===void 0||l>o.length)&&(l=o.length),o.substring(l-s.length,l)===s}function b(o,s,l){return typeof l!="number"&&(l=0),l+s.length>o.length?!1:o.indexOf(s,l)!==-1}w("ERR_INVALID_OPT_VALUE",function(o,s){return'The value "'+s+'" is invalid for option "'+o+'"'},TypeError),w("ERR_INVALID_ARG_TYPE",function(o,s,l){var E;typeof s=="string"&&L(s,"not ")?(E="must not be",s=s.replace(/^not /,"")):E="must be";var A;if(C(o," argument"))A="The ".concat(o," ").concat(E," ").concat(x(s,"type"));else{var y=b(o,".")?"property":"argument";A='The "'.concat(o,'" ').concat(y," ").concat(E," ").concat(x(s,"type"))}return A+=". Received type ".concat(typeof l),A},TypeError),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),w("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w("ERR_STREAM_WRITE_AFTER_END","write after end"),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Q.exports.q=_},15227:function(Q,Y,_){"use strict";var w=_(34155),x=Object.keys||function(y){var P=[];for(var g in y)P.push(g);return P};Q.exports=l;var L=_(1372),C=_(89083);_(35717)(l,L);for(var b=x(C.prototype),o=0;o0)if(typeof r!="string"&&!n.objectMode&&Object.getPrototypeOf(r)!==o.prototype&&(r=l(r)),a)n.endEmitted?ie(t,new V):F(t,n,r,!0);else if(n.ended)ie(t,new N);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!u?(r=n.decoder.write(r),n.objectMode||r.length!==0?F(t,n,r,!1):j(t,n)):F(t,n,r,!1)}else a||(n.reading=!1,j(t,n))}return!n.ended&&(n.length=Z?t=Z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function se(t,r){return t<=0||r.length===0&&r.ended?0:r.objectMode?1:t!==t?r.flowing&&r.length?r.buffer.head.data.length:r.length:(t>r.highWaterMark&&(r.highWaterMark=fe(t)),t<=r.length?t:r.ended?r.length:(r.needReadable=!0,0))}J.prototype.read=function(t){y("read",t),t=parseInt(t,10);var r=this._readableState,u=t;if(t!==0&&(r.emittedReadable=!1),t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return y("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?h(this):$(this),null;if(t=se(t,r),t===0&&r.ended)return r.length===0&&h(this),null;var a=r.needReadable;y("need readable",a),(r.length===0||r.length-t0?i=f(t,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),u!==t&&r.ended&&h(this)),i!==null&&this.emit("data",i),i};function oe(t,r){if(y("onEofChunk"),!r.ended){if(r.decoder){var u=r.decoder.end();u&&u.length&&(r.buffer.push(u),r.length+=r.objectMode?1:u.length)}r.ended=!0,r.sync?$(t):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,re(t)))}}function $(t){var r=t._readableState;y("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(y("emitReadable",r.flowing),r.emittedReadable=!0,w.nextTick(re,t))}function re(t){var r=t._readableState;y("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,d(t)}function j(t,r){r.readingMore||(r.readingMore=!0,w.nextTick(G,t,r))}function G(t,r){for(;!r.reading&&!r.ended&&(r.length1&&M(a.pipes,t)!==-1)&&!K&&(y("false write response, pause",a.awaitDrain),a.awaitDrain++),u.pause())}function he(pe){y("onerror",pe),ce(),t.removeListener("error",he),C(t,"error")===0&&ie(t,pe)}le(t,"error",he);function ue(){t.removeListener("finish",de),ce()}t.once("close",ue);function de(){y("onfinish"),t.removeListener("close",ue),ce()}t.once("finish",de);function ce(){y("unpipe"),u.unpipe(t)}return t.emit("pipe",u),a.flowing||(y("pipe resume"),u.resume()),t};function O(t){return function(){var u=t._readableState;y("pipeOnDrain",u.awaitDrain),u.awaitDrain&&u.awaitDrain--,u.awaitDrain===0&&C(t,"data")&&(u.flowing=!0,d(t))}}J.prototype.unpipe=function(t){var r=this._readableState,u={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return t&&t!==r.pipes?this:(t||(t=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,t&&t.emit("unpipe",this,u),this);if(!t){var a=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var n=0;n0,a.flowing!==!1&&this.resume()):t==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,y("on readable",a.length,a.reading),a.length?$(this):a.reading||w.nextTick(m,this)),u},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(t,r){var u=b.prototype.removeListener.call(this,t,r);return t==="readable"&&w.nextTick(D,this),u},J.prototype.removeAllListeners=function(t){var r=b.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&w.nextTick(D,this),r};function D(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:t.listenerCount("data")>0&&t.resume()}function m(t){y("readable nexttick read 0"),t.read(0)}J.prototype.resume=function(){var t=this._readableState;return t.flowing||(y("resume"),t.flowing=!t.readableListening,p(this,t)),t.paused=!1,this};function p(t,r){r.resumeScheduled||(r.resumeScheduled=!0,w.nextTick(B,t,r))}function B(t,r){y("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),d(t),r.flowing&&!r.reading&&t.read(0)}J.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function d(t){var r=t._readableState;for(y("flow",r.flowing);r.flowing&&t.read()!==null;);}J.prototype.wrap=function(t){var r=this,u=this._readableState,a=!1;t.on("end",function(){if(y("wrapped end"),u.decoder&&!u.ended){var e=u.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),t.on("data",function(e){if(y("wrapped data"),u.decoder&&(e=u.decoder.write(e)),!(u.objectMode&&e==null)&&!(!u.objectMode&&(!e||!e.length))){var c=r.push(e);c||(a=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(c){return function(){return t[c].apply(t,arguments)}}(i));for(var n=0;n=r.length?(r.decoder?u=r.buffer.join(""):r.buffer.length===1?u=r.buffer.first():u=r.buffer.concat(r.length),r.buffer.clear()):u=r.buffer.consume(t,r.decoder),u}function h(t){var r=t._readableState;y("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,w.nextTick(I,r,t))}function I(t,r){if(y("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,r.readable=!1,r.emit("end"),t.autoDestroy)){var u=r._writableState;(!u||u.autoDestroy&&u.finished)&&r.destroy()}}typeof Symbol=="function"&&(J.from=function(t,r){return W===void 0&&(W=_(34935)),W(J,t,r)});function M(t,r){for(var u=0,a=t.length;u-1))throw new X(f);return this._writableState.defaultEncoding=f,this},Object.defineProperty(ne.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function F(d,f,h){return!d.objectMode&&d.decodeStrings!==!1&&typeof f=="string"&&(f=s.from(f,h)),f}Object.defineProperty(ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ee(d,f,h,I,M,t){if(!h){var r=F(f,I,M);I!==r&&(h=!0,M="buffer",I=r)}var u=f.objectMode?1:I.length;f.length+=u;var a=f.length0?this.tail.next=T:this.head=T,this.tail=T,++this.length}},{key:"unshift",value:function(S){var T={data:S,next:this.head};this.length===0&&(this.tail=T),this.head=T,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var T=this.head,U=""+T.data;T=T.next;)U+=S+T.data;return U}},{key:"concat",value:function(S){if(this.length===0)return l.alloc(0);for(var T=l.allocUnsafe(S>>>0),U=this.head,N=0;U;)P(U.data,T,N),N+=U.data.length,U=U.next;return T}},{key:"consume",value:function(S,T){var U;return SH.length?H.length:S;if(V===H.length?N+=H:N+=H.slice(0,S),S-=V,S===0){V===H.length?(++U,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=H.slice(V));break}++U}return this.length-=U,N}},{key:"_getBuffer",value:function(S){var T=l.allocUnsafe(S),U=this.head,N=1;for(U.data.copy(T),S-=U.data.length;U=U.next;){var H=U.data,V=S>H.length?H.length:S;if(H.copy(T,T.length-S,0,V),S-=V,S===0){V===H.length?(++N,U.next?this.head=U.next:this.head=this.tail=null):(this.head=U,U.data=H.slice(V));break}++N}return this.length-=N,T}},{key:y,value:function(S,T){return A(this,x({},T,{depth:0,customInspect:!1}))}}]),g}()},35296:function(Q,Y,_){"use strict";var w=_(34155);function x(l,E){var A=this,y=this._readableState&&this._readableState.destroyed,P=this._writableState&&this._writableState.destroyed;return y||P?(E?E(l):l&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,w.nextTick(o,this,l)):w.nextTick(o,this,l)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(g){!E&&g?A._writableState?A._writableState.errorEmitted?w.nextTick(C,A):(A._writableState.errorEmitted=!0,w.nextTick(L,A,g)):w.nextTick(L,A,g):E?(w.nextTick(C,A),E(g)):w.nextTick(C,A)}),this)}function L(l,E){o(l,E),C(l)}function C(l){l._writableState&&!l._writableState.emitClose||l._readableState&&!l._readableState.emitClose||l.emit("close")}function b(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(l,E){l.emit("error",E)}function s(l,E){var A=l._readableState,y=l._writableState;A&&A.autoDestroy||y&&y.autoDestroy?l.destroy(E):l.emit("error",E)}Q.exports={destroy:x,undestroy:b,errorOrDestroy:s}},75716:function(Q,Y,_){"use strict";var w=_(98965).q.ERR_STREAM_PREMATURE_CLOSE;function x(o){var s=!1;return function(){if(!s){s=!0;for(var l=arguments.length,E=new Array(l),A=0;A0;return l(H,k,X,function(W){U||(U=W),W&&N.forEach(E),!k&&(N.forEach(E),T(U))})});return v.reduce(A)}Q.exports=P},81342:function(Q,Y,_){"use strict";var w=_(98965).q.ERR_INVALID_OPT_VALUE;function x(C,b,o){return C.highWaterMark!=null?C.highWaterMark:b?C[o]:null}function L(C,b,o,s){var l=x(b,s,o);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var E=s?o:"highWaterMark";throw new w(E,l)}return Math.floor(l)}return C.objectMode?16:16*1024}Q.exports={getHighWaterMark:L}},85483:function(Q,Y,_){Q.exports=_(17187).EventEmitter},45723:function(Q,Y,_){Y=Q.exports=_(1372),Y.Stream=Y,Y.Readable=Y,Y.Writable=_(89083),Y.Duplex=_(15227),Y.Transform=_(34670),Y.PassThrough=_(95688),Y.finished=_(75716),Y.pipeline=_(16398)},12840:function(Q,Y,_){var w=_(34155),x=_(30778),L=function(){},C=function(s){return s.setHeader&&typeof s.abort=="function"},b=function(s){return s.stdio&&Array.isArray(s.stdio)&&s.stdio.length===3},o=function(s,l,E){if(typeof l=="function")return o(s,null,l);l||(l={}),E=x(E||L);var A=s._writableState,y=s._readableState,P=l.readable||l.readable!==!1&&s.readable,g=l.writable||l.writable!==!1&&s.writable,v=!1,S=function(){s.writable||T()},T=function(){g=!1,P||E.call(s)},U=function(){P=!1,g||E.call(s)},N=function(W){E.call(s,W?new Error("exited with error code: "+W):null)},H=function(W){E.call(s,W)},V=function(){w.nextTick(k)},k=function(){if(!v){if(P&&!(y&&y.ended&&!y.destroyed))return E.call(s,new Error("premature close"));if(g&&!(A&&A.ended&&!A.destroyed))return E.call(s,new Error("premature close"))}},X=function(){s.req.on("finish",T)};return C(s)?(s.on("complete",T),s.on("abort",V),s.req?X():s.on("request",X)):g&&!A&&(s.on("end",S),s.on("close",S)),b(s)&&s.on("exit",N),s.on("end",U),s.on("finish",T),l.error!==!1&&s.on("error",H),s.on("close",V),function(){v=!0,s.removeListener("complete",T),s.removeListener("abort",V),s.removeListener("request",X),s.req&&s.req.removeListener("finish",T),s.removeListener("end",S),s.removeListener("close",S),s.removeListener("finish",T),s.removeListener("exit",N),s.removeListener("end",U),s.removeListener("error",H),s.removeListener("close",V)}};Q.exports=o},80645:function(Q,Y){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Y.read=function(_,w,x,L,C){var b,o,s=C*8-L-1,l=(1<>1,A=-7,y=x?C-1:0,P=x?-1:1,g=_[w+y];for(y+=P,b=g&(1<<-A)-1,g>>=-A,A+=s;A>0;b=b*256+_[w+y],y+=P,A-=8);for(o=b&(1<<-A)-1,b>>=-A,A+=L;A>0;o=o*256+_[w+y],y+=P,A-=8);if(b===0)b=1-E;else{if(b===l)return o?NaN:(g?-1:1)*Infinity;o=o+Math.pow(2,L),b=b-E}return(g?-1:1)*o*Math.pow(2,b-L)},Y.write=function(_,w,x,L,C,b){var o,s,l,E=b*8-C-1,A=(1<>1,P=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=L?0:b-1,v=L?1:-1,S=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===Infinity?(s=isNaN(w)?1:0,o=A):(o=Math.floor(Math.log(w)/Math.LN2),w*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?w+=P/l:w+=P*Math.pow(2,1-y),w*l>=2&&(o++,l/=2),o+y>=A?(s=0,o=A):o+y>=1?(s=(w*l-1)*Math.pow(2,C),o=o+y):(s=w*Math.pow(2,y-1)*Math.pow(2,C),o=0));C>=8;_[x+g]=s&255,g+=v,s/=256,C-=8);for(o=o<0;_[x+g]=o&255,g+=v,o/=256,E-=8);_[x+g-v]|=S*128}},35717:function(Q){typeof Object.create=="function"?Q.exports=function(_,w){w&&(_.super_=w,_.prototype=Object.create(w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:Q.exports=function(_,w){if(w){_.super_=w;var x=function(){};x.prototype=w.prototype,_.prototype=new x,_.prototype.constructor=_}}},5826:function(Q){var Y={}.toString;Q.exports=Array.isArray||function(_){return Y.call(_)=="[object Array]"}},89246:function(Q,Y,_){"use strict";_.d(Y,{l4:function(){return q}});var w=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]0)&&!(m=D.next()).done;)p.push(m.value)}catch(d){B={error:d}}finally{try{m&&!m.done&&(O=D.return)&&O.call(D)}finally{if(B)throw B.error}}return p},L=function(j,G,O){if(O||arguments.length===2)for(var D=0,m=G.length,p;D=j.length&&(j=void 0),{value:j&&j[D++],done:!j}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")};function b(j){var G=this;j===void 0&&(j=[]);var O=0,D=[];this.size=function(){return O},this.empty=function(){return O===0},this.clear=function(){O=0,D.length=0},this.front=function(){if(!this.empty())return D[0]},this.back=function(){if(!this.empty())return D[O-1]},this.forEach=function(m){D.forEach(m)},this.getElementByPos=function(m){if(m<0||m>=O)throw new Error("pos must more than 0 and less than vector's size");return D[m]},this.eraseElementByPos=function(m){if(m<0||m>=O)throw new Error("pos must more than 0 and less than vector's size");for(var p=m;pB;)this.popBack()},this.pushBack=function(m){D.push(m),++O},this.popBack=function(){D.pop(),O>0&&--O},this.setElementByPos=function(m,p){if(m<0||m>=O)throw new Error("pos must more than 0 and less than vector's size");D[m]=p},this.insert=function(m,p,B){if(B===void 0&&(B=1),m<0||m>O)throw new Error("pos must more than 0 and less than or equal to vector's size");D.splice.apply(D,L([m,0],x(new Array(B).fill(p)),!1)),O+=B},this.find=function(m){return D.includes(m)},this.reverse=function(){D.reverse()},this.unique=function(){var m,p=[];this.forEach(function(d,f){(f===0||d!==m)&&(p.push(d),m=d)}),p.forEach(function(d,f){D[f]=d});for(var B=p.length;O>B;)this.popBack()},this.sort=function(m){D.sort(m)},this[Symbol.iterator]=function(){return function(){return w(this,function(m){switch(m.label){case 0:return[5,C(D)];case 1:return[2,m.sent()]}})}()},j.forEach(function(m){return G.pushBack(m)}),Object.freeze(this)}Object.freeze(b);var o=null;function s(j){var G=this;j===void 0&&(j=[]);var O=0,D=[];this.size=function(){return O},this.empty=function(){return O===0},this.clear=function(){O=0,D.length=0},this.push=function(m){D.push(m),++O},this.pop=function(){D.pop(),O>0&&--O},this.top=function(){return D[O-1]},j.forEach(function(m){return G.push(m)}),Object.freeze(this)}Object.freeze(s);var l=null,E=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]=O)throw new Error("pos must more then 0 and less then the list length");for(var B=D;p--&&B;)B=B.next;if(!B||B.value===void 0)throw new Error("unknown error");return B.value},this.eraseElementByPos=function(p){if(p<0||p>=O)throw new Error("erase pos must more then 0 and less then the list length");if(p===0)this.popFront();else if(p===O-1)this.popBack();else{for(var B=D;p--;){if(!(B==null?void 0:B.next))throw new Error("unknown error");B=B.next}if(!B||!B.pre||!B.next)throw new Error("unknown error");var d=B.pre,f=B.next;f.pre=d,d.next=f,O>0&&--O}},this.eraseElementByValue=function(p){for(;D&&D.value===p;)this.popFront();for(;m&&m.value===p;)this.popBack();if(!!D)for(var B=D;B;){if(B.value===p){var d=B.pre,f=B.next;f&&(f.pre=d),d&&(d.next=f),O>0&&--O}B=B.next}},this.pushBack=function(p){if(p==null)throw new Error("you can't push null or undefined here");++O;var B=new A(p);m?(m.next=B,B.pre=m,m=B):D=m=B},this.popBack=function(){!m||(O>0&&--O,!!m&&(D===m?D=m=void 0:(m=m.pre,m&&(m.next=void 0))))},this.setElementByPos=function(p,B){if(B==null)throw new Error("you can't set null or undefined here");if(p<0||p>=O)throw new Error("pos must more then 0 and less then the list length");for(var d=D;p--;){if(!d)throw new Error("unknown error");d=d.next}d&&(d.value=B)},this.insert=function(p,B,d){if(d===void 0&&(d=1),B==null)throw new Error("you can't insert null or undefined here");if(p<0||p>O)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(d<0)throw new Error("insert size must more than 0");if(p===0)for(;d--;)this.pushFront(B);else if(p===O)for(;d--;)this.pushBack(B);else{for(var f=D,h=1;h0&&--O;p.next=B.next,p.next&&(p.next.pre=p),p=p.next}},this.sort=function(p){var B=[];this.forEach(function(f){B.push(f)}),B.sort(p);var d=D;B.forEach(function(f){d&&(d.value=f,d=d.next)})},this.pushFront=function(p){if(p==null)throw new Error("you can't push null or undefined here");++O;var B=new A(p);D?(B.next=D,D.pre=B,D=B):D=m=B},this.popFront=function(){!D||(O>0&&--O,!!D&&(D===m?D=m=void 0:(D=D.next,D&&(D.pre=void 0))))},this.merge=function(p){var B=this,d=D;p.forEach(function(f){for(;d&&d.value!==void 0&&d.value<=f;)d=d.next;if(d===void 0)B.pushBack(f),d=m;else if(d===D)B.pushFront(f),d=D;else{++O;var h=d.pre;h&&(h.next=new A(f),h.next.pre=h,h.next.next=d,d&&(d.pre=h.next))}})},this[Symbol.iterator]=function(){return function(){var p;return E(this,function(B){switch(B.label){case 0:p=D,B.label=1;case 1:if(p===void 0)return[3,3];if(!p.value)throw new Error("unknown error");return[4,p.value];case 2:return B.sent(),p=p.next,[3,1];case 3:return[2]}})}()},j.forEach(function(p){return G.pushBack(p)}),Object.freeze(this)}Object.freeze(y);var P=y;function g(j){j===void 0&&(j=[]);var G=new P(j);this.size=function(){return G.size()},this.empty=function(){return G.empty()},this.clear=function(){G.clear()},this.push=function(O){G.pushBack(O)},this.pop=function(){G.popFront()},this.front=function(){return G.front()},Object.freeze(this)}Object.freeze(g);var v=null,S=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]u)throw new Error("pos should more than 0 and less than queue's size");var a=Math.floor(r/T.bucketSize),i=r%T.bucketSize;return{curNodeBucketIndex:a,curNodePointerIndex:i}};this.getElementByPos=function(M){var t=h(M),r=t.curNodeBucketIndex,u=t.curNodePointerIndex;return O[r][u]},this.eraseElementByPos=function(M){var t=this;if(M<0||M>f)throw new Error("pos should more than 0 and less than queue's size");if(M===0)this.popFront();else if(M===this.size())this.popBack();else{for(var r=[],u=M+1;u0?--B:D0&&--f)},this.setElementByPos=function(M,t){var r=h(M),u=r.curNodeBucketIndex,a=r.curNodePointerIndex;O[u][a]=t},this.insert=function(M,t,r){var u=this;if(r===void 0&&(r=1),M===0)for(;r--;)this.pushFront(t);else if(M===this.size())for(;r--;)this.pushBack(t);else{for(var a=[],i=M;i0?--m:D>0&&(--D,m=T.bucketSize-1)),++f,O[D][m]=M},this.popFront=function(){this.empty()||(this.size()!==1&&(m0&&--f)},this.shrinkToFit=function(){var M=this,t=[];this.forEach(function(i){t.push(i)});var r=t.length;O=[];for(var u=Math.ceil(r/T.bucketSize),a=0;ad?-1:B=D)throw new Error("unknown error");if(d<0||d>=D)throw new Error("unknown error");var f=O[B];O[B]=O[d],O[d]=f},p=function(B){if(B<0||B>=D)throw new Error("unknown error");var d=B*2+1,f=B*2+2;d0&&m(B,d),f0&&m(B,f)};(function(){for(var B=Math.floor((D-1)/2);B>=0;--B)for(var d=B,f=d*2+1;f0&&(M=I),G(O[d],O[M])<=0)break;m(d,M),d=M,f=d*2+1}})(),this.size=function(){return D},this.empty=function(){return D===0},this.clear=function(){D=0,O.length=0},this.push=function(B){if(O.push(B),++D,D!==1)for(var d=D-1;d>0;){var f=Math.floor((d-1)/2);if(G(O[f],B)<=0)break;p(f),d=f}},this.pop=function(){if(!this.empty()){if(this.size()===1){--D;return}var B=O[D-1];--D;for(var d=0;d=this.size())break;var I=f;if(h0&&(I=h),G(O[I],B)>=0)break;O[d]=O[I],d=I}O[d]=B}},this.top=function(){return O[0]},Object.freeze(this)}Object.freeze(N);var H=null,V=function(){function j(G,O){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=G,this.value=O}return j.prototype.rotateLeft=function(){var G=this.parent,O=this.brother,D=this.leftChild,m=this.rightChild;if(!m)throw new Error("unknown error");var p=m.leftChild,B=m.rightChild;return G&&(G.leftChild===this?G.leftChild=m:G.rightChild===this&&(G.rightChild=m)),m.parent=G,m.brother=O,m.leftChild=this,m.rightChild=B,O&&(O.brother=m),this.parent=m,this.brother=B,this.leftChild=D,this.rightChild=p,B&&(B.parent=m,B.brother=this),D&&(D.parent=this,D.brother=p),p&&(p.parent=this,p.brother=D),m},j.prototype.rotateRight=function(){var G=this.parent,O=this.brother,D=this.leftChild;if(!D)throw new Error("unknown error");var m=this.rightChild,p=D.leftChild,B=D.rightChild;return G&&(G.leftChild===this?G.leftChild=D:G.rightChild===this&&(G.rightChild=D)),D.parent=G,D.brother=O,D.leftChild=p,D.rightChild=this,O&&(O.brother=D),p&&(p.parent=D,p.brother=this),this.parent=D,this.brother=p,this.leftChild=B,this.rightChild=m,B&&(B.parent=this,B.brother=m),m&&(m.parent=this,m.brother=B),D},j.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},j.TreeNodeColorType={red:!0,black:!1},j}();Object.freeze(V);var k=V,X=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]=j.length&&(j=void 0),{value:j&&j[D++],done:!j}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")};function ie(j,G){var O=this;j===void 0&&(j=[]),G=G||function(e,c){return ec?1:0};var D=0,m=new k;m.color=k.TreeNodeColorType.black,this.size=function(){return D},this.empty=function(){return D===0},this.clear=function(){D=0,m.key=void 0,m.leftChild=m.rightChild=m.brother=m.parent=void 0,m.color=k.TreeNodeColorType.black};var p=function(e){if(!e||e.key===void 0)throw new Error("unknown error");return e.leftChild?p(e.leftChild):e},B=function(e){if(!e||e.key===void 0)throw new Error("unknown error");return e.rightChild?B(e.rightChild):e};this.front=function(){if(!this.empty()){var e=p(m);return e.key}},this.back=function(){if(!this.empty()){var e=B(m);return e.key}},this.forEach=function(e){var c,R,K=0;try{for(var te=W(this),ae=te.next();!ae.done;ae=te.next()){var he=ae.value;e(he,K++)}}catch(ue){c={error:ue}}finally{try{ae&&!ae.done&&(R=te.return)&&R.call(te)}finally{if(c)throw c.error}}},this.getElementByPos=function(e){var c,R;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var K=0;try{for(var te=W(this),ae=te.next();!ae.done;ae=te.next()){var he=ae.value;if(K===e)return he;++K}}catch(ue){c={error:ue}}finally{try{ae&&!ae.done&&(R=te.return)&&R.call(te)}finally{if(c)throw c.error}}throw new Error("unknown error")};var d=function(e){var c=e.parent;if(!c){if(e===m)return;throw new Error("unknown error")}if(e.color===k.TreeNodeColorType.red){e.color=k.TreeNodeColorType.black;return}var R=e.brother;if(!R)throw new Error("unknown error");if(e===c.leftChild){if(R.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.black,c.color=k.TreeNodeColorType.red;var K=c.rotateLeft();m===c&&(m=K),d(e)}else if(R.color===k.TreeNodeColorType.black)if(R.rightChild&&R.rightChild.color===k.TreeNodeColorType.red){R.color=c.color,c.color=k.TreeNodeColorType.black,R.rightChild&&(R.rightChild.color=k.TreeNodeColorType.black);var K=c.rotateLeft();m===c&&(m=K),e.color=k.TreeNodeColorType.black}else if((!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&R.leftChild&&R.leftChild.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.red,R.leftChild&&(R.leftChild.color=k.TreeNodeColorType.black);var K=R.rotateRight();m===R&&(m=K),d(e)}else(!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&(!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&(R.color=k.TreeNodeColorType.red,d(c))}else if(e===c.rightChild){if(R.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.black,c.color=k.TreeNodeColorType.red;var K=c.rotateRight();m===c&&(m=K),d(e)}else if(R.color===k.TreeNodeColorType.black)if(R.leftChild&&R.leftChild.color===k.TreeNodeColorType.red){R.color=c.color,c.color=k.TreeNodeColorType.black,R.leftChild&&(R.leftChild.color=k.TreeNodeColorType.black);var K=c.rotateRight();m===c&&(m=K),e.color=k.TreeNodeColorType.black}else if((!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&R.rightChild&&R.rightChild.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.red,R.rightChild&&(R.rightChild.color=k.TreeNodeColorType.black);var K=R.rotateLeft();m===R&&(m=K),d(e)}else(!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&(!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&(R.color=k.TreeNodeColorType.red,d(c))}},f=function(e){for(var c=e;c.leftChild||c.rightChild;){if(c.rightChild){c=p(c.rightChild);var R=e.key;e.key=c.key,c.key=R,e=c}if(c.leftChild){c=B(c.leftChild);var R=e.key;e.key=c.key,c.key=R,e=c}}d(c),c&&c.remove(),--D,m.color=k.TreeNodeColorType.black},h=function(e,c){if(!e||e.key===void 0)return!1;var R=h(e.leftChild,c);return R||c(e)?!0:h(e.rightChild,c)};this.eraseElementByPos=function(e){if(e<0||e>=D)throw new Error("pos must more than 0 and less than set's size");var c=0;h(m,function(R){return e===c?(f(R),!0):(++c,!1)})},this.eraseElementByValue=function(e){if(!this.empty()){var c=t(m,e);c===void 0||c.key===void 0||G(c.key,e)!==0||f(c)}};var I=function(e,c){if(!e||e.key===void 0)throw new Error("unknown error");var R=G(c,e.key);return R<0?e.leftChild?I(e.leftChild,c):(e.leftChild=new k,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):R>0?e.rightChild?I(e.rightChild,c):(e.rightChild=new k,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},M=function(e){var c=e.parent;if(!c){if(e===m)return;throw new Error("unknown error")}if(c.color!==k.TreeNodeColorType.black&&c.color===k.TreeNodeColorType.red){var R=c.brother,K=c.parent;if(!K)throw new Error("unknown error");if(R&&R.color===k.TreeNodeColorType.red)R.color=c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red,M(K);else if(!R||R.color===k.TreeNodeColorType.black){if(c===K.leftChild){if(e===c.leftChild){c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red;var te=K.rotateRight();K===m&&(m=te)}else if(e===c.rightChild){var te=c.rotateLeft();K===m&&(m=te),M(c)}}else if(c===K.rightChild){if(e===c.leftChild){var te=c.rotateRight();K===m&&(m=te),M(c)}else if(e===c.rightChild){c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red;var te=K.rotateLeft();K===m&&(m=te)}}}}};this.insert=function(e){if(e==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty()){++D,m.key=e,m.color=k.TreeNodeColorType.black;return}var c=I(m,e);c.key!==void 0&&G(c.key,e)===0||(++D,c.key=e,M(c),m.color=k.TreeNodeColorType.black)};var t=function(e,c){if(!(!e||e.key===void 0)){var R=G(c,e.key);return R<0?t(e.leftChild,c):R>0?t(e.rightChild,c):e}};this.find=function(e){var c=t(m,e);return c!==void 0&&c.key!==void 0&&G(c.key,e)===0};var r=function(e,c){if(!(!e||e.key===void 0)){var R=G(e.key,c);if(R===0)return e.key;if(R<0)return r(e.rightChild,c);var K=r(e.leftChild,c);return K!==void 0?K:e.key}};this.lowerBound=function(e){return r(m,e)};var u=function(e,c){if(!(!e||e.key===void 0)){var R=G(e.key,c);if(R<=0)return u(e.rightChild,c);var K=u(e.leftChild,c);return K!==void 0?K:e.key}};this.upperBound=function(e){return u(m,e)};var a=function(e,c){if(!(!e||e.key===void 0)){var R=G(e.key,c);if(R===0)return e.key;if(R>0)return a(e.leftChild,c);var K=a(e.rightChild,c);return K!==void 0?K:e.key}};this.reverseLowerBound=function(e){return a(m,e)};var i=function(e,c){if(!(!e||e.key===void 0)){var R=G(e.key,c);if(R>=0)return i(e.leftChild,c);var K=i(e.rightChild,c);return K!==void 0?K:e.key}};this.reverseUpperBound=function(e){return i(m,e)},this.union=function(e){var c=this;e.forEach(function(R){return c.insert(R)})},this.getHeight=function(){if(this.empty())return 0;var e=function(c){return c?Math.max(e(c.leftChild),e(c.rightChild))+1:1};return e(m)};var n=function(e){return X(this,function(c){switch(c.label){case 0:return!e||e.key===void 0?[2]:[5,W(n(e.leftChild))];case 1:return c.sent(),[4,e.key];case 2:return c.sent(),[5,W(n(e.rightChild))];case 3:return c.sent(),[2]}})};this[Symbol.iterator]=function(){return n(m)},j.forEach(function(e){return O.insert(e)}),Object.freeze(this)}Object.freeze(ie);var q=ie,le=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]=j.length&&(j=void 0),{value:j&&j[D++],done:!j}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")};function J(j,G){var O=this;j===void 0&&(j=[]),G=G||function(e,c){return ec?1:0};var D=0,m=new k;m.color=k.TreeNodeColorType.black,this.size=function(){return D},this.empty=function(){return D===0},this.clear=function(){D=0,m.key=m.value=void 0,m.leftChild=m.rightChild=m.brother=void 0};var p=function(e){if(!e||e.key===void 0)throw new Error("unknown error");return e.leftChild?p(e.leftChild):e},B=function(e){if(!e||e.key===void 0)throw new Error("unknown error");return e.rightChild?B(e.rightChild):e};this.front=function(){if(!this.empty()){var e=p(m);if(e.key===void 0||e.value===void 0)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.back=function(){if(!this.empty()){var e=B(m);if(e.key===void 0||e.value===void 0)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.forEach=function(e){var c,R,K=0;try{for(var te=ne(this),ae=te.next();!ae.done;ae=te.next()){var he=ae.value;e(he,K++)}}catch(ue){c={error:ue}}finally{try{ae&&!ae.done&&(R=te.return)&&R.call(te)}finally{if(c)throw c.error}}},this.getElementByPos=function(e){var c,R;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var K=0;try{for(var te=ne(this),ae=te.next();!ae.done;ae=te.next()){var he=ae.value;if(K===e)return he;++K}}catch(ue){c={error:ue}}finally{try{ae&&!ae.done&&(R=te.return)&&R.call(te)}finally{if(c)throw c.error}}throw new Error("unknown Error")};var d=function(e,c){if(!(!e||e.key===void 0||e.value===void 0)){var R=G(e.key,c);return R===0?{key:e.key,value:e.value}:R<0?d(e.rightChild,c):d(e.leftChild,c)||{key:e.key,value:e.value}}};this.lowerBound=function(e){return d(m,e)};var f=function(e,c){if(!(!e||e.key===void 0||e.value===void 0)){var R=G(e.key,c);return R<=0?f(e.rightChild,c):f(e.leftChild,c)||{key:e.key,value:e.value}}};this.upperBound=function(e){return f(m,e)};var h=function(e,c){if(!(!e||e.key===void 0||e.value===void 0)){var R=G(e.key,c);return R===0?{key:e.key,value:e.value}:R>0?h(e.leftChild,c):h(e.rightChild,c)||{key:e.key,value:e.value}}};this.reverseLowerBound=function(e){return h(m,e)};var I=function(e,c){if(!(!e||e.key===void 0||e.value===void 0)){var R=G(e.key,c);return R>=0?I(e.leftChild,c):I(e.rightChild,c)||{key:e.key,value:e.value}}};this.reverseUpperBound=function(e){return I(m,e)};var M=function(e){var c=e.parent;if(!c){if(e===m)return;throw new Error("unknown error")}if(e.color===k.TreeNodeColorType.red){e.color=k.TreeNodeColorType.black;return}var R=e.brother;if(!R)throw new Error("unknown error");if(e===c.leftChild){if(R.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.black,c.color=k.TreeNodeColorType.red;var K=c.rotateLeft();m===c&&(m=K),M(e)}else if(R.color===k.TreeNodeColorType.black)if(R.rightChild&&R.rightChild.color===k.TreeNodeColorType.red){R.color=c.color,c.color=k.TreeNodeColorType.black,R.rightChild&&(R.rightChild.color=k.TreeNodeColorType.black);var K=c.rotateLeft();m===c&&(m=K),e.color=k.TreeNodeColorType.black}else if((!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&R.leftChild&&R.leftChild.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.red,R.leftChild&&(R.leftChild.color=k.TreeNodeColorType.black);var K=R.rotateRight();m===R&&(m=K),M(e)}else(!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&(!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&(R.color=k.TreeNodeColorType.red,M(c))}else if(e===c.rightChild){if(R.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.black,c.color=k.TreeNodeColorType.red;var K=c.rotateRight();m===c&&(m=K),M(e)}else if(R.color===k.TreeNodeColorType.black)if(R.leftChild&&R.leftChild.color===k.TreeNodeColorType.red){R.color=c.color,c.color=k.TreeNodeColorType.black,R.leftChild&&(R.leftChild.color=k.TreeNodeColorType.black);var K=c.rotateRight();m===c&&(m=K),e.color=k.TreeNodeColorType.black}else if((!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&R.rightChild&&R.rightChild.color===k.TreeNodeColorType.red){R.color=k.TreeNodeColorType.red,R.rightChild&&(R.rightChild.color=k.TreeNodeColorType.black);var K=R.rotateLeft();m===R&&(m=K),M(e)}else(!R.leftChild||R.leftChild.color===k.TreeNodeColorType.black)&&(!R.rightChild||R.rightChild.color===k.TreeNodeColorType.black)&&(R.color=k.TreeNodeColorType.red,M(c))}},t=function(e){for(var c=e;c.leftChild||c.rightChild;){if(c.rightChild){c=p(c.rightChild);var R=e.key;e.key=c.key,c.key=R;var K=e.value;e.value=c.value,c.value=K,e=c}if(c.leftChild){c=B(c.leftChild);var R=e.key;e.key=c.key,c.key=R;var K=e.value;e.value=c.value,c.value=K,e=c}}M(c),c&&c.remove(),--D,m.color=k.TreeNodeColorType.black},r=function(e,c){if(!e||e.key===void 0)return!1;var R=r(e.leftChild,c);return R||c(e)?!0:r(e.rightChild,c)};this.eraseElementByPos=function(e){if(e<0||e>=D)throw new Error("pos must more than 0 and less than set's size");var c=0;r(m,function(R){return e===c?(t(R),!0):(++c,!1)})},this.eraseElementByKey=function(e){if(!this.empty()){var c=i(m,e);c===void 0||c.key===void 0||G(c.key,e)!==0||t(c)}};var u=function(e,c){if(!e||e.key===void 0)throw new Error("unknown error");var R=G(c,e.key);return R<0?e.leftChild?u(e.leftChild,c):(e.leftChild=new k,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):R>0?e.rightChild?u(e.rightChild,c):(e.rightChild=new k,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},a=function(e){var c=e.parent;if(!c){if(e===m)return;throw new Error("unknown error")}if(c.color!==k.TreeNodeColorType.black&&c.color===k.TreeNodeColorType.red){var R=c.brother,K=c.parent;if(!K)throw new Error("unknown error");if(R&&R.color===k.TreeNodeColorType.red)R.color=c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red,a(K);else if(!R||R.color===k.TreeNodeColorType.black){if(c===K.leftChild){if(e===c.leftChild){c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red;var te=K.rotateRight();K===m&&(m=te)}else if(e===c.rightChild){var te=c.rotateLeft();K===m&&(m=te),a(c)}}else if(c===K.rightChild){if(e===c.leftChild){var te=c.rotateRight();K===m&&(m=te),a(c)}else if(e===c.rightChild){c.color=k.TreeNodeColorType.black,K.color=k.TreeNodeColorType.red;var te=K.rotateLeft();K===m&&(m=te)}}}}};this.setElement=function(e,c){if(e==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(c==null){this.eraseElementByKey(e);return}if(this.empty()){++D,m.key=e,m.value=c,m.color=k.TreeNodeColorType.black;return}var R=u(m,e);if(R.key!==void 0&&G(R.key,e)===0){R.value=c;return}++D,R.key=e,R.value=c,a(R),m.color=k.TreeNodeColorType.black};var i=function(e,c){if(!(!e||e.key===void 0)){var R=G(c,e.key);return R<0?i(e.leftChild,c):R>0?i(e.rightChild,c):e}};this.find=function(e){return!!i(m,e)},this.getElementByKey=function(e){var c=i(m,e);if((c==null?void 0:c.key)===void 0||(c==null?void 0:c.value)===void 0)throw new Error("unknown error");return c.value},this.union=function(e){var c=this;e.forEach(function(R){var K=R.key,te=R.value;return c.setElement(K,te)})},this.getHeight=function(){if(this.empty())return 0;var e=function(c){return c?Math.max(e(c.leftChild),e(c.rightChild))+1:1};return e(m)};var n=function(e){return le(this,function(c){switch(c.label){case 0:return!e||e.key===void 0||e.value===void 0?[2]:[5,ne(n(e.leftChild))];case 1:return c.sent(),[4,{key:e.key,value:e.value}];case 2:return c.sent(),[5,ne(n(e.rightChild))];case 3:return c.sent(),[2]}})};this[Symbol.iterator]=function(){return n(m)},j.forEach(function(e){var c=e.key,R=e.value;return O.setElement(c,R)}),Object.freeze(this)}Object.freeze(J);var z=J,F=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]=j.length&&(j=void 0),{value:j&&j[D++],done:!j}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")};Z.initSize=1<<4,Z.maxSize=1<<30,Z.sigma=.75,Z.treeifyThreshold=8,Z.untreeifyThreshold=6,Z.minTreeifySize=64;function Z(j,G,O){var D=this;if(j===void 0&&(j=[]),G===void 0&&(G=Z.initSize),O=O||function(f){var h=0,I="";if(typeof f=="number")h=Math.floor(f),h=(h<<5)-h,h=h&h;else{typeof f!="string"?I=JSON.stringify(f):I=f;for(var M=0;M>>16,h},(G&G-1)!=0)throw new Error("initBucketNum must be 2 to the power of n");var m=0,p=[],B=Math.max(Z.initSize,Math.min(Z.maxSize,G));this.size=function(){return m},this.empty=function(){return m===0},this.clear=function(){m=0,B=G,p=[]},this.forEach=function(f){var h=0;p.forEach(function(I){I.forEach(function(M){f(M,h++)})})};var d=function(f){if(!(f>=Z.maxSize)){B=f*2;var h=[];p.forEach(function(I,M){if(!I.empty()){if(I instanceof P&&I.size()===1){var t=I.front();if(t===void 0)throw new Error("unknown error");h[O(t)&B-1]=new P([t])}else if(I instanceof q){var r=new P,u=new P;I.forEach(function(n){var e=O(n);(e&f)==0?r.pushBack(n):u.pushBack(n)}),r.size()>Z.untreeifyThreshold?h[M]=new q(r):r.size()&&(h[M]=r),u.size()>Z.untreeifyThreshold?h[M+f]=new q(u):u.size()&&(h[M+f]=u)}else{var a=new P,i=new P;I.forEach(function(n){var e=O(n);(e&f)==0?a.pushBack(n):i.pushBack(n)}),a.size()&&(h[M]=a),i.size()&&(h[M+f]=i)}p[M].clear()}}),p=h}};this.insert=function(f){if(f==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var h=O(f)&B-1;if(!p[h])p[h]=new P([f]),++m;else{var I=p[h].size();if(p[h]instanceof P){if(p[h].find(f))return;p[h].pushBack(f),p[h].size()>=Z.treeifyThreshold&&(p[h]=new q(p[h]))}else p[h].insert(f);var M=p[h].size();m+=M-I}m>B*Z.sigma&&d.call(this,B)},this.eraseElementByValue=function(f){var h=O(f)&B-1;if(!!p[h]){var I=p[h].size();p[h].eraseElementByValue(f),p[h]instanceof q&&p[h].size()<=Z.untreeifyThreshold&&(p[h]=new P(p[h]));var M=p[h].size();m+=M-I}},this.find=function(f){var h=O(f)&B-1;return p[h]?p[h].find(f):!1},this[Symbol.iterator]=function(){return function(){var f,h,I,M,t,r,u;return F(this,function(a){switch(a.label){case 0:f=0,a.label=1;case 1:if(!(f=B)return[3,10];a.label=2;case 2:a.trys.push([2,7,8,9]),h=(r=void 0,ee(p[f])),I=h.next(),a.label=3;case 3:return I.done?[3,6]:(M=I.value,[4,M]);case 4:a.sent(),a.label=5;case 5:return I=h.next(),[3,3];case 6:return[3,9];case 7:return t=a.sent(),r={error:t},[3,9];case 8:try{I&&!I.done&&(u=h.return)&&u.call(h)}finally{if(r)throw r.error}return[7];case 9:return++f,[3,1];case 10:return[2]}})}()},j.forEach(function(f){return D.insert(f)}),Object.freeze(this)}Object.freeze(Z);var fe=null,se=function(j,G){var O={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},D,m,p,B;return B={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function d(h){return function(I){return f([h,I])}}function f(h){if(D)throw new TypeError("Generator is already executing.");for(;O;)try{if(D=1,m&&(p=h[0]&2?m.return:h[0]?m.throw||((p=m.return)&&p.call(m),0):m.next)&&!(p=p.call(m,h[1])).done)return p;switch(m=0,p&&(h=[h[0]&2,p.value]),h[0]){case 0:case 1:p=h;break;case 4:return O.label++,{value:h[1],done:!1};case 5:O.label++,m=h[1],h=[0];continue;case 7:h=O.ops.pop(),O.trys.pop();continue;default:if(p=O.trys,!(p=p.length>0&&p[p.length-1])&&(h[0]===6||h[0]===2)){O=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]=j.length&&(j=void 0),{value:j&&j[D++],done:!j}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")};$.initSize=1<<4,$.maxSize=1<<30,$.sigma=.75,$.treeifyThreshold=8,$.untreeifyThreshold=6,$.minTreeifySize=64;function $(j,G,O){var D=this;if(j===void 0&&(j=[]),G===void 0&&(G=$.initSize),O=O||function(f){var h,I,M=0,t="";if(typeof f=="number")M=Math.floor(f),M=(M<<5)-M,M=M&M;else{typeof f!="string"?t=JSON.stringify(f):t=f;try{for(var r=oe(t),u=r.next();!u.done;u=r.next()){var a=u.value,i=a.charCodeAt(0);M=(M<<5)-M+i,M=M&M}}catch(n){h={error:n}}finally{try{u&&!u.done&&(I=r.return)&&I.call(r)}finally{if(h)throw h.error}}}return M^=M>>>16,M},(G&G-1)!=0)throw new Error("initBucketNum must be 2 to the power of n");var m=0,p=[],B=Math.max($.initSize,Math.min($.maxSize,G));this.size=function(){return m},this.empty=function(){return m===0},this.clear=function(){m=0,B=G,p=[]},this.forEach=function(f){var h=0;p.forEach(function(I){I.forEach(function(M){f(M,h++)})})};var d=function(f){if(!(f>=$.maxSize)){B=f*2;var h=[];p.forEach(function(I,M){if(!I.empty()){if(I instanceof P&&I.size()===1){var t=I.front(),r=t.key,u=t.value;h[O(r)&B-1]=new P([{key:r,value:u}])}else if(I instanceof z){var a=new P,i=new P;I.forEach(function(c){var R=O(c.key);(R&f)==0?a.pushBack(c):i.pushBack(c)}),a.size()>$.untreeifyThreshold?h[M]=new z(a):a.size()&&(h[M]=a),i.size()>$.untreeifyThreshold?h[M+f]=new z(i):i.size()&&(h[M+f]=i)}else{var n=new P,e=new P;I.forEach(function(c){var R=O(c.key);(R&f)==0?n.pushBack(c):e.pushBack(c)}),n.size()&&(h[M]=n),e.size()&&(h[M+f]=e)}p[M].clear()}}),p=h}};this.setElement=function(f,h){var I,M;if(f==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(h==null){this.eraseElementByKey(f);return}var t=O(f)&B-1;if(!p[t])++m,p[t]=new P([{key:f,value:h}]);else{var r=p[t].size();if(p[t]instanceof P){try{for(var u=oe(p[t]),a=u.next();!a.done;a=u.next()){var i=a.value;if(i.key===f){i.value=h;return}}}catch(e){I={error:e}}finally{try{a&&!a.done&&(M=u.return)&&M.call(u)}finally{if(I)throw I.error}}p[t].pushBack({key:f,value:h}),p[t].size()>=$.treeifyThreshold&&(p[t]=new z(p[t]))}else p[t].setElement(f,h);var n=p[t].size();m+=n-r}m>B*$.sigma&&d.call(this,B)},this.getElementByKey=function(f){var h,I,M=O(f)&B-1;if(!!p[M]){if(p[M]instanceof z)return p[M].getElementByKey(f);try{for(var t=oe(p[M]),r=t.next();!r.done;r=t.next()){var u=r.value;if(u.key===f)return u.value}}catch(a){h={error:a}}finally{try{r&&!r.done&&(I=t.return)&&I.call(t)}finally{if(h)throw h.error}}}},this.eraseElementByKey=function(f){var h,I,M=O(f)&B-1;if(!!p[M]){var t=p[M].size();if(p[M]instanceof z)p[M].eraseElementByKey(f),p[M].size()<=$.untreeifyThreshold&&(p[M]=new P(p[M]));else{var r=-1;try{for(var u=oe(p[M]),a=u.next();!a.done;a=u.next()){var i=a.value;if(++r,i.key===f){p[M].eraseElementByPos(r);break}}}catch(e){h={error:e}}finally{try{a&&!a.done&&(I=u.return)&&I.call(u)}finally{if(h)throw h.error}}}var n=p[M].size();m+=n-t}},this.find=function(f){var h,I,M=O(f)&B-1;if(!p[M])return!1;if(p[M]instanceof z)return p[M].find(f);try{for(var t=oe(p[M]),r=t.next();!r.done;r=t.next()){var u=r.value;if(u.key===f)return!0}}catch(a){h={error:a}}finally{try{r&&!r.done&&(I=t.return)&&I.call(t)}finally{if(h)throw h.error}}return!1},this[Symbol.iterator]=function(){return function(){var f,h,I,M,t,r,u;return se(this,function(a){switch(a.label){case 0:f=0,a.label=1;case 1:if(!(f=B)return[3,10];a.label=2;case 2:a.trys.push([2,7,8,9]),h=(r=void 0,oe(p[f])),I=h.next(),a.label=3;case 3:return I.done?[3,6]:(M=I.value,[4,M]);case 4:a.sent(),a.label=5;case 5:return I=h.next(),[3,3];case 6:return[3,9];case 7:return t=a.sent(),r={error:t},[3,9];case 8:try{I&&!I.done&&(u=h.return)&&u.call(h)}finally{if(r)throw r.error}return[7];case 9:return++f,[3,1];case 10:return[2]}})}()},j.forEach(function(f){var h=f.key,I=f.value;return D.setElement(h,I)}),Object.freeze(this)}Object.freeze($);var re=null},9990:function(Q,Y,_){var w=_(48764).Buffer;const x=Q.exports;x.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"},x.codes={};for(const C in x.types){const b=x.types[C];x.codes[b]=C}x.CMD_SHIFT=4,x.CMD_MASK=240,x.DUP_MASK=8,x.QOS_MASK=3,x.QOS_SHIFT=1,x.RETAIN_MASK=1,x.VARBYTEINT_MASK=127,x.VARBYTEINT_FIN_MASK=128,x.VARBYTEINT_MAX=268435455,x.SESSIONPRESENT_MASK=1,x.SESSIONPRESENT_HEADER=w.from([x.SESSIONPRESENT_MASK]),x.CONNACK_HEADER=w.from([x.codes.connack<[0,1].map(o=>[0,1].map(s=>{const l=w.alloc(1);return l.writeUInt8(x.codes[C]<w.from([C])),x.EMPTY={pingreq:w.from([x.codes.pingreq<<4,0]),pingresp:w.from([x.codes.pingresp<<4,0]),disconnect:w.from([x.codes.disconnect<<4,0])}},27721:function(Q,Y,_){var w=_(48764).Buffer;const x=_(19371),L=_(17187);function C(o,s){const l=new b;return x(o,l,s),l.concat()}class b extends L{constructor(){super();this._array=new Array(20),this._i=0}write(s){return this._array[this._i++]=s,!0}concat(){let s=0;const l=new Array(this._array.length),E=this._array;let A=0,y;for(y=0;y>8,0),A.writeUInt8(E&255,0+1),A}function o(){for(let E=0;E0&&(y=y|128),g.writeUInt8(y,P++);while(E>0&&P0&&(P=0),C?g.subarray(0,P):g.slice(0,P)}function l(E){const A=w.allocUnsafe(4);return A.writeUInt32BE(E,0),A}Q.exports={cache:L,generateCache:o,generateNumber:b,genBufVariableByteInt:s,generate4ByteBuffer:l}},89695:function(Q){class Y{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}Q.exports=Y},84575:function(Q,Y,_){const w=_(10022),x=_(17187),L=_(89695),C=_(9990),b=_(13129)("mqtt-packet:parser");class o extends x{constructor(){super();this.parser=this.constructor.parser}static parser(l){return this instanceof o?(this.settings=l||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new o().parser(l)}_resetState(){b("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new L,this.error=null,this._list=w(),this._stateCounter=0}parse(l){for(this.error&&this._resetState(),this._list.append(l),b("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,b("parse: state complete. _stateCounter is now: %d",this._stateCounter),b("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return b("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const l=this._list.readUInt8(0);return this.packet.cmd=C.types[l>>C.CMD_SHIFT],this.packet.retain=(l&C.RETAIN_MASK)!=0,this.packet.qos=l>>C.QOS_SHIFT&C.QOS_MASK,this.packet.dup=(l&C.DUP_MASK)!=0,b("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const l=this._parseVarByteNum(!0);return l&&(this.packet.length=l.value,this._list.consume(l.bytes)),b("_parseLength %d",l.value),!!l}_parsePayload(){b("_parsePayload: payload %O",this._list);let l=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}l=!0}return b("_parsePayload complete result: %s",l),l}_parseConnect(){b("_parseConnect");let l,E,A,y;const P={},g=this.packet,v=this._parseString();if(v===null)return this._emitError(new Error("Cannot parse protocolId"));if(v!=="MQTT"&&v!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(g.protocolId=v,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(g.protocolVersion=this._list.readUInt8(this._pos),g.protocolVersion>=128&&(g.bridgeMode=!0,g.protocolVersion=g.protocolVersion-128),g.protocolVersion!==3&&g.protocolVersion!==4&&g.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(P.username=this._list.readUInt8(this._pos)&C.USERNAME_MASK,P.password=this._list.readUInt8(this._pos)&C.PASSWORD_MASK,P.will=this._list.readUInt8(this._pos)&C.WILL_FLAG_MASK,P.will&&(g.will={},g.will.retain=(this._list.readUInt8(this._pos)&C.WILL_RETAIN_MASK)!=0,g.will.qos=(this._list.readUInt8(this._pos)&C.WILL_QOS_MASK)>>C.WILL_QOS_SHIFT),g.clean=(this._list.readUInt8(this._pos)&C.CLEAN_SESSION_MASK)!=0,this._pos++,g.keepalive=this._parseNum(),g.keepalive===-1)return this._emitError(new Error("Packet too short"));if(g.protocolVersion===5){const T=this._parseProperties();Object.getOwnPropertyNames(T).length&&(g.properties=T)}const S=this._parseString();if(S===null)return this._emitError(new Error("Packet too short"));if(g.clientId=S,b("_parseConnect: packet.clientId: %s",g.clientId),P.will){if(g.protocolVersion===5){const T=this._parseProperties();Object.getOwnPropertyNames(T).length&&(g.will.properties=T)}if(l=this._parseString(),l===null)return this._emitError(new Error("Cannot parse will topic"));if(g.will.topic=l,b("_parseConnect: packet.will.topic: %s",g.will.topic),E=this._parseBuffer(),E===null)return this._emitError(new Error("Cannot parse will payload"));g.will.payload=E,b("_parseConnect: packet.will.paylaod: %s",g.will.payload)}if(P.username){if(y=this._parseString(),y===null)return this._emitError(new Error("Cannot parse username"));g.username=y,b("_parseConnect: packet.username: %s",g.username)}if(P.password){if(A=this._parseBuffer(),A===null)return this._emitError(new Error("Cannot parse password"));g.password=A}return this.settings=g,b("_parseConnect: complete"),g}_parseConnack(){b("_parseConnack");const l=this.packet;if(this._list.length<1)return null;if(l.sessionPresent=!!(this._list.readUInt8(this._pos++)&C.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?l.reasonCode=this._list.readUInt8(this._pos++):l.reasonCode=0;else{if(this._list.length<2)return null;l.returnCode=this._list.readUInt8(this._pos++)}if(l.returnCode===-1||l.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(l.properties=E)}b("_parseConnack: complete")}_parsePublish(){b("_parsePublish");const l=this.packet;if(l.topic=this._parseString(),l.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(l.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(l.properties=E)}l.payload=this._list.slice(this._pos,l.length),b("_parsePublish: payload from buffer list: %o",l.payload)}}_parseSubscribe(){b("_parseSubscribe");const l=this.packet;let E,A,y,P,g,v,S;if(l.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(l.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const T=this._parseProperties();Object.getOwnPropertyNames(T).length&&(l.properties=T)}for(;this._pos=l.length)return this._emitError(new Error("Malformed Subscribe Payload"));A=this._parseByte(),y=A&C.SUBSCRIBE_OPTIONS_QOS_MASK,v=(A>>C.SUBSCRIBE_OPTIONS_NL_SHIFT&C.SUBSCRIBE_OPTIONS_NL_MASK)!=0,g=(A>>C.SUBSCRIBE_OPTIONS_RAP_SHIFT&C.SUBSCRIBE_OPTIONS_RAP_MASK)!=0,P=A>>C.SUBSCRIBE_OPTIONS_RH_SHIFT&C.SUBSCRIBE_OPTIONS_RH_MASK,S={topic:E,qos:y},this.settings.protocolVersion===5?(S.nl=v,S.rap=g,S.rh=P):this.settings.bridgeMode&&(S.rh=0,S.rap=!0,S.nl=!0),b("_parseSubscribe: push subscription `%s` to subscription",S),l.subscriptions.push(S)}}}_parseSuback(){b("_parseSuback");const l=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(l.properties=E)}for(;this._pos2?(l.reasonCode=this._parseByte(),b("_parseConfirmation: packet.reasonCode `%d`",l.reasonCode)):l.reasonCode=0,l.length>3)){const E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(l.properties=E)}return!0}_parseDisconnect(){const l=this.packet;if(b("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?l.reasonCode=this._parseByte():l.reasonCode=0;const E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(l.properties=E)}return b("_parseDisconnect result: true"),!0}_parseAuth(){b("_parseAuth");const l=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));l.reasonCode=this._parseByte();const E=this._parseProperties();return Object.getOwnPropertyNames(E).length&&(l.properties=E),b("_parseAuth: result: true"),!0}_parseMessageId(){const l=this.packet;return l.messageId=this._parseNum(),l.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(b("_parseMessageId: packet.messageId %d",l.messageId),!0)}_parseString(l){const E=this._parseNum(),A=E+this._pos;if(E===-1||A>this._list.length||A>this.packet.length)return null;const y=this._list.toString("utf8",this._pos,A);return this._pos+=E,b("_parseString: result: %s",y),y}_parseStringPair(){return b("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const l=this._parseNum(),E=l+this._pos;if(l===-1||E>this._list.length||E>this.packet.length)return null;const A=this._list.slice(this._pos,E);return this._pos+=l,b("_parseBuffer: result: %o",A),A}_parseNum(){if(this._list.length-this._pos<2)return-1;const l=this._list.readUInt16BE(this._pos);return this._pos+=2,b("_parseNum: result: %s",l),l}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const l=this._list.readUInt32BE(this._pos);return this._pos+=4,b("_parse4ByteNum: result: %s",l),l}_parseVarByteNum(l){b("_parseVarByteNum");const E=4;let A=0,y=1,P=0,g=!1,v;const S=this._pos?this._pos:0;for(;A=A&&this._emitError(new Error("Invalid variable byte integer")),S&&(this._pos+=A),g=g?l?{bytes:A,value:P}:P:!1,b("_parseVarByteNum: result: %o",g),g}_parseByte(){let l;return this._pos=4)&&(r||M))n+=w.byteLength(r)+2;else{if(h<4)return p.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(M*1==0)return p.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof t!="number"||t<0||t>65535||t%1!=0)return p.emit("error",new Error("Invalid keepalive")),!1;if(n+=2,n+=1,h===5){var e=$(p,i);if(!e)return!1;n+=e.length}if(I){if(typeof I!="object")return p.emit("error",new Error("Invalid will")),!1;if(!I.topic||typeof I.topic!="string")return p.emit("error",new Error("Invalid will topic")),!1;if(n+=w.byteLength(I.topic)+2,n+=2,I.payload)if(I.payload.length>=0)typeof I.payload=="string"?n+=w.byteLength(I.payload):n+=I.payload.length;else return p.emit("error",new Error("Invalid will payload")),!1;var c={};if(h===5){if(c=$(p,I.properties),!c)return!1;n+=c.length}}let R=!1;if(u!=null)if(D(u))R=!0,n+=w.byteLength(u)+2;else return p.emit("error",new Error("Invalid username")),!1;if(a!=null){if(!R)return p.emit("error",new Error("Username is required to use password")),!1;if(D(a))n+=O(a)+2;else return p.emit("error",new Error("Invalid password")),!1}p.write(x.CONNECT_HEADER),z(p,n),oe(p,f),d.bridgeMode&&(h+=128),p.write(h===131?x.VERSION131:h===132?x.VERSION132:h===4?x.VERSION4:h===5?x.VERSION5:x.VERSION3);let K=0;return K|=u!=null?x.USERNAME_MASK:0,K|=a!=null?x.PASSWORD_MASK:0,K|=I&&I.retain?x.WILL_RETAIN_MASK:0,K|=I&&I.qos?I.qos<0&&g(p,r),i!=null&&i.write(),s("publish: payload: %o",t),p.write(t)}function V(m,p,B){const d=B?B.protocolVersion:4,f=m||{},h=f.cmd||"puback",I=f.messageId,M=f.dup&&h==="pubrel"?x.DUP_MASK:0;let t=0;const r=f.reasonCode,u=f.properties;let a=d===5?3:2;if(h==="pubrel"&&(t=1),typeof I!="number")return p.emit("error",new Error("Invalid messageId")),!1;let i=null;if(d===5&&typeof u=="object"){if(i=re(p,u,B,a),!i)return!1;a+=i.length}return p.write(x.ACKS[h][t][M][0]),z(p,a),g(p,I),d===5&&p.write(w.from([r])),i!==null&&i.write(),!0}function k(m,p,B){s("subscribe: packet: ");const d=B?B.protocolVersion:4,f=m||{},h=f.dup?x.DUP_MASK:0,I=f.messageId,M=f.subscriptions,t=f.properties;let r=0;if(typeof I!="number")return p.emit("error",new Error("Invalid messageId")),!1;r+=2;let u=null;if(d===5){if(u=$(p,t),!u)return!1;r+=u.length}if(typeof M=="object"&&M.length)for(let i=0;i2)return p.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}r+=w.byteLength(n)+2+1}else return p.emit("error",new Error("Invalid subscriptions")),!1;s("subscribe: writing to stream: %o",x.SUBSCRIBE_HEADER),p.write(x.SUBSCRIBE_HEADER[1][h?1:0][0]),z(p,r),g(p,I),u!==null&&u.write();let a=!0;for(const i of M){const n=i.topic,e=i.qos,c=+i.nl,R=+i.rap,K=i.rh;let te;F(p,n),te=x.SUBSCRIBE_OPTIONS_QOS[e],d===5&&(te|=c?x.SUBSCRIBE_OPTIONS_NL:0,te|=R?x.SUBSCRIBE_OPTIONS_RAP:0,te|=K?x.SUBSCRIBE_OPTIONS_RH[K]:0),a=p.write(w.from([te]))}return a}function X(m,p,B){const d=B?B.protocolVersion:4,f=m||{},h=f.messageId,I=f.granted,M=f.properties;let t=0;if(typeof h!="number")return p.emit("error",new Error("Invalid messageId")),!1;if(t+=2,typeof I=="object"&&I.length)for(let u=0;ux.VARBYTEINT_MAX)return m.emit("error",new Error(`Invalid variable byte integer: ${p}`)),!1;let B=J[p];return B||(B=y(p),p<16384&&(J[p]=B)),s("writeVarByteInt: writing to stream: %o",B),m.write(B)}function F(m,p){const B=w.byteLength(p);return g(m,B),s("writeString: %s",p),m.write(p,"utf8")}function ee(m,p,B){F(m,p),F(m,B)}function Z(m,p){return s("writeNumberCached: number: %d",p),s("writeNumberCached: %o",l[p]),m.write(l[p])}function fe(m,p){const B=E(p);return s("writeNumberGenerated: %o",B),m.write(B)}function se(m,p){const B=P(p);return s("write4ByteNumber: %o",B),m.write(B)}function oe(m,p){typeof p=="string"?F(m,p):p?(g(m,p.length),m.write(p)):g(m,0)}function $(m,p){if(typeof p!="object"||p.length!=null)return{length:1,write(){G(m,{},0)}};let B=0;function d(h,I){const M=x.propertiesTypes[h];let t=0;switch(M){case"byte":{if(typeof I!="boolean")return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+1;break}case"int8":{if(typeof I!="number"||I<0||I>255)return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+1;break}case"binary":{if(I&&I===null)return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+w.byteLength(I)+2;break}case"int16":{if(typeof I!="number"||I<0||I>65535)return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+2;break}case"int32":{if(typeof I!="number"||I<0||I>4294967295)return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+4;break}case"var":{if(typeof I!="number"||I<0||I>268435455)return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+w.byteLength(y(I));break}case"string":{if(typeof I!="string")return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=1+2+w.byteLength(I.toString());break}case"pair":{if(typeof I!="object")return m.emit("error",new Error(`Invalid ${h}: ${I}`)),!1;t+=Object.getOwnPropertyNames(I).reduce((r,u)=>{const a=I[u];return Array.isArray(a)?r+=a.reduce((i,n)=>(i+=1+2+w.byteLength(u.toString())+2+w.byteLength(n.toString()),i),0):r+=1+2+w.byteLength(u.toString())+2+w.byteLength(I[u].toString()),r},0);break}default:return m.emit("error",new Error(`Invalid property ${h}: ${I}`)),!1}return t}if(p)for(const h in p){let I=0,M=0;const t=p[h];if(Array.isArray(t))for(let r=0;rh;){const M=f.shift();if(M&&p[M])delete p[M],I=$(m,p);else return!1}return I}function j(m,p,B){switch(x.propertiesTypes[p]){case"byte":{m.write(w.from([x.properties[p]])),m.write(w.from([+B]));break}case"int8":{m.write(w.from([x.properties[p]])),m.write(w.from([B]));break}case"binary":{m.write(w.from([x.properties[p]])),oe(m,B);break}case"int16":{m.write(w.from([x.properties[p]])),g(m,B);break}case"int32":{m.write(w.from([x.properties[p]])),se(m,B);break}case"var":{m.write(w.from([x.properties[p]])),z(m,B);break}case"string":{m.write(w.from([x.properties[p]])),F(m,B);break}case"pair":{Object.getOwnPropertyNames(B).forEach(f=>{const h=B[f];Array.isArray(h)?h.forEach(I=>{m.write(w.from([x.properties[p]])),ee(m,f.toString(),I.toString())}):(m.write(w.from([x.properties[p]])),ee(m,f.toString(),h.toString()))});break}default:return m.emit("error",new Error(`Invalid property ${p} value: ${B}`)),!1}}function G(m,p,B){z(m,B);for(const d in p)if(Object.prototype.hasOwnProperty.call(p,d)&&p[d]!==null){const f=p[d];if(Array.isArray(f))for(let h=0;h0&&(F.topicAliasMaximum>65535?v("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new C(F.topicAliasMaximum)),this.on("connect",function(){const fe=this.queue;function se(){const oe=fe.shift();v("deliver :: entry %o",oe);let $=null;if(!oe){Z._resubscribe();return}$=oe.packet,v("deliver :: call _sendPacket for %o",$);let re=!0;$.messageId&&$.messageId!==0&&(Z.messageIdProvider.register($.messageId)||(re=!1)),re?Z._sendPacket($,function(j){oe.cb&&oe.cb(j),se()}):(v("messageId: %d has already used. The message is skipped and removed.",$.messageId),se())}v("connect :: sending queued packets"),se()}),this.on("close",function(){v("close :: connected set to `false`"),this.connected=!1,v("close :: clearing connackTimer"),clearTimeout(this.connackTimer),v("close :: clearing ping timer"),Z.pingTimer!==null&&(Z.pingTimer.clear(),Z.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),v("close :: calling _setupReconnect"),this._setupReconnect()}),x.call(this),v("MqttClient :: setting up stream"),this._setupStream()}E(J,x),J.prototype._setupStream=function(){const z=this,F=new l,ee=o.parser(this.options);let Z=null;const fe=[];v("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),v("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ee.on("packet",function(j){v("parser :: on packet push to packets array."),fe.push(j)});function se(){if(fe.length)S(oe);else{const j=Z;Z=null,j()}}function oe(){v("work :: getting next packet in queue");const j=fe.shift();if(j)v("work :: packet pulled from queue"),z._handlePacket(j,se);else{v("work :: no packets in queue");const G=Z;Z=null,v("work :: done flag is %s",!!G),G&&G()}}F._write=function(j,G,O){Z=O,v("writable stream :: parsing buffer"),ee.parse(j),oe()};function $(j){v("streamErrorHandler :: error",j.message),N.includes(j.code)?(v("streamErrorHandler :: emitting error"),z.emit("error",j)):ne(j)}v("_setupStream :: pipe stream to writable stream"),this.stream.pipe(F),this.stream.on("error",$),this.stream.on("close",function(){v("(%s)stream :: on close",z.options.clientId),q(z.outgoing),v("stream: emit close to MqttClient"),z.emit("close")}),v("_setupStream: sending packet `connect`");const re=Object.create(this.options);if(re.cmd="connect",this.topicAliasRecv&&(re.properties||(re.properties={}),this.topicAliasRecv&&(re.properties.topicAliasMaximum=this.topicAliasRecv.max)),W(this,re),ee.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return z.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const j=g({cmd:"auth",reasonCode:0},this.options.authPacket);W(this,j)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){v("!!connectTimeout hit!! Calling _cleanUp with force `true`"),z._cleanUp(!0)},this.options.connectTimeout)},J.prototype._handlePacket=function(z,F){const ee=this.options;if(ee.protocolVersion===5&&ee.properties&&ee.properties.maximumPacketSize&&ee.properties.maximumPacketSize0||!$())&&this._storeProcessingQueue.push({invoke:$,cbStorePut:ee.cbStorePut,callback:Z}),this},J.prototype.subscribe=function(){const z=this,F=new Array(arguments.length);for(let O=0;O0){const B={qos:p.qos};$===5&&(B.nl=p.nl||!1,B.rap=p.rap||!1,B.rh=p.rh||0,B.properties=p.properties),z._resubscribeTopics[p.topic]=B,m.push(p.topic)}}),z.messageIdToTopic[D.messageId]=m}return z.outgoing[D.messageId]={volatile:!0,cb:function(m,p){if(!m){const B=p.granted;for(let d=0;d0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:se}),this},J.prototype.unsubscribe=function(){const z=this,F=new Array(arguments.length);for(let $=0;$0||!oe())&&this._storeProcessingQueue.push({invoke:oe,callback:Z}),this},J.prototype.end=function(z,F,ee){const Z=this;v("end :: (%s)",this.options.clientId),(z==null||typeof z!="boolean")&&(ee=F||ne,F=z,z=!1,typeof F!="object"&&(ee=F,F=null,typeof ee!="function"&&(ee=ne))),typeof F!="object"&&(ee=F,F=null),v("end :: cb? %s",!!ee),ee=ee||ne;function fe(){v("end :: closeStores: closing incoming and outgoing stores"),Z.disconnected=!0,Z.incomingStore.close(function(oe){Z.outgoingStore.close(function($){if(v("end :: closeStores: emitting end"),Z.emit("end"),ee){const re=oe||$;v("end :: closeStores: invoking callback with args"),ee(re)}})}),Z._deferredReconnect&&Z._deferredReconnect()}function se(){v("end :: (%s) :: finish :: calling _cleanUp with force %s",Z.options.clientId,z),Z._cleanUp(z,()=>{v("end :: finish :: calling process.nextTick on closeStores"),S(fe.bind(Z))},F)}return this.disconnecting?(ee(),this):(this._clearReconnect(),this.disconnecting=!0,!z&&Object.keys(this.outgoing).length>0?(v("end :: (%s) :: calling finish in 10ms once outgoing is empty",Z.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,se,10))):(v("end :: (%s) :: immediately calling finish",Z.options.clientId),se()),this)},J.prototype.removeOutgoingMessage=function(z){const F=this.outgoing[z]?this.outgoing[z].cb:null;return delete this.outgoing[z],this.outgoingStore.del({messageId:z},function(){F(new Error("Message removed"))}),this},J.prototype.reconnect=function(z){v("client reconnect");const F=this,ee=function(){z?(F.options.incomingStore=z.incomingStore,F.options.outgoingStore=z.outgoingStore):(F.options.incomingStore=null,F.options.outgoingStore=null),F.incomingStore=F.options.incomingStore||new L,F.outgoingStore=F.options.outgoingStore||new L,F.disconnecting=!1,F.disconnected=!1,F._deferredReconnect=null,F._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ee:ee(),this},J.prototype._reconnect=function(){v("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),v("client already connected. disconnecting first.")):(v("_reconnect: calling _setupStream"),this._setupStream())},J.prototype._setupReconnect=function(){const z=this;!z.disconnecting&&!z.reconnectTimer&&z.options.reconnectPeriod>0?(this.reconnecting||(v("_setupReconnect :: emit `offline` state"),this.emit("offline"),v("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),v("_setupReconnect :: setting reconnectTimer for %d ms",z.options.reconnectPeriod),z.reconnectTimer=setInterval(function(){v("reconnectTimer :: reconnect triggered!"),z._reconnect()},z.options.reconnectPeriod)):v("_setupReconnect :: doing nothing...")},J.prototype._clearReconnect=function(){v("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},J.prototype._cleanUp=function(z,F){const ee=arguments[2];if(F&&(v("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",F)),v("_cleanUp :: forced? %s",z),z)this.options.reconnectPeriod===0&&this.options.clean&&ie(this.outgoing),v("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const Z=g({cmd:"disconnect"},ee);v("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(Z,T.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(v("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(v("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),F&&!this.connected&&(v("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",F),F())},J.prototype._sendPacket=function(z,F,ee){v("_sendPacket :: (%s) :: start",this.options.clientId),ee=ee||ne,F=F||ne;const Z=k(this,z);if(Z){F(Z);return}if(!this.connected){if(z.cmd==="auth"){this._shiftPingInterval(),W(this,z,F);return}v("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(z,F,ee);return}switch(this._shiftPingInterval(),z.cmd){case"publish":break;case"pubrel":le(this,z,F,ee);return;default:W(this,z,F);return}switch(z.qos){case 2:case 1:le(this,z,F,ee);break;case 0:default:W(this,z,F);break}v("_sendPacket :: (%s) :: end",this.options.clientId)},J.prototype._storePacket=function(z,F,ee){v("_storePacket :: packet: %o",z),v("_storePacket :: cb? %s",!!F),ee=ee||ne;let Z=z;if(Z.cmd==="publish"){Z=y(z);const fe=X(this,Z);if(fe)return F&&F(fe)}(Z.qos||0)===0&&this.queueQoSZero||Z.cmd!=="publish"?this.queue.push({packet:Z,cb:F}):Z.qos>0?(F=this.outgoing[Z.messageId]?this.outgoing[Z.messageId].cb:null,this.outgoingStore.put(Z,function(fe){if(fe)return F&&F(fe);ee()})):F&&F(new Error("No connection to broker"))},J.prototype._setupPingTimer=function(){v("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const z=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=A(function(){z._checkPing()},this.options.keepalive*1e3))},J.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},J.prototype._checkPing=function(){v("_checkPing :: checking ping..."),this.pingResp?(v("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(v("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},J.prototype._handlePingresp=function(){this.pingResp=!0},J.prototype._handleConnack=function(z){v("_handleConnack");const F=this.options,Z=F.protocolVersion===5?z.reasonCode:z.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,z.properties){if(z.properties.topicAliasMaximum){if(z.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}z.properties.topicAliasMaximum>0&&(this.topicAliasSend=new b(z.properties.topicAliasMaximum))}z.properties.serverKeepAlive&&F.keepalive&&(F.keepalive=z.properties.serverKeepAlive,this._shiftPingInterval()),z.properties.maximumPacketSize&&(F.properties||(F.properties={}),F.properties.maximumPacketSize=z.properties.maximumPacketSize)}if(Z===0)this.reconnecting=!1,this._onConnect(z);else if(Z>0){const fe=new Error("Connection refused: "+H[Z]);fe.code=Z,this.emit("error",fe)}},J.prototype._handleAuth=function(z){const ee=this.options.protocolVersion,Z=ee===5?z.reasonCode:z.returnCode;if(ee!==5){const se=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ee);se.code=Z,this.emit("error",se);return}const fe=this;this.handleAuth(z,function(se,oe){if(se){fe.emit("error",se);return}if(Z===24)fe.reconnecting=!1,fe._sendPacket(oe);else{const $=new Error("Connection refused: "+H[Z]);se.code=Z,fe.emit("error",$)}})},J.prototype.handleAuth=function(z,F){F()},J.prototype._handlePublish=function(z,F){v("_handlePublish: packet %o",z),F=typeof F!="undefined"?F:ne;let ee=z.topic.toString();const Z=z.payload,fe=z.qos,se=z.messageId,oe=this,$=this.options,re=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let j;if(z.properties&&(j=z.properties.topicAlias),typeof j!="undefined")if(ee.length===0)if(j>0&&j<=65535){const G=this.topicAliasRecv.getTopicByAlias(j);if(G)ee=G,v("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ee,j);else{v("_handlePublish :: unregistered topic alias. alias: %d",j),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{v("_handlePublish :: topic alias out of range. alias: %d",j),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ee,j))v("_handlePublish :: registered topic: %s - alias: %d",ee,j);else{v("_handlePublish :: topic alias out of range. alias: %d",j),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(v("_handlePublish: qos %d",fe),fe){case 2:{$.customHandleAcks(ee,Z,z,function(j,G){if(j instanceof Error||(G=j,j=null),j)return oe.emit("error",j);if(re.indexOf(G)===-1)return oe.emit("error",new Error("Wrong reason code for pubrec"));G?oe._sendPacket({cmd:"pubrec",messageId:se,reasonCode:G},F):oe.incomingStore.put(z,function(){oe._sendPacket({cmd:"pubrec",messageId:se},F)})});break}case 1:{$.customHandleAcks(ee,Z,z,function(j,G){if(j instanceof Error||(G=j,j=null),j)return oe.emit("error",j);if(re.indexOf(G)===-1)return oe.emit("error",new Error("Wrong reason code for puback"));G||oe.emit("message",ee,Z,z),oe.handleMessage(z,function(O){if(O)return F&&F(O);oe._sendPacket({cmd:"puback",messageId:se,reasonCode:G},F)})});break}case 0:this.emit("message",ee,Z,z),this.handleMessage(z,F);break;default:v("_handlePublish: unknown QoS. Doing nothing.");break}},J.prototype.handleMessage=function(z,F){F()},J.prototype._handleAck=function(z){const F=z.messageId,ee=z.cmd;let Z=null;const fe=this.outgoing[F]?this.outgoing[F].cb:null,se=this;let oe;if(!fe){v("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(v("_handleAck :: packet type",ee),ee){case"pubcomp":case"puback":{const $=z.reasonCode;$&&$>0&&$!==16&&(oe=new Error("Publish error: "+H[$]),oe.code=$,fe(oe,z)),delete this.outgoing[F],this.outgoingStore.del(z,fe),this.messageIdProvider.deallocate(F),this._invokeStoreProcessingQueue();break}case"pubrec":{Z={cmd:"pubrel",qos:2,messageId:F};const $=z.reasonCode;$&&$>0&&$!==16?(oe=new Error("Publish error: "+H[$]),oe.code=$,fe(oe,z)):this._sendPacket(Z);break}case"suback":{delete this.outgoing[F],this.messageIdProvider.deallocate(F);for(let $=0;$0)if(this.options.resubscribe)if(this.options.protocolVersion===5){v("_resubscribe: protocolVersion 5");for(let F=0;F0){const z=this._storeProcessingQueue[0];if(z&&z.invoke())return this._storeProcessingQueue.shift(),!0}return!1},J.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},J.prototype._flushStoreProcessingQueue=function(){for(const z of this._storeProcessingQueue)z.cbStorePut&&z.cbStorePut(new Error("Connection closed")),z.callback&&z.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},Q.exports=J},36191:function(Q,Y,_){"use strict";const{Buffer:w}=_(48764),x=_(92750).Transform,L=_(25981);let C,b,o,s=!1;function l(){const g=new x;return g._write=function(v,S,T){C.sendSocketMessage({data:v.buffer,success:function(){T()},fail:function(){T(new Error)}})},g._flush=function(S){C.closeSocket({success:function(){S()}})},g}function E(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function A(g,v){const S=g.protocol==="alis"?"wss":"ws";let T=S+"://"+g.hostname+g.path;return g.port&&g.port!==80&&g.port!==443&&(T=S+"://"+g.hostname+":"+g.port+g.path),typeof g.transformWsUrl=="function"&&(T=g.transformWsUrl(T,g,v)),T}function y(){s||(s=!0,C.onSocketOpen(function(){o.setReadable(b),o.setWritable(b),o.emit("connect")}),C.onSocketMessage(function(g){if(typeof g.data=="string"){const v=w.from(g.data,"base64");b.push(v)}else{const v=new FileReader;v.addEventListener("load",function(){let S=v.result;S instanceof ArrayBuffer?S=w.from(S):S=w.from(S,"utf8"),b.push(S)}),v.readAsArrayBuffer(g.data)}}),C.onSocketClose(function(){o.end(),o.destroy()}),C.onSocketError(function(g){o.destroy(g)}))}function P(g,v){if(v.hostname=v.hostname||v.host,!v.hostname)throw new Error("Could not determine host. Specify host manually.");const S=v.protocolId==="MQIsdp"&&v.protocolVersion===3?"mqttv3.1":"mqtt";E(v);const T=A(v,g);return C=v.my,C.connectSocket({url:T,protocols:S}),b=l(),o=L.obj(),y(),o}Q.exports=P},31616:function(Q,Y,_){"use strict";var w=_(34155);const x=_(41455),L=_(77431),C=_(8575),b=_(47529),o=_(13129)("mqttjs"),s={};typeof w!="undefined"&&w.title!=="browser"||typeof _!="function"?(s.mqtt=_(71849),s.tcp=_(71849),s.ssl=_(85473),s.tls=_(85473),s.mqtts=_(85473)):(s.wx=_(18098),s.wxs=_(18098),s.ali=_(36191),s.alis=_(36191)),s.ws=_(26908),s.wss=_(26908);function l(A){let y;A.auth&&(y=A.auth.match(/^(.+):(.+)$/),y?(A.username=y[1],A.password=y[2]):A.username=A.auth)}function E(A,y){if(o("connecting to an MQTT broker..."),typeof A=="object"&&!y&&(y=A,A=null),y=y||{},A){const v=C.parse(A,!0);if(v.port!=null&&(v.port=Number(v.port)),y=b(v,y),y.protocol===null)throw new Error("Missing protocol");y.protocol=y.protocol.replace(/:$/,"")}if(l(y),y.query&&typeof y.query.clientId=="string"&&(y.clientId=y.query.clientId),y.cert&&y.key)if(y.protocol){if(["mqtts","wss","wxs","alis"].indexOf(y.protocol)===-1)switch(y.protocol){case"mqtt":y.protocol="mqtts";break;case"ws":y.protocol="wss";break;case"wx":y.protocol="wxs";break;case"ali":y.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+y.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!s[y.protocol]){const v=["mqtts","wss"].indexOf(y.protocol)!==-1;y.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(S,T){return v&&T%2==0?!1:typeof s[S]=="function"})[0]}if(y.clean===!1&&!y.clientId)throw new Error("Missing clientId for unclean clients");y.protocol&&(y.defaultProtocol=y.protocol);function P(v){return y.servers&&((!v._reconnectCount||v._reconnectCount===y.servers.length)&&(v._reconnectCount=0),y.host=y.servers[v._reconnectCount].host,y.port=y.servers[v._reconnectCount].port,y.protocol=y.servers[v._reconnectCount].protocol?y.servers[v._reconnectCount].protocol:y.defaultProtocol,y.hostname=y.host,v._reconnectCount++),o("calling streambuilder for",y.protocol),s[y.protocol](v,y)}const g=new x(P,y);return g.on("error",function(){}),g}Q.exports=E,Q.exports.connect=E,Q.exports.MqttClient=x,Q.exports.Store=L},71849:function(Q,Y,_){"use strict";const w=_(87294),x=_(13129)("mqttjs:tcp");function L(C,b){b.port=b.port||1883,b.hostname=b.hostname||b.host||"localhost";const o=b.port,s=b.hostname;return x("port %d and host %s",o,s),w.createConnection(o,s)}Q.exports=L},85473:function(Q,Y,_){"use strict";const w=_(95036),x=_(87294),L=_(13129)("mqttjs:tls");function C(b,o){o.port=o.port||8883,o.host=o.hostname||o.host||"localhost",x.isIP(o.host)===0&&(o.servername=o.host),o.rejectUnauthorized=o.rejectUnauthorized!==!1,delete o.path,L("port %d host %s rejectUnauthorized %b",o.port,o.host,o.rejectUnauthorized);const s=w.connect(o);s.on("secureConnect",function(){o.rejectUnauthorized&&!s.authorized?s.emit("error",new Error("TLS not authorized")):s.removeListener("error",l)});function l(E){o.rejectUnauthorized&&b.emit("error",E),s.end()}return s.on("error",l),s}Q.exports=C},26908:function(Q,Y,_){"use strict";var w=_(34155);const{Buffer:x}=_(48764),L=_(15124),C=_(13129)("mqttjs:ws"),b=_(25981),o=_(92750).Transform,s=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],l=typeof w!="undefined"&&w.title==="browser"||typeof _=="function";function E(T,U){let N=T.protocol+"://"+T.hostname+":"+T.port+T.path;return typeof T.transformWsUrl=="function"&&(N=T.transformWsUrl(N,T,U)),N}function A(T){const U=T;return T.hostname||(U.hostname="localhost"),T.port||(T.protocol==="wss"?U.port=443:U.port=80),T.path||(U.path="/"),T.wsOptions||(U.wsOptions={}),!l&&T.protocol==="wss"&&s.forEach(function(N){Object.prototype.hasOwnProperty.call(T,N)&&!Object.prototype.hasOwnProperty.call(T.wsOptions,N)&&(U.wsOptions[N]=T[N])}),U}function y(T){const U=A(T);if(U.hostname||(U.hostname=U.host),!U.hostname){if(typeof document=="undefined")throw new Error("Could not determine host. Specify host manually.");const N=new URL(document.URL);U.hostname=N.hostname,U.port||(U.port=N.port)}return U.objectMode===void 0&&(U.objectMode=!(U.binary===!0||U.binary===void 0)),U}function P(T,U,N){C("createWebSocket"),C("protocol: "+N.protocolId+" "+N.protocolVersion);const H=N.protocolId==="MQIsdp"&&N.protocolVersion===3?"mqttv3.1":"mqtt";return C("creating new Websocket for url: "+U+" and protocol: "+H),new L(U,[H],N.wsOptions)}function g(T,U){const N=U.protocolId==="MQIsdp"&&U.protocolVersion===3?"mqttv3.1":"mqtt",H=E(U,T),V=new WebSocket(H,[N]);return V.binaryType="arraybuffer",V}function v(T,U){C("streamBuilder");const N=A(U),H=E(N,T),V=P(T,H,N),k=L.createWebSocketStream(V,N.wsOptions);return k.url=H,V.on("close",()=>{k.destroy()}),k}function S(T,U){C("browserStreamBuilder");let N;const V=y(U).browserBufferSize||1024*512,k=U.browserBufferTimeout||1e3,X=!U.objectMode,W=g(T,U),ie=le(U,Z,fe);U.objectMode||(ie._writev=ee),ie.on("close",()=>{W.close()});const q=typeof W.addEventListener!="undefined";W.readyState===W.OPEN?N=ie:(N=N=b(void 0,void 0,U),U.objectMode||(N._writev=ee),q?W.addEventListener("open",ne):W.onopen=ne),N.socket=W,q?(W.addEventListener("close",J),W.addEventListener("error",z),W.addEventListener("message",F)):(W.onclose=J,W.onerror=z,W.onmessage=F);function le(se,oe,$){const re=new o({objectModeMode:se.objectMode});return re._write=oe,re._flush=$,re}function ne(){N.setReadable(ie),N.setWritable(ie),N.emit("connect")}function J(){N.end(),N.destroy()}function z(se){N.destroy(se)}function F(se){let oe=se.data;oe instanceof ArrayBuffer?oe=x.from(oe):oe=x.from(oe,"utf8"),ie.push(oe)}function ee(se,oe){const $=new Array(se.length);for(let re=0;reV&&setTimeout(Z,k,se,oe,$),X&&typeof se=="string"&&(se=x.from(se,"utf8"));try{W.send(se)}catch(re){return $(re)}$()}function fe(se){W.close(),se()}return N}l?Q.exports=S:Q.exports=v},18098:function(Q,Y,_){"use strict";const{Buffer:w}=_(48764),x=_(92750).Transform,L=_(25981);let C,b,o;function s(){const P=new x;return P._write=function(g,v,S){C.send({data:g.buffer,success:function(){S()},fail:function(T){S(new Error(T))}})},P._flush=function(v){C.close({success:function(){v()}})},P}function l(P){P.hostname||(P.hostname="localhost"),P.path||(P.path="/"),P.wsOptions||(P.wsOptions={})}function E(P,g){const v=P.protocol==="wxs"?"wss":"ws";let S=v+"://"+P.hostname+P.path;return P.port&&P.port!==80&&P.port!==443&&(S=v+"://"+P.hostname+":"+P.port+P.path),typeof P.transformWsUrl=="function"&&(S=P.transformWsUrl(S,P,g)),S}function A(){C.onOpen(function(){o.setReadable(b),o.setWritable(b),o.emit("connect")}),C.onMessage(function(P){let g=P.data;g instanceof ArrayBuffer?g=w.from(g):g=w.from(g,"utf8"),b.push(g)}),C.onClose(function(){o.end(),o.destroy()}),C.onError(function(P){o.destroy(new Error(P.errMsg))})}function y(P,g){if(g.hostname=g.hostname||g.host,!g.hostname)throw new Error("Could not determine host. Specify host manually.");const v=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt";l(g);const S=E(g,P);C=wx.connectSocket({url:S,protocols:[v]}),b=s(),o=L.obj(),o._destroy=function(U,N){C.close({success:function(){N&&N(U)}})};const T=o.destroy;return o.destroy=function(){o.destroy=T;const U=this;setTimeout(function(){C.close({fail:function(){U._destroy(new Error)}})},0)}.bind(o),A(),o}Q.exports=y},86156:function(Q){"use strict";function Y(){if(!(this instanceof Y))return new Y;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}Y.prototype.allocate=function(){const _=this.nextId++;return this.nextId===65536&&(this.nextId=1),_},Y.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},Y.prototype.register=function(_){return!0},Y.prototype.deallocate=function(_){},Y.prototype.clear=function(){},Q.exports=Y},77431:function(Q,Y,_){"use strict";const w=_(47529),x=_(92750).Readable,L={objectMode:!0},C={clean:!0};function b(o){if(!(this instanceof b))return new b(o);this.options=o||{},this.options=w(C,o),this._inflights=new Map}b.prototype.put=function(o,s){return this._inflights.set(o.messageId,o),s&&s(),this},b.prototype.createStream=function(){const o=new x(L),s=[];let l=!1,E=0;return this._inflights.forEach(function(A,y){s.push(A)}),o._read=function(){!l&&Ethis.max?!1:(this.aliasToTopic[w]=_,this.length=Object.keys(this.aliasToTopic).length,!0)},Y.prototype.getTopicByAlias=function(_){return this.aliasToTopic[_]},Y.prototype.clear=function(){this.aliasToTopic={}},Q.exports=Y},73744:function(Q,Y,_){"use strict";const w=_(83938),x=_(70423).Q;function L(C){if(!(this instanceof L))return new L(C);C>0&&(this.aliasToTopic=new w({max:C}),this.topicToAlias={},this.numberAllocator=new x(1,C),this.max=C,this.length=0)}L.prototype.put=function(C,b){if(b===0||b>this.max)return!1;const o=this.aliasToTopic.get(b);return o&&delete this.topicToAlias[o],this.aliasToTopic.set(b,C),this.topicToAlias[C]=b,this.numberAllocator.use(b),this.length=this.aliasToTopic.length,!0},L.prototype.getTopicByAlias=function(C){return this.aliasToTopic.get(C)},L.prototype.getAliasByTopic=function(C){const b=this.topicToAlias[C];return typeof b!="undefined"&&this.aliasToTopic.get(b),b},L.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},L.prototype.getLruAlias=function(){const C=this.numberAllocator.firstVacant();return C||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},Q.exports=L},4028:function(Q){"use strict";function Y(w){const x=w.split("/");for(let L=0;L1;class g{constructor(k){if(typeof k=="number"&&(k={max:k}),k||(k={}),k.max&&(typeof k.max!="number"||k.max<0))throw new TypeError("max must be a non-negative number");const X=this[x]=k.max||Infinity,W=k.length||P;if(this[C]=typeof W!="function"?P:W,this[b]=k.stale||!1,k.maxAge&&typeof k.maxAge!="number")throw new TypeError("maxAge must be a number");this[o]=k.maxAge||0,this[s]=k.dispose,this[l]=k.noDisposeOnSet||!1,this[y]=k.updateAgeOnGet||!1,this.reset()}set max(k){if(typeof k!="number"||k<0)throw new TypeError("max must be a non-negative number");this[x]=k||Infinity,T(this)}get max(){return this[x]}set allowStale(k){this[b]=!!k}get allowStale(){return this[b]}set maxAge(k){if(typeof k!="number")throw new TypeError("maxAge must be a non-negative number");this[o]=k,T(this)}get maxAge(){return this[o]}set lengthCalculator(k){typeof k!="function"&&(k=P),k!==this[C]&&(this[C]=k,this[L]=0,this[E].forEach(X=>{X.length=this[C](X.value,X.key),this[L]+=X.length})),T(this)}get lengthCalculator(){return this[C]}get length(){return this[L]}get itemCount(){return this[E].length}rforEach(k,X){X=X||this;for(let W=this[E].tail;W!==null;){const ie=W.prev;H(this,k,W,X),W=ie}}forEach(k,X){X=X||this;for(let W=this[E].head;W!==null;){const ie=W.next;H(this,k,W,X),W=ie}}keys(){return this[E].toArray().map(k=>k.key)}values(){return this[E].toArray().map(k=>k.value)}reset(){this[s]&&this[E]&&this[E].length&&this[E].forEach(k=>this[s](k.key,k.value)),this[A]=new Map,this[E]=new w,this[L]=0}dump(){return this[E].map(k=>S(this,k)?!1:{k:k.key,v:k.value,e:k.now+(k.maxAge||0)}).toArray().filter(k=>k)}dumpLru(){return this[E]}set(k,X,W){if(W=W||this[o],W&&typeof W!="number")throw new TypeError("maxAge must be a number");const ie=W?Date.now():0,q=this[C](X,k);if(this[A].has(k)){if(q>this[x])return U(this,this[A].get(k)),!1;const J=this[A].get(k).value;return this[s]&&(this[l]||this[s](k,J.value)),J.now=ie,J.maxAge=W,J.value=X,this[L]+=q-J.length,J.length=q,this.get(k),T(this),!0}const le=new N(k,X,q,ie,W);return le.length>this[x]?(this[s]&&this[s](k,X),!1):(this[L]+=le.length,this[E].unshift(le),this[A].set(k,this[E].head),T(this),!0)}has(k){if(!this[A].has(k))return!1;const X=this[A].get(k).value;return!S(this,X)}get(k){return v(this,k,!0)}peek(k){return v(this,k,!1)}pop(){const k=this[E].tail;return k?(U(this,k),k.value):null}del(k){U(this,this[A].get(k))}load(k){this.reset();const X=Date.now();for(let W=k.length-1;W>=0;W--){const ie=k[W],q=ie.e||0;if(q===0)this.set(ie.k,ie.v);else{const le=q-X;le>0&&this.set(ie.k,ie.v,le)}}}prune(){this[A].forEach((k,X)=>v(this,X,!1))}}const v=(V,k,X)=>{const W=V[A].get(k);if(W){const ie=W.value;if(S(V,ie)){if(U(V,W),!V[b])return}else X&&(V[y]&&(W.value.now=Date.now()),V[E].unshiftNode(W));return ie.value}},S=(V,k)=>{if(!k||!k.maxAge&&!V[o])return!1;const X=Date.now()-k.now;return k.maxAge?X>k.maxAge:V[o]&&X>V[o]},T=V=>{if(V[L]>V[x])for(let k=V[E].tail;V[L]>V[x]&&k!==null;){const X=k.prev;U(V,k),k=X}},U=(V,k)=>{if(k){const X=k.value;V[s]&&V[s](X.key,X.value),V[L]-=X.length,V[A].delete(X.key),V[E].removeNode(k)}};class N{constructor(k,X,W,ie,q){this.key=k,this.value=X,this.length=W,this.now=ie,this.maxAge=q||0}}const H=(V,k,X,W)=>{let ie=X.value;S(V,ie)&&(U(V,X),V[b]||(ie=void 0)),ie&&k.call(W,ie.value,ie.key,V)};Q.exports=g},99629:function(Q){"use strict";function Y(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.__proto__=s}var _={};function w(o,s,l){l||(l=Error);function E(y,P,g){return typeof s=="string"?s:s(y,P,g)}var A=function(y){Y(P,y);function P(g,v,S){return y.call(this,E(g,v,S))||this}return P}(l);A.prototype.name=l.name,A.prototype.code=o,_[o]=A}function x(o,s){if(Array.isArray(o)){var l=o.length;return o=o.map(function(E){return String(E)}),l>2?"one of ".concat(s," ").concat(o.slice(0,l-1).join(", "),", or ")+o[l-1]:l===2?"one of ".concat(s," ").concat(o[0]," or ").concat(o[1]):"of ".concat(s," ").concat(o[0])}else return"of ".concat(s," ").concat(String(o))}function L(o,s,l){return o.substr(!l||l<0?0:+l,s.length)===s}function C(o,s,l){return(l===void 0||l>o.length)&&(l=o.length),o.substring(l-s.length,l)===s}function b(o,s,l){return typeof l!="number"&&(l=0),l+s.length>o.length?!1:o.indexOf(s,l)!==-1}w("ERR_INVALID_OPT_VALUE",function(o,s){return'The value "'+s+'" is invalid for option "'+o+'"'},TypeError),w("ERR_INVALID_ARG_TYPE",function(o,s,l){var E;typeof s=="string"&&L(s,"not ")?(E="must not be",s=s.replace(/^not /,"")):E="must be";var A;if(C(o," argument"))A="The ".concat(o," ").concat(E," ").concat(x(s,"type"));else{var y=b(o,".")?"property":"argument";A='The "'.concat(o,'" ').concat(y," ").concat(E," ").concat(x(s,"type"))}return A+=". Received type ".concat(typeof l),A},TypeError),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),w("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w("ERR_STREAM_WRITE_AFTER_END","write after end"),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Q.exports.q=_},48671:function(Q,Y,_){"use strict";var w=_(34155),x=Object.keys||function(y){var P=[];for(var g in y)P.push(g);return P};Q.exports=l;var L=_(54421),C=_(27497);_(35717)(l,L);for(var b=x(C.prototype),o=0;o0)if(typeof r!="string"&&!n.objectMode&&Object.getPrototypeOf(r)!==o.prototype&&(r=l(r)),a)n.endEmitted?ie(t,new V):F(t,n,r,!0);else if(n.ended)ie(t,new N);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!u?(r=n.decoder.write(r),n.objectMode||r.length!==0?F(t,n,r,!1):j(t,n)):F(t,n,r,!1)}else a||(n.reading=!1,j(t,n))}return!n.ended&&(n.length=Z?t=Z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function se(t,r){return t<=0||r.length===0&&r.ended?0:r.objectMode?1:t!==t?r.flowing&&r.length?r.buffer.head.data.length:r.length:(t>r.highWaterMark&&(r.highWaterMark=fe(t)),t<=r.length?t:r.ended?r.length:(r.needReadable=!0,0))}J.prototype.read=function(t){y("read",t),t=parseInt(t,10);var r=this._readableState,u=t;if(t!==0&&(r.emittedReadable=!1),t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return y("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?h(this):$(this),null;if(t=se(t,r),t===0&&r.ended)return r.length===0&&h(this),null;var a=r.needReadable;y("need readable",a),(r.length===0||r.length-t0?i=f(t,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),u!==t&&r.ended&&h(this)),i!==null&&this.emit("data",i),i};function oe(t,r){if(y("onEofChunk"),!r.ended){if(r.decoder){var u=r.decoder.end();u&&u.length&&(r.buffer.push(u),r.length+=r.objectMode?1:u.length)}r.ended=!0,r.sync?$(t):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,re(t)))}}function $(t){var r=t._readableState;y("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(y("emitReadable",r.flowing),r.emittedReadable=!0,w.nextTick(re,t))}function re(t){var r=t._readableState;y("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,d(t)}function j(t,r){r.readingMore||(r.readingMore=!0,w.nextTick(G,t,r))}function G(t,r){for(;!r.reading&&!r.ended&&(r.length1&&M(a.pipes,t)!==-1)&&!K&&(y("false write response, pause",a.awaitDrain),a.awaitDrain++),u.pause())}function he(pe){y("onerror",pe),ce(),t.removeListener("error",he),C(t,"error")===0&&ie(t,pe)}le(t,"error",he);function ue(){t.removeListener("finish",de),ce()}t.once("close",ue);function de(){y("onfinish"),t.removeListener("close",ue),ce()}t.once("finish",de);function ce(){y("unpipe"),u.unpipe(t)}return t.emit("pipe",u),a.flowing||(y("pipe resume"),u.resume()),t};function O(t){return function(){var u=t._readableState;y("pipeOnDrain",u.awaitDrain),u.awaitDrain&&u.awaitDrain--,u.awaitDrain===0&&C(t,"data")&&(u.flowing=!0,d(t))}}J.prototype.unpipe=function(t){var r=this._readableState,u={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return t&&t!==r.pipes?this:(t||(t=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,t&&t.emit("unpipe",this,u),this);if(!t){var a=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var n=0;n0,a.flowing!==!1&&this.resume()):t==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,y("on readable",a.length,a.reading),a.length?$(this):a.reading||w.nextTick(m,this)),u},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(t,r){var u=b.prototype.removeListener.call(this,t,r);return t==="readable"&&w.nextTick(D,this),u},J.prototype.removeAllListeners=function(t){var r=b.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&w.nextTick(D,this),r};function D(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:t.listenerCount("data")>0&&t.resume()}function m(t){y("readable nexttick read 0"),t.read(0)}J.prototype.resume=function(){var t=this._readableState;return t.flowing||(y("resume"),t.flowing=!t.readableListening,p(this,t)),t.paused=!1,this};function p(t,r){r.resumeScheduled||(r.resumeScheduled=!0,w.nextTick(B,t,r))}function B(t,r){y("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),d(t),r.flowing&&!r.reading&&t.read(0)}J.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function d(t){var r=t._readableState;for(y("flow",r.flowing);r.flowing&&t.read()!==null;);}J.prototype.wrap=function(t){var r=this,u=this._readableState,a=!1;t.on("end",function(){if(y("wrapped end"),u.decoder&&!u.ended){var e=u.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),t.on("data",function(e){if(y("wrapped data"),u.decoder&&(e=u.decoder.write(e)),!(u.objectMode&&e==null)&&!(!u.objectMode&&(!e||!e.length))){var c=r.push(e);c||(a=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(c){return function(){return t[c].apply(t,arguments)}}(i));for(var n=0;n=r.length?(r.decoder?u=r.buffer.join(""):r.buffer.length===1?u=r.buffer.first():u=r.buffer.concat(r.length),r.buffer.clear()):u=r.buffer.consume(t,r.decoder),u}function h(t){var r=t._readableState;y("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,w.nextTick(I,r,t))}function I(t,r){if(y("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,r.readable=!1,r.emit("end"),t.autoDestroy)){var u=r._writableState;(!u||u.autoDestroy&&u.finished)&&r.destroy()}}typeof Symbol=="function"&&(J.from=function(t,r){return W===void 0&&(W=_(33401)),W(J,t,r)});function M(t,r){for(var u=0,a=t.length;u-1))throw new X(f);return this._writableState.defaultEncoding=f,this},Object.defineProperty(ne.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function F(d,f,h){return!d.objectMode&&d.decodeStrings!==!1&&typeof f=="string"&&(f=s.from(f,h)),f}Object.defineProperty(ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ee(d,f,h,I,M,t){if(!h){var r=F(f,I,M);I!==r&&(h=!0,M="buffer",I=r)}var u=f.objectMode?1:I.length;f.length+=u;var a=f.length0?this.tail.next=T:this.head=T,this.tail=T,++this.length}},{key:"unshift",value:function(S){var T={data:S,next:this.head};this.length===0&&(this.tail=T),this.head=T,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var T=this.head,U=""+T.data;T=T.next;)U+=S+T.data;return U}},{key:"concat",value:function(S){if(this.length===0)return l.alloc(0);for(var T=l.allocUnsafe(S>>>0),U=this.head,N=0;U;)P(U.data,T,N),N+=U.data.length,U=U.next;return T}},{key:"consume",value:function(S,T){var U;return SH.length?H.length:S;if(V===H.length?N+=H:N+=H.slice(0,S),S-=V,S===0){V===H.length?(++U,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=H.slice(V));break}++U}return this.length-=U,N}},{key:"_getBuffer",value:function(S){var T=l.allocUnsafe(S),U=this.head,N=1;for(U.data.copy(T),S-=U.data.length;U=U.next;){var H=U.data,V=S>H.length?H.length:S;if(H.copy(T,T.length-S,0,V),S-=V,S===0){V===H.length?(++N,U.next?this.head=U.next:this.head=this.tail=null):(this.head=U,U.data=H.slice(V));break}++N}return this.length-=N,T}},{key:y,value:function(S,T){return A(this,x({},T,{depth:0,customInspect:!1}))}}]),g}()},77739:function(Q,Y,_){"use strict";var w=_(34155);function x(l,E){var A=this,y=this._readableState&&this._readableState.destroyed,P=this._writableState&&this._writableState.destroyed;return y||P?(E?E(l):l&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,w.nextTick(o,this,l)):w.nextTick(o,this,l)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(g){!E&&g?A._writableState?A._writableState.errorEmitted?w.nextTick(C,A):(A._writableState.errorEmitted=!0,w.nextTick(L,A,g)):w.nextTick(L,A,g):E?(w.nextTick(C,A),E(g)):w.nextTick(C,A)}),this)}function L(l,E){o(l,E),C(l)}function C(l){l._writableState&&!l._writableState.emitClose||l._readableState&&!l._readableState.emitClose||l.emit("close")}function b(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(l,E){l.emit("error",E)}function s(l,E){var A=l._readableState,y=l._writableState;A&&A.autoDestroy||y&&y.autoDestroy?l.destroy(E):l.emit("error",E)}Q.exports={destroy:x,undestroy:b,errorOrDestroy:s}},59171:function(Q,Y,_){"use strict";var w=_(99629).q.ERR_STREAM_PREMATURE_CLOSE;function x(o){var s=!1;return function(){if(!s){s=!0;for(var l=arguments.length,E=new Array(l),A=0;A0;return l(H,k,X,function(W){U||(U=W),W&&N.forEach(E),!k&&(N.forEach(E),T(U))})});return v.reduce(A)}Q.exports=P},65322:function(Q,Y,_){"use strict";var w=_(99629).q.ERR_INVALID_OPT_VALUE;function x(C,b,o){return C.highWaterMark!=null?C.highWaterMark:b?C[o]:null}function L(C,b,o,s){var l=x(b,s,o);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var E=s?o:"highWaterMark";throw new w(E,l)}return Math.floor(l)}return C.objectMode?16:16*1024}Q.exports={getHighWaterMark:L}},97351:function(Q,Y,_){Q.exports=_(17187).EventEmitter},92750:function(Q,Y,_){Y=Q.exports=_(54421),Y.Stream=Y,Y.Readable=Y,Y.Writable=_(27497),Y.Duplex=_(48671),Y.Transform=_(49022),Y.PassThrough=_(41433),Y.finished=_(59171),Y.pipeline=_(70481)},15124:function(Q){"use strict";Q.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},73641:function(Q){"use strict";Q.exports=function(Y){Y.prototype[Symbol.iterator]=function*(){for(let _=this.head;_;_=_.next)yield _.value}}},94462:function(Q,Y,_){"use strict";Q.exports=w,w.Node=b,w.create=w;function w(o){var s=this;if(s instanceof w||(s=new w),s.tail=null,s.head=null,s.length=0,o&&typeof o.forEach=="function")o.forEach(function(A){s.push(A)});else if(arguments.length>0)for(var l=0,E=arguments.length;l1)l=s;else if(this.head)E=this.head.next,l=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var A=0;E!==null;A++)l=o(l,E.value,A),E=E.next;return l},w.prototype.reduceReverse=function(o,s){var l,E=this.tail;if(arguments.length>1)l=s;else if(this.tail)E=this.tail.prev,l=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var A=this.length-1;E!==null;A--)l=o(l,E.value,A),E=E.prev;return l},w.prototype.toArray=function(){for(var o=new Array(this.length),s=0,l=this.head;l!==null;s++)o[s]=l.value,l=l.next;return o},w.prototype.toArrayReverse=function(){for(var o=new Array(this.length),s=0,l=this.tail;l!==null;s++)o[s]=l.value,l=l.prev;return o},w.prototype.slice=function(o,s){s=s||this.length,s<0&&(s+=this.length),o=o||0,o<0&&(o+=this.length);var l=new w;if(sthis.length&&(s=this.length);for(var E=0,A=this.head;A!==null&&Ethis.length&&(s=this.length);for(var E=this.length,A=this.tail;A!==null&&E>s;E--)A=A.prev;for(;A!==null&&E>o;E--,A=A.prev)l.push(A.value);return l},w.prototype.splice=function(o,s,...l){o>this.length&&(o=this.length-1),o<0&&(o=this.length+o);for(var E=0,A=this.head;A!==null&&E0)return b(E);if(y==="number"&&isFinite(E))return A.long?s(E):o(E);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(E))};function b(E){if(E=String(E),!(E.length>100)){var A=/^(-?(?:\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(!!A){var y=parseFloat(A[1]),P=(A[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return y*C;case"weeks":case"week":case"w":return y*L;case"days":case"day":case"d":return y*x;case"hours":case"hour":case"hrs":case"hr":case"h":return y*w;case"minutes":case"minute":case"mins":case"min":case"m":return y*_;case"seconds":case"second":case"secs":case"sec":case"s":return y*Y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function o(E){var A=Math.abs(E);return A>=x?Math.round(E/x)+"d":A>=w?Math.round(E/w)+"h":A>=_?Math.round(E/_)+"m":A>=Y?Math.round(E/Y)+"s":E+"ms"}function s(E){var A=Math.abs(E);return A>=x?l(E,A,x,"day"):A>=w?l(E,A,w,"hour"):A>=_?l(E,A,_,"minute"):A>=Y?l(E,A,Y,"second"):E+" ms"}function l(E,A,y,P){var g=A>=y*1.5;return Math.round(E/y)+" "+P+(g?"s":"")}},70423:function(Q,Y,_){const w=_(29759);Q.exports.Q=w},29759:function(Q,Y,_){"use strict";const w=_(89246).l4,x=_(13129)("number-allocator:trace"),L=_(13129)("number-allocator:error");function C(o,s){this.low=o,this.high=s}C.prototype.equals=function(o){return this.low===o.low&&this.high===o.high},C.prototype.compare=function(o){return this.lowl.compare(E)),x("Create"),this.clear()}b.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},b.prototype.alloc=function(){if(this.ss.size()===0)return x("alloc():empty"),null;const o=this.ss.front(),s=o.low;return s+1<=o.high?++o.low:this.ss.eraseElementByPos(0),x("alloc():"+s),s},b.prototype.use=function(o){const s=new C(o,o),l=this.ss.lowerBound(s);if(l){if(l.equals(s))return this.ss.eraseElementByValue(l),x("use():"+o),!0;if(l.low>o)return!1;if(l.low===o)return++l.low,x("use():"+o),!0;if(l.high===o)return--l.high,x("use():"+o),!0;const E=l.low;return l.low=o+1,this.ss.insert(new C(E,o-1)),x("use():"+o),!0}return x("use():failed"),!1},b.prototype.free=function(o){if(othis.max){L("free():"+o+" is out of range");return}const s=new C(o,o),l=this.ss.lowerBound(s);if(l){if(l.low<=o&&o<=l.high){L("free():"+o+" has already been vacant");return}if(l===this.ss.front())o+1===l.low?--l.low:this.ss.insert(s);else{const E=this.ss.reverseLowerBound(s);E.high+1===o?o+1===l.low?(this.ss.eraseElementByValue(E),l.low=E.low):E.high=o:o+1===l.low?l.low=o:this.ss.insert(s)}}else{if(l===this.ss.front()){this.ss.insert(s);return}const E=this.ss.reverseLowerBound(s);E.high+1===o?E.high=o:this.ss.insert(s)}x("free():"+o)},b.prototype.clear=function(){x("clear()"),this.ss.clear(),this.ss.insert(new C(this.min,this.max))},b.prototype.intervalCount=function(){return this.ss.size()},b.prototype.dump=function(){console.log("length:"+this.ss.size());for(const o of this.ss)console.log(o)},Q.exports=b},30778:function(Q,Y,_){var w=_(52479);Q.exports=w(x),Q.exports.strict=w(L),x.proto=x(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return x(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return L(this)},configurable:!0})});function x(C){var b=function(){return b.called?b.value:(b.called=!0,b.value=C.apply(this,arguments))};return b.called=!1,b}function L(C){var b=function(){if(b.called)throw new Error(b.onceError);return b.called=!0,b.value=C.apply(this,arguments)},o=C.name||"Function wrapped with `once`";return b.onceError=o+" shouldn't be called more than once",b.called=!1,b}},88212:function(Q,Y,_){"use strict";var w=_(34155);typeof w=="undefined"||!w.version||w.version.indexOf("v0.")===0||w.version.indexOf("v1.")===0&&w.version.indexOf("v1.8.")!==0?Q.exports={nextTick:x}:Q.exports=w;function x(L,C,b,o){if(typeof L!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,l,E;switch(s){case 0:case 1:return w.nextTick(L);case 2:return w.nextTick(function(){L.call(null,C)});case 3:return w.nextTick(function(){L.call(null,C,b)});case 4:return w.nextTick(function(){L.call(null,C,b,o)});default:for(l=new Array(s-1),E=0;E0){w=new Array(arguments.length-2);for(var x=0;x>5==6?2:N>>4==14?3:N>>3==30?4:N>>6==2?-1:-2}function s(N,H,V){var k=H.length-1;if(k=0?(X>0&&(N.lastNeed=X-1),X):--k=0?(X>0&&(N.lastNeed=X-2),X):--k=0?(X>0&&(X===2?X=0:N.lastNeed=X-3),X):0))}function l(N,H,V){if((H[0]&192)!=128)return N.lastNeed=0,"\uFFFD";if(N.lastNeed>1&&H.length>1){if((H[1]&192)!=128)return N.lastNeed=1,"\uFFFD";if(N.lastNeed>2&&H.length>2&&(H[2]&192)!=128)return N.lastNeed=2,"\uFFFD"}}function E(N){var H=this.lastTotal-this.lastNeed,V=l(this,N,H);if(V!==void 0)return V;if(this.lastNeed<=N.length)return N.copy(this.lastChar,H,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,H,0,N.length),this.lastNeed-=N.length}function A(N,H){var V=s(this,N,H);if(!this.lastNeed)return N.toString("utf8",H);this.lastTotal=V;var k=N.length-(V-this.lastNeed);return N.copy(this.lastChar,0,k),N.toString("utf8",H,k)}function y(N){var H=N&&N.length?this.write(N):"";return this.lastNeed?H+"\uFFFD":H}function P(N,H){if((N.length-H)%2==0){var V=N.toString("utf16le",H);if(V){var k=V.charCodeAt(V.length-1);if(k>=55296&&k<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],V.slice(0,-1)}return V}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",H,N.length-1)}function g(N){var H=N&&N.length?this.write(N):"";if(this.lastNeed){var V=this.lastTotal-this.lastNeed;return H+this.lastChar.toString("utf16le",0,V)}return H}function v(N,H){var V=(N.length-H)%3;return V===0?N.toString("base64",H):(this.lastNeed=3-V,this.lastTotal=3,V===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",H,N.length-V))}function S(N){var H=N&&N.length?this.write(N):"";return this.lastNeed?H+this.lastChar.toString("base64",0,3-this.lastNeed):H}function T(N){return N.toString(this.encoding)}function U(N){return N&&N.length?this.write(N):""}},40396:function(Q,Y,_){/*! safe-buffer. MIT License. Feross Aboukhadijeh */var w=_(48764),x=w.Buffer;function L(b,o){for(var s in b)o[s]=b[s]}x.from&&x.alloc&&x.allocUnsafe&&x.allocUnsafeSlow?Q.exports=w:(L(w,Y),Y.Buffer=C);function C(b,o,s){return x(b,o,s)}C.prototype=Object.create(x.prototype),L(x,C),C.from=function(b,o,s){if(typeof b=="number")throw new TypeError("Argument must not be a number");return x(b,o,s)},C.alloc=function(b,o,s){if(typeof b!="number")throw new TypeError("Argument must be a number");var l=x(b);return o!==void 0?typeof s=="string"?l.fill(o,s):l.fill(o):l.fill(0),l},C.allocUnsafe=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return x(b)},C.allocUnsafeSlow=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return w.SlowBuffer(b)}},52511:function(Q,Y,_){Q=_.nmd(Q);var w;/*! https://mths.be/punycode v1.3.2 by @mathias */(function(x){var L=Y&&!Y.nodeType&&Y,C=Q&&!Q.nodeType&&Q,b=typeof _.g=="object"&&_.g;(b.global===b||b.window===b||b.self===b)&&(x=b);var o,s=2147483647,l=36,E=1,A=26,y=38,P=700,g=72,v=128,S="-",T=/^xn--/,U=/[^\x20-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,H={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=l-E,k=Math.floor,X=String.fromCharCode,W;function ie($){throw RangeError(H[$])}function q($,re){for(var j=$.length,G=[];j--;)G[j]=re($[j]);return G}function le($,re){var j=$.split("@"),G="";j.length>1&&(G=j[0]+"@",$=j[1]),$=$.replace(N,".");var O=$.split("."),D=q(O,re).join(".");return G+D}function ne($){for(var re=[],j=0,G=$.length,O,D;j=55296&&O<=56319&&j65535&&(re-=65536,j+=X(re>>>10&1023|55296),re=56320|re&1023),j+=X(re),j}).join("")}function z($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:l}function F($,re){return $+22+75*($<26)-((re!=0)<<5)}function ee($,re,j){var G=0;for($=j?k($/P):$>>1,$+=k($/re);$>V*A>>1;G+=l)$=k($/V);return k(G+(V+1)*$/($+y))}function Z($){var re=[],j=$.length,G,O=0,D=v,m=g,p,B,d,f,h,I,M,t,r;for(p=$.lastIndexOf(S),p<0&&(p=0),B=0;B=128&&ie("not-basic"),re.push($.charCodeAt(B));for(d=p>0?p+1:0;d=j&&ie("invalid-input"),M=z($.charCodeAt(d++)),(M>=l||M>k((s-O)/h))&&ie("overflow"),O+=M*h,t=I<=m?E:I>=m+A?A:I-m,!(Mk(s/r)&&ie("overflow"),h*=r;G=re.length+1,m=ee(O-f,G,f==0),k(O/G)>s-D&&ie("overflow"),D+=k(O/G),O%=G,re.splice(O++,0,D)}return J(re)}function fe($){var re,j,G,O,D,m,p,B,d,f,h,I=[],M,t,r,u;for($=ne($),M=$.length,re=v,j=0,D=g,m=0;m=re&&hk((s-j)/t)&&ie("overflow"),j+=(p-re)*t,re=p,m=0;ms&&ie("overflow"),h==re){for(B=j,d=l;f=d<=D?E:d>=D+A?A:d-D,!(B0&&s>o&&(s=o);for(var l=0;l=0?(y=E.substr(0,A),P=E.substr(A+1)):(y=E,P=""),g=decodeURIComponent(y),v=decodeURIComponent(P),Y(C,g)?Array.isArray(C[g])?C[g].push(v):C[g]=[C[g],v]:C[g]=v}return C}},44066:function(Q){"use strict";var Y=function(_){switch(typeof _){case"string":return _;case"boolean":return _?"true":"false";case"number":return isFinite(_)?_:"";default:return""}};Q.exports=function(_,w,x,L){return w=w||"&",x=x||"=",_===null&&(_=void 0),typeof _=="object"?Object.keys(_).map(function(C){var b=encodeURIComponent(Y(C))+x;return Array.isArray(_[C])?_[C].map(function(o){return b+encodeURIComponent(Y(o))}).join(w):b+encodeURIComponent(Y(_[C]))}).join(w):L?encodeURIComponent(Y(L))+x+encodeURIComponent(Y(_)):""}},36254:function(Q,Y,_){"use strict";Y.decode=Y.parse=_(27225),Y.encode=Y.stringify=_(44066)},8575:function(Q,Y,_){"use strict";var w=_(52511),x=_(62502);Y.parse=H,Y.resolve=k,Y.resolveObject=X,Y.format=V,Y.Url=L;function L(){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 C=/^([a-z0-9.+-]+:)/i,b=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",` `," "],l=["{","}","|","\\","^","`"].concat(s),E=["'"].concat(l),A=["%","/","?",";","#"].concat(E),y=["/","?","#"],P=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},T={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},N=_(36254);function H(W,ie,q){if(W&&x.isObject(W)&&W instanceof L)return W;var le=new L;return le.parse(W,ie,q),le}L.prototype.parse=function(W,ie,q){if(!x.isString(W))throw new TypeError("Parameter 'url' must be a string, not "+typeof W);var le=W.indexOf("?"),ne=le!==-1&&le127?B+="x":B+=p[d];if(!B.match(g)){var h=D.slice(0,$),I=D.slice($+1),M=p.match(v);M&&(h.push(M[1]),I.unshift(M[2])),I.length&&(F="/"+I.join(".")+F),this.hostname=h.join(".");break}}}this.hostname.length>P?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=w.toASCII(this.hostname));var t=this.port?":"+this.port:"",r=this.hostname||"";this.host=r+t,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),F[0]!=="/"&&(F="/"+F))}if(!S[fe])for(var $=0,m=E.length;$0?q.host.split("@"):!1;B&&(q.auth=B.shift(),q.host=q.hostname=B.shift())}return q.search=W.search,q.query=W.query,(!x.isNull(q.pathname)||!x.isNull(q.search))&&(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.href=q.format(),q}if(!D.length)return q.pathname=null,q.search?q.path="/"+q.search:q.path=null,q.href=q.format(),q;for(var d=D.slice(-1)[0],f=(q.host||W.host||D.length>1)&&(d==="."||d==="..")||d==="",h=0,I=D.length;I>=0;I--)d=D[I],d==="."?D.splice(I,1):d===".."?(D.splice(I,1),h++):h&&(D.splice(I,1),h--);if(!G&&!O)for(;h--;h)D.unshift("..");G&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),f&&D.join("/").substr(-1)!=="/"&&D.push("");var M=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(p){q.hostname=q.host=M?"":D.length?D.shift():"";var B=q.host&&q.host.indexOf("@")>0?q.host.split("@"):!1;B&&(q.auth=B.shift(),q.host=q.hostname=B.shift())}return G=G||q.host&&D.length,G&&!M&&D.unshift(""),D.length?q.pathname=D.join("/"):(q.pathname=null,q.path=null),(!x.isNull(q.pathname)||!x.isNull(q.search))&&(q.path=(q.pathname?q.pathname:"")+(q.search?q.search:"")),q.auth=W.auth||q.auth,q.slashes=q.slashes||W.slashes,q.href=q.format(),q},L.prototype.parseHost=function(){var W=this.host,ie=b.exec(W);ie&&(ie=ie[0],ie!==":"&&(this.port=ie.substr(1)),W=W.substr(0,W.length-ie.length)),W&&(this.hostname=W)}},62502:function(Q){"use strict";Q.exports={isString:function(Y){return typeof Y=="string"},isObject:function(Y){return typeof Y=="object"&&Y!==null},isNull:function(Y){return Y===null},isNullOrUndefined:function(Y){return Y==null}}},94927:function(Q,Y,_){Q.exports=w;function w(L,C){if(x("noDeprecation"))return L;var b=!1;function o(){if(!b){if(x("throwDeprecation"))throw new Error(C);x("traceDeprecation")?console.trace(C):console.warn(C),b=!0}return L.apply(this,arguments)}return o}function x(L){try{if(!_.g.localStorage)return!1}catch(b){return!1}var C=_.g.localStorage[L];return C==null?!1:String(C).toLowerCase()==="true"}},52479:function(Q){Q.exports=Y;function Y(_,w){if(_&&w)return Y(_)(w);if(typeof _!="function")throw new TypeError("need wrapper function");return Object.keys(_).forEach(function(L){x[L]=_[L]}),x;function x(){for(var L=new Array(arguments.length),C=0;C