(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-096610b0"],{"05ee":function(t,e,r){"use strict";var n=r(3);function i(t,e){var r,i;return e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",r=e.port,i=e.hostname,n.createConnection(r,i)}t.exports=i},"06a2":function(t,e,r){"use strict";var n,i=r("a671"),o=r("2031"),s=r("1a94"),a=r("96ae"),u=r("f508"),c=r("986b"),f=r("1c4a"),l=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u((function(){var t;if(this.__list__)return this.__redo__&&(t=this.__redo__.shift(),void 0!==t)?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):l(this,"__redo__",u("c",[t])))})),_onDelete:u((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(e=this.__redo__.indexOf(t),-1!==e&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:u((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),l(n.prototype,f.iterator,u((function(){return this})))},"0960":function(t,e,r){t.exports=r("b19a")},"09d9":function(t,e,r){"use strict";var n,i=r("e0f6"),o=r("f508"),s=r("1c4a"),a=r("06a2"),u=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)}))}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},"0b16":function(t,e,r){"use strict";var n=r("1985"),i=r("35e86");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=w,e.resolve=E,e.resolveObject=k,e.format=S,e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["<",">",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(c),l=["'"].concat(f),h=["%","/","?",";","#"].concat(l),p=["/","?","#"],d=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r("b383");function w(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}function S(t){return i.isString(t)&&(t=w(t)),t instanceof o?t.format():o.prototype.format.call(t)}function E(t,e){return w(t,!1,!0).resolve(e)}function k(t,e){return t?w(t,!1,!0).resolveObject(e):e}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?L+="x":L+=C[N];if(!L.match(b)){var U=I.slice(0,j),B=I.slice(j+1),q=C.match(g);q&&(U.push(q[1]),B.unshift(q[2])),B.length&&(w="/"+B.join(".")+w),this.hostname=U.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=n.toASCII(this.hostname));var W=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+W,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!y[k])for(j=0,P=l.length;j0)&&r.host.split("@");x&&(r.auth=x.shift(),r.host=r.hostname=x.shift())}return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=E.slice(-1)[0],R=(r.host||t.host||E.length>1)&&("."===O||".."===O)||""===O,T=0,j=E.length;j>=0;j--)O=E[j],"."===O?E.splice(j,1):".."===O?(E.splice(j,1),T++):T&&(E.splice(j,1),T--);if(!w&&!S)for(;T--;T)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),R&&"/"!==E.join("/").substr(-1)&&E.push("");var A=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(k){r.hostname=r.host=A?"":E.length?E.shift():"";x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");x&&(r.auth=x.shift(),r.host=r.hostname=x.shift())}return w=w||r.host&&E.length,w&&!A&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},"0b24":function(t,e,r){"use strict";var n,i=r("a671"),o=r("3527"),s=r("e0f6"),a=r("1a94"),u=r("96ae"),c=r("f508"),f=r("c9fc"),l=r("1c4a"),h=r("3473"),p=r("c351"),d=r("1195"),b=r("b779"),g=Function.prototype.call,y=Object.defineProperties,_=Object.getPrototypeOf;t.exports=n=function(){var t,e,r,i=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return r=b&&s&&Map!==n?s(new Map,_(this)):this,null!=i&&h(i),y(r,{__mapKeysData__:c("c",t=[]),__mapValuesData__:c("c",e=[])}),i?(p(i,(function(r){var n=u(r)[0];r=r[1],-1===o.call(t,n)&&(t.push(n),e.push(r))}),r),r):r},b&&(s&&s(n,Map),n.prototype=Object.create(Map.prototype,{constructor:c(n)})),f(y(n.prototype,{clear:c((function(){this.__mapKeysData__.length&&(i.call(this.__mapKeysData__),i.call(this.__mapValuesData__),this.emit("_clear"))})),delete:c((function(t){var e=o.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)})),entries:c((function(){return new d(this,"key+value")})),forEach:c((function(t){var e,r,n=arguments[1];a(t),e=this.entries(),r=e._next();while(void 0!==r)g.call(t,n,this.__mapValuesData__[r],this.__mapKeysData__[r],this),r=e._next()})),get:c((function(t){var e=o.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]})),has:c((function(t){return-1!==o.call(this.__mapKeysData__,t)})),keys:c((function(){return new d(this,"key")})),set:c((function(t,e){var r,n=o.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,r=!0),this.__mapValuesData__[n]=e,r&&this.emit("_add",n,t),this})),size:c.gs((function(){return this.__mapKeysData__.length})),values:c((function(){return new d(this,"value")})),toString:c((function(){return"[object Map]"}))})),Object.defineProperty(n.prototype,l.iterator,c((function(){return this.entries()}))),Object.defineProperty(n.prototype,l.toStringTag,c("c","Map"))},1:function(t,e){},1126:function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"===typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},1195:function(t,e,r){"use strict";var n,i=r("e0f6"),o=r("f508"),s=r("06a2"),a=r("1c4a").toStringTag,u=r("c682"),c=Object.defineProperties,f=s.prototype._unBind;n=t.exports=function(t,e){if(!(this instanceof n))return new n(t,e);s.call(this,t.__mapKeysData__,t),e&&u[e]||(e="key+value"),c(this,{__kind__:o("",e),__values__:o("w",t.__mapValuesData__)})},i&&i(n,s),n.prototype=Object.create(s.prototype,{constructor:o(n),_resolve:o((function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]})),_unBind:o((function(){this.__values__=null,f.call(this)})),toString:o((function(){return"[object Map Iterator]"}))}),Object.defineProperty(n.prototype,a,o("c","Map Iterator"))},"14ab":function(t,e,r){"use strict";t.exports=function(){var t,e=Object.assign;return"function"===typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},"14cf":function(t,e,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"===typeof r&&(t=["raz","dwa"],e=r(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},1793:function(t,e,r){"use strict";var n=r("6321"),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!n(t)&&!i.test(o.call(t))}},"18ec":function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"===typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},1985:function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=36,f=1,l=26,h=38,p=700,d=72,b=128,g="-",y=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-f,S=Math.floor,E=String.fromCharCode;function k(t){throw new RangeError(m[t])}function x(t,e){var r=t.length,n=[];while(r--)n[r]=e(t[r]);return n}function O(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(v,".");var i=t.split("."),o=x(i,e).join(".");return n+o}function R(t){var e,r,n=[],i=0,o=t.length;while(i=55296&&e<=56319&&i65535&&(t-=65536,e+=E(t>>>10&1023|55296),t=56320|1023&t),e+=E(t),e})).join("")}function j(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var n=0;for(t=r?S(t/p):t>>1,t+=S(t/e);t>w*l>>1;n+=c)t=S(t/w);return S(n+(w+1)*t/(t+h))}function I(t){var e,r,n,i,o,s,a,h,p,y,_=[],v=t.length,m=0,w=b,E=d;for(r=t.lastIndexOf(g),r<0&&(r=0),n=0;n=128&&k("not-basic"),_.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=v&&k("invalid-input"),h=j(t.charCodeAt(i++)),(h>=c||h>S((u-m)/s))&&k("overflow"),m+=h*s,p=a<=E?f:a>=E+l?l:a-E,hS(u/y)&&k("overflow"),s*=y}e=_.length+1,E=M(m-o,e,0==o),S(m/e)>u-w&&k("overflow"),w+=S(m/e),m%=e,_.splice(m++,0,w)}return T(_)}function P(t){var e,r,n,i,o,s,a,h,p,y,_,v,m,w,x,O=[];for(t=R(t),v=t.length,e=b,r=0,o=d,s=0;s=e&&_S((u-r)/m)&&k("overflow"),r+=(a-e)*m,e=a,s=0;su&&k("overflow"),_==e){for(h=r,p=c;;p+=c){if(y=p<=o?f:p>=o+l?l:p-o,h0)&&this[this._states[this._stateCounter]]()&&!this.error)this._stateCounter++,this._stateCounter>=this._states.length&&(this._stateCounter=0);return this._list.length},u.prototype._parseHeader=function(){var t=this._list.readUInt8(0);return this.packet.cmd=a.types[t>>a.CMD_SHIFT],this.packet.retain=0!==(t&a.RETAIN_MASK),this.packet.qos=t>>a.QOS_SHIFT&a.QOS_MASK,this.packet.dup=0!==(t&a.DUP_MASK),this._list.consume(1),!0},u.prototype._parseLength=function(){var t,e=0,r=1,n=0,i=!0;while(e<5){if(t=this._list.readUInt8(e++),n+=r*(t&a.LENGTH_MASK),r*=128,0===(t&a.LENGTH_FIN_MASK))break;if(this._list.length<=e){i=!1;break}}return i&&(this.packet.length=n,this._list.consume(e)),i},u.prototype._parsePayload=function(){var t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseMessageId();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":case"disconnect":break;default:this._emitError(new Error("Not supported"))}t=!0}return t},u.prototype._parseConnect=function(){var t,e,r,n,i,o,s={},u=this.packet;if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==t&&"MQIsdp"!==t)return this._emitError(new Error("Invalid protocolId"));if(u.protocolId=t,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(u.protocolVersion=this._list.readUInt8(this._pos),3!==u.protocolVersion&&4!==u.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK,s.will&&(u.will={},u.will.retain=0!==(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),u.will.qos=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT),u.clean=0!==(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK),this._pos++,u.keepalive=this._parseNum(),-1===u.keepalive)return this._emitError(new Error("Packet too short"));if(e=this._parseString(),null===e)return this._emitError(new Error("Packet too short"));if(u.clientId=e,s.will){if(r=this._parseString(),null===r)return this._emitError(new Error("Cannot parse will topic"));if(u.will.topic=r,n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse will payload"));u.will.payload=n}if(s.username){if(o=this._parseString(),null===o)return this._emitError(new Error("Cannot parse username"));u.username=o}if(s.password){if(i=this._parseBuffer(),null===i)return this._emitError(new Error("Cannot parse password"));u.password=i}return u},u.prototype._parseConnack=function(){var t=this.packet;return this._list.length<2?null:(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&a.SESSIONPRESENT_MASK),t.returnCode=this._list.readUInt8(this._pos),-1===t.returnCode?this._emitError(new Error("Cannot parse return code")):void 0)},u.prototype._parsePublish=function(){var t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(new Error("Cannot parse topic"));t.qos>0&&!this._parseMessageId()||(t.payload=this._list.slice(this._pos,t.length))},u.prototype._parseSubscribe=function(){var t,e,r=this.packet;if(1!==r.qos)return this._emitError(new Error("Wrong subscribe header"));if(r.subscriptions=[],this._parseMessageId())while(this._pos=r.length)return this._emitError(new Error("Malformed Subscribe Payload"));e=this._list.readUInt8(this._pos++),r.subscriptions.push({topic:t,qos:e})}},u.prototype._parseSuback=function(){if(this.packet.granted=[],this._parseMessageId())while(this._posthis._list.length||n>this.packet.length?null:(e=this._list.toString("utf8",this._pos,n),this._pos+=r,e)},u.prototype._parseBuffer=function(){var t,e=this._parseNum(),r=e+this._pos;return-1===e||r>this._list.length||r>this.packet.length?null:(t=this._list.slice(this._pos,r),this._pos+=e,t)},u.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var t=this._list.readUInt16BE(this._pos);return this._pos+=2,t},u.prototype._newPacket=function(){return this.packet&&(this._list.consume(this.packet.length),this.emit("packet",this.packet)),this.packet=new s,!0},u.prototype._emitError=function(t){this.error=t,this.emit("error",t)},t.exports=u},"1fb5":function(t,e,r){"use strict";e.byteLength=f,e.toByteArray=h,e.fromByteArray=b;for(var n=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function f(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function l(t,e,r){return 3*(e+r)/4-r}function h(t){var e,r,n=c(t),s=n[0],a=n[1],u=new o(l(t,s,a)),f=0,h=a>0?s-4:s;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u}function p(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function d(t,e,r){for(var n,i=[],o=e;ou?u:a+s));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},2:function(t,e){},2031:function(t,e,r){"use strict";t.exports=r("14ab")()?Object.assign:r("f60e")},2160:function(t,e,r){"use strict";var n=r("62c4"),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},2539:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";var e=this.head,r=""+e.data;while(e=e.next)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return h.alloc(0);var e=h.allocUnsafe(t>>>0),r=this.head,n=0;while(r)g(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),t-=o,0===t){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=h.allocUnsafe(t),r=this.head,n=1;r.data.copy(e),t-=r.data.length;while(r=r.next){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),t-=o,0===t){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:b,value:function(t,e){return d(this,i(i({},e),{},{depth:0,customInspect:!1}))}}]),t}()},"25be":function(t,e,r){"use strict";var n=r("f508"),i=r("b380"),o=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return o[e]?o[e]:o[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in i(t),o)if(o[e]===t)return e}))})}},"262a":function(t,e,r){"use strict";var n=r("84d3"),i=r("936a");t.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},"27bf":function(t,e,r){"use strict";t.exports=s;var n=r("b19a"),i=Object.create(r("3a7c"));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0){t=new Array(arguments.length-2);for(var e=0;e-1))throw new k(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new _("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||K(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)}}).call(this,r("c8ba"),r("f28c"))},3:function(t,e){},3022:function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),_(r)?n.showHidden=r:r&&e._extend(n,r),k(n.showHidden)&&(n.showHidden=!1),k(n.depth)&&(n.depth=2),k(n.colors)&&(n.colors=!1),k(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function c(t,e){return t}function f(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}function l(t,r,n){if(t.customInspect&&r&&j(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return S(i)||(i=l(t,i,n)),i}var o=h(t,r);if(o)return o;var s=Object.keys(r),a=f(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(j(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(x(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(R(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,_="",v=!1,m=["{","}"];if(y(r)&&(v=!0,m=["[","]"]),j(r)){var w=r.name?": "+r.name:"";_=" [Function"+w+"]"}return x(r)&&(_=" "+RegExp.prototype.toString.call(r)),R(r)&&(_=" "+Date.prototype.toUTCString.call(r)),T(r)&&(_=" "+p(r)),0!==s.length||v&&0!=r.length?n<0?x(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=v?d(t,r,n,a,s):s.map((function(e){return b(t,r,n,a,e,v)})),t.seen.pop(),g(c,_,m)):m[0]+_+m[1]}function h(t,e){if(k(e))return t.stylize("undefined","undefined");if(S(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return w(e)?t.stylize(""+e,"number"):_(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i){for(var o=[],s=0,a=e.length;s-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n"))):a=t.stylize("[Circular]","special")),k(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function g(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function y(t){return Array.isArray(t)}function _(t){return"boolean"===typeof t}function v(t){return null===t}function m(t){return null==t}function w(t){return"number"===typeof t}function S(t){return"string"===typeof t}function E(t){return"symbol"===typeof t}function k(t){return void 0===t}function x(t){return O(t)&&"[object RegExp]"===M(t)}function O(t){return"object"===typeof t&&null!==t}function R(t){return O(t)&&"[object Date]"===M(t)}function T(t){return O(t)&&("[object Error]"===M(t)||t instanceof Error)}function j(t){return"function"===typeof t}function A(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t}function M(t){return Object.prototype.toString.call(t)}e.debuglog=function(r){if(k(o)&&(o=Object({NODE_ENV:"production",BASE_URL:"/"}).NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){t.pid;s[r]=function(){e.format.apply(e,arguments)}}else s[r]=function(){};return s[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=y,e.isBoolean=_,e.isNull=v,e.isNullOrUndefined=m,e.isNumber=w,e.isString=S,e.isSymbol=E,e.isUndefined=k,e.isRegExp=x,e.isObject=O,e.isDate=R,e.isError=T,e.isFunction=j,e.isPrimitive=A,e.isBuffer=r("d60aa");function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){},e.inherits=r("28a0"),e._extend=function(t,e){if(!e||!O(e))return t;var r=Object.keys(e),n=r.length;while(n--)t[r[n]]=e[r[n]];return t};var P="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}function L(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n=0?c(f):i(this.length)-c(u(f)),e=f;ethis.length)&&(n=this.length),r>=this.length)return t||o.alloc(0);if(n<=0)return t||o.alloc(0);var i,s,a=!!t,u=this._offset(r),c=n-r,f=c,l=a&&e||0,h=u[1];if(0===r&&n==this.length){if(!a)return 1===this._bufs.length?this._bufs[0]:o.concat(this._bufs,this.length);for(s=0;si)){this._bufs[s].copy(t,l,h,h+f),l+=i;break}this._bufs[s].copy(t,l,h),l+=i,f-=i,h&&(h=0)}return t.length>l?t.slice(0,l):t},s.prototype.shallowSlice=function(t,e){t=t||0,e=e||this.length,t<0&&(t+=this.length),e<0&&(e+=this.length);var r=this._offset(t),n=this._offset(e),i=this._bufs.slice(r[0],n[0]+1);return 0==n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!=r[1]&&(i[0]=i[0].slice(r[1])),new s(i)},s.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)},s.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;while(this._bufs.length){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){for(var t=0,e=new s;tb)setTimeout(v,g,t,e,r);else{y&&"string"===typeof t&&(t=a.from(t,"utf8"));try{f.send(t)}catch(n){return r(n)}r()}}function m(t){f.close(),t()}function w(){c.setReadable(d),c.setWritable(d),c.emit("connect")}function S(){c.uncork(),c.emit("connect")}function E(){c.end(),c.destroy()}function k(t){c.destroy(t)}function x(t){var e=t.data;e=e instanceof ArrayBuffer?a.from(e):a.from(e,"utf8"),d.push(e)}function O(){f.close()}function R(t,e){for(var r=new Array(t.length),n=0;n2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}function a(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function u(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function c(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}o("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i;if("string"===typeof e&&a(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be",u(t," argument"))i="The ".concat(t," ").concat(n," ").concat(s(e,"type"));else{var o=c(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(s(e,"type"))}return i+=". Received type ".concat(typeof r),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},"5a5c":function(t,e,r){"use strict";var n=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return n.call(arguments,(function(t){e[t]=!0})),e}},"5e1a":function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=r("8707").Buffer,o=r(2);function s(t,e,r){t.copy(e,r)}t.exports=function(){function t(){n(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";var e=this.head,r=""+e.data;while(e=e.next)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;var e=i.allocUnsafe(t>>>0),r=this.head,n=0;while(r)s(r.data,e,n),n+=r.data.length,r=r.next;return e},t}(),o&&o.inspect&&o.inspect.custom&&(t.exports.prototype[o.inspect.custom]=function(){var t=o.inspect({length:this.length});return this.constructor.name+" "+t})},"5edd":function(t,e,r){"use strict";var n=r("936a"),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},6:function(t,e){},6024:function(t,e,r){"use strict";var n,i=r("e0f6"),o=r("f973"),s=r("f508"),a=r("1c4a"),u=r("06a2"),c=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",c(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,a.toStringTag,s("c","Array Iterator"))},"62c4":function(t,e,r){"use strict";var n=r("e76c")();t.exports=function(t){return t!==n&&null!==t}},6321:function(t,e,r){"use strict";var n=r("9013");t.exports=function(t){if("function"!==typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!==typeof t.length)return!1;if("function"!==typeof t.call)return!1;if("function"!==typeof t.apply)return!1}catch(e){return!1}return!n(t)}},6858:function(t,e,r){"use strict";t.exports=r("cecf")("forEach")},"692b":function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");t.exports=function(t){return"string"===typeof t||t&&"object"===typeof t&&(t instanceof String||n.call(t)===i)||!1}},7045:function(t,e,r){"use strict";var n=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(t){return"function"===typeof t&&i(n.call(t))}},7135:function(t,e,r){"use strict";var n=r("b289"),i=r("8707").Buffer,o=i.allocUnsafe(0),s=i.from([0]),a=r("f0cb"),u=r("966d").nextTick,c=a.cache,f=a.generateNumber,l=a.generateCache,h=j,p=!0;function d(t,e){switch(e.cork&&(e.cork(),u(b,e)),p&&(p=!1,l()),t.cmd){case"connect":return g(t,e);case"connack":return y(t,e);case"publish":return _(t,e);case"puback":case"pubrec":case"pubrel":case"pubcomp":case"unsuback":return v(t,e);case"subscribe":return m(t,e);case"suback":return w(t,e);case"unsubscribe":return S(t,e);case"pingreq":case"pingresp":case"disconnect":return E(t,e);default:return e.emit("error",new Error("Unknown command")),!1}}function b(t){t.uncork()}function g(t,e){var r=t||{},o=r.protocolId||"MQTT",s=r.protocolVersion||4,a=r.will,u=r.clean,c=r.keepalive||0,f=r.clientId||"",l=r.username,p=r.password;void 0===u&&(u=!0);var d=0;if(!o||"string"!==typeof o&&!i.isBuffer(o))return e.emit("error",new Error("Invalid protocolId")),!1;if(d+=o.length+2,3!==s&&4!==s)return e.emit("error",new Error("Invalid protocol version")),!1;if(d+=1,"string"!==typeof f&&!i.isBuffer(f)||!f&&4!==s||!f&&!u){if(s<4)return e.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*u===0)return e.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else d+=f.length+2;if("number"!==typeof c||c<0||c>65535||c%1!==0)return e.emit("error",new Error("Invalid keepalive")),!1;if(d+=2,d+=1,a){if("object"!==typeof a)return e.emit("error",new Error("Invalid will")),!1;if(!a.topic||"string"!==typeof a.topic)return e.emit("error",new Error("Invalid will topic")),!1;if(d+=i.byteLength(a.topic)+2,a.payload&&a.payload){if(!(a.payload.length>=0))return e.emit("error",new Error("Invalid will payload")),!1;"string"===typeof a.payload?d+=i.byteLength(a.payload)+2:d+=a.payload.length+2}else d+=2}var b=!1;if(null!=l){if(!P(l))return e.emit("error",new Error("Invalid username")),!1;b=!0,d+=i.byteLength(l)+2}if(null!=p){if(!b)return e.emit("error",new Error("Username is required to use password")),!1;if(!P(p))return e.emit("error",new Error("Invalid password")),!1;d+=I(p)+2}e.write(n.CONNECT_HEADER),R(e,d),M(e,o),e.write(4===s?n.VERSION4:n.VERSION3);var g=0;return g|=null!=l?n.USERNAME_MASK:0,g|=null!=p?n.PASSWORD_MASK:0,g|=a&&a.retain?n.WILL_RETAIN_MASK:0,g|=a&&a.qos?a.qos<0&&h(e,f),e.write(c))}function v(t,e){var r=t||{},i=r.cmd||"puback",o=r.messageId,s=r.dup&&"pubrel"===i?n.DUP_MASK:0,a=0;return"pubrel"===i&&(a=1),"number"!==typeof o?(e.emit("error",new Error("Invalid messageId")),!1):(e.write(n.ACKS[i][a][s][0]),R(e,2),h(e,o))}function m(t,e){var r=t||{},o=r.dup?n.DUP_MASK:0,s=r.messageId,a=r.subscriptions,u=0;if("number"!==typeof s)return e.emit("error",new Error("Invalid messageId")),!1;if(u+=2,"object"!==typeof a||!a.length)return e.emit("error",new Error("Invalid subscriptions")),!1;for(var c=0;c=0&&t<128?1:t>=128&&t<16384?2:t>=16384&&t<2097152?3:t>=2097152&&t<268435456?4:0}function x(t){var e=0,r=0,n=i.allocUnsafe(k(t));do{e=t%128|0,t=t/128|0,t>0&&(e|=128),n.writeUInt8(e,r++)}while(t>0);return n}Object.defineProperty(d,"cacheNumbers",{get:function(){return h===j},set:function(t){t?(c&&0!==Object.keys(c).length||(p=!0),h=j):(p=!1,h=A)}});var O={};function R(t,e){var r=O[e];r||(r=x(e),e<16384&&(O[e]=r)),t.write(r)}function T(t,e){var r=i.byteLength(e);h(t,r),t.write(e,"utf8")}function j(t,e){return t.write(c[e])}function A(t,e){return t.write(f(e))}function M(t,e){"string"===typeof e?T(t,e):e?(h(t,e.length),t.write(e)):h(t,0)}function I(t){return t?t instanceof i?t.length:i.byteLength(t):0}function P(t){return"string"===typeof t||t instanceof i}t.exports=d},"724e":function(t,e,r){"use strict";t.exports=r("29b0")()?Number.isNaN:r("56c4")},7373:function(t,e,r){"use strict";var n=r("62c4"),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},"73bb":function(t,e,r){e=t.exports=r("c7fb"),e.Stream=e,e.Readable=e,e.Writable=r("2a39"),e.Duplex=r("4c72"),e.Transform=r("b798"),e.PassThrough=r("e5b1"),e.finished=r("d933"),e.pipeline=r("e15e")},"780f":function(t,e,r){"use strict";t.exports=o;var n=r("27bf"),i=Object.create(r("3a7c"));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r("3fb5"),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},"7bdf":function(t,e,r){"use strict";t.exports=r("ecf9")()?Object.keys:r("7373")},"7c4a":function(t,e,r){"use strict";t.exports=r("ff55")()?globalThis:r("c2c0")},"7d72":function(t,e,r){"use strict";var n=r("8707").Buffer,i=n.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){if(!t)return"utf8";var e;while(1)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function s(t){var e=o(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}function a(t){var e;switch(this.encoding=s(t),this.encoding){case"utf16le":this.text=d,this.end=b,e=4;break;case"utf8":this.fillLast=l,e=4;break;case"base64":this.text=g,this.end=y,e=3;break;default:return this.write=_,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function u(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function c(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0))}function f(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"�"}}function l(t){var e=this.lastTotal-this.lastNeed,r=f(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){var r=c(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function d(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function b(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function g(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function y(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}e.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})),e)}},"7dc8":function(t,e,r){"use strict";var n=r("84d3"),i=r("1793");t.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},"7f0f":function(t,e,r){"use strict";var n=r("8707").Buffer,i=r("7135"),o=r("faa1").EventEmitter,s=r("3fb5");function a(t){var e=new u;return i(t,e),e.concat()}function u(){this._array=new Array(20),this._i=0}s(u,o),u.prototype.write=function(t){return this._array[this._i++]=t,!0},u.prototype.concat=function(){var t,e,r=0,i=new Array(this._array.length),o=this._array,s=0;for(t=0;t=55296&&_<=56319&&(S+=t[++r])),S=E?h.call(E,k,S,b):S,e?(p.value=S,d(g,b,p)):g[b]=S,++b;y=b}if(void 0===y)for(y=s(t.length),e&&(g=new e(y)),r=0;r>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+l>=1?h/u:h*Math.pow(2,1-l),e*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*b}},"91dd":function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!==typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;o&&"number"===typeof o.maxKeys&&(u=o.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var f=0;f=0?(l=b.substr(0,g),h=b.substr(g+1)):(l=b,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),n(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},"91e3":function(t,e,r){"use strict";var n=r("e9bd"),i=r("62c4"),o=r("692b"),s=r("1c4a").iterator,a=Array.isArray;t.exports=function(t){return!!i(t)&&(!!a(t)||(!!o(t)||(!!n(t)||"function"===typeof t[s])))}},"936a":function(t,e,r){"use strict";var n=void 0;t.exports=function(t){return t!==n&&null!==t}},"94ee":function(t,e,r){"use strict";var n,i,o,s=r("f508"),a=r("b380"),u=r("7c4a").Symbol,c=r("964d"),f=r("e03f"),l=r("25be"),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"===typeof u)try{String(u()),o=!0}catch(b){}else u=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return n(t)},t.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return o?u(e):(r=h(i.prototype),e=void 0===e?"":String(e),p(r,{__description__:s("",e),__name__:s("",c(e))}))},f(n),l(n),p(i.prototype,{constructor:s(n),toString:s("",(function(){return this.__name__}))}),p(n.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),d(n.prototype,n.toPrimitive,s("",(function(){var t=a(this);return"symbol"===typeof t?t:t.toString()}))),d(n.prototype,n.toStringTag,s("c","Symbol")),d(i.prototype,n.toStringTag,s("c",n.prototype[n.toStringTag])),d(i.prototype,n.toPrimitive,s("c",n.prototype[n.toPrimitive]))},"964d":function(t,e,r){"use strict";var n=r("f508"),i=Object.create,o=Object.defineProperty,s=Object.prototype,a=i(null);t.exports=function(t){var e,r,i=0;while(a[t+(i||"")])++i;return t+=i||"",a[t]=!0,e="@@"+t,o(s,e,n.gs(null,(function(t){r||(r=!0,o(this,e,n(t)),r=!1)}))),e}},"966d":function(t,e,r){"use strict";(function(e){function r(t,r,n,i){if("function"!==typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:o=new Array(a-1),s=0;while(s0?("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=l(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):k(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?k(t,s,e,!1):P(t,s)):k(t,s,e,!1))):n||(s.reading=!1));return O(s)}function k(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&M(t)),P(t,e)}function x(t,e){var r;return h(e)||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function O(t){return!t.ended&&(t.needReadable||t.length=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function j(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=T(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,M(t)}}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(b("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(I,t):I(t))}function I(t){b("emit readable"),t.emit("readable"),B(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){var r=e.length;while(!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=W(t,e.buffer,e.decoder),r);var r}function W(t,e,r){var n;return to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),t-=s,0===t){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}function H(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;while(n=n.next){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),t-=s,0===t){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function K(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(z,e,t))}function z(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Y(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return b("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?K(this):M(this),null;if(t=j(t,e),0===t&&e.ended)return 0===e.length&&K(this),null;var n,i=e.needReadable;return b("need readable",i),(0===e.length||e.length-t0?q(t,e):null,null===n?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&K(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},S.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t);break}o.pipesCount+=1,b("pipe count=%d opts=%j",o.pipesCount,e);var s=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr,u=s?f:w;function c(t,e){b("onunpipe"),t===r&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,p())}function f(){b("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",c);var l=L(r);t.on("drain",l);var h=!1;function p(){b("cleanup"),t.removeListener("close",_),t.removeListener("finish",v),t.removeListener("drain",l),t.removeListener("error",y),t.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",w),r.removeListener("data",g),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l()}var d=!1;function g(e){b("ondata"),d=!1;var n=t.write(e);!1!==n||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==Y(o.pipes,t))&&!h&&(b("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function y(e){b("onerror",e),w(),t.removeListener("error",y),0===a(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",v),w()}function v(){b("onfinish"),t.removeListener("close",_),w()}function w(){b("unpipe"),r.unpipe(t)}return r.on("data",g),m(t,"error",y),t.once("close",_),t.once("finish",v),t.emit("pipe",r),o.flowing||(b("pipe resume"),r.resume()),t},S.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o * @license MIT */ var n=r("1fb5"),i=r("9152"),o=r("e3db");function s(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),c.alloc(+t)}function m(t,e){if(c.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(t).length;default:if(n)return $(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return D(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function E(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:k(t,e,r,n,i);if("number"===typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:o=t[i+1],128===(192&o)&&(u=(31&c)<<6|63&o,u>127&&(f=u));break;case 3:o=t[i+1],s=t[i+2],128===(192&o)&&128===(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s,u>2047&&(u<55296||u>57343)&&(f=u));break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a,u>65535&&u<1114112&&(f=u))}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return C(n)}e.Buffer=c,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return f(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return h(null,t,e,r)},c.allocUnsafe=function(t){return p(null,t)},c.allocUnsafeSlow=function(t){return p(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},c.prototype.compare=function(t,e,r,n,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return R(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function C(t){var e=t.length;if(e<=P)return String.fromCharCode.apply(String,t);var r="",n=0;while(nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function q(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function W(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function F(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function H(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function K(t,e,r,n,o){return o||H(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function z(t,e,r,n,o){return o||H(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(i*=256))n+=this[t+--e]*i;return n},c.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);var n=this[t],i=1,o=0;while(++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);var n=e,i=1,o=this[t+--n];while(n>0&&(i*=256))o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;q(this,t,e,r,i,0)}var o=1,s=0;this[e]=255&t;while(++s=0&&(s*=256))this[e+o]=t/s&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;this[e]=255&t;while(++o>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;this[e+o]=255&t;while(--o>=0&&(s*=256))t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||q(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return K(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return K(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n)}return o}function X(t){return n.toByteArray(V(t))}function tt(t,e,r,n){for(var i=0;i=e.length||i>=t.length)break;e[i+r]=t[i]}return i}function et(t){return t!==t}}).call(this,r("c8ba"))},b779:function(t,e,r){"use strict";t.exports=function(){return"undefined"!==typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)}()},b798:function(t,e,r){"use strict";t.exports=f;var n=r("5716").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r("4c72");function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length=55296&&g<=56319&&(b+=t[++p])),u.call(e,y,b,l),h)break}else c.call(t,(function(t){return u.call(e,y,t,l),h}))}},c5f4:function(t,e,r){"use strict";var n=r("bae6"),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?n(t)*o(i(t)):t)}},c682:function(t,e,r){"use strict";t.exports=r("5a5c")("key","value","key+value")},c7fb:function(t,e,r){"use strict";(function(e,n){var i;t.exports=j,j.ReadableState=T;r("faa1").EventEmitter;var o=function(t,e){return t.listeners(e).length},s=r("37a3"),a=r("b639").Buffer,u=("undefined"!==typeof e?e:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};function c(t){return a.from(t)}function f(t){return a.isBuffer(t)||t instanceof u}var l,h=r(5);l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,d,b,g=r("2539"),y=r("b97c2"),_=r("d329"),v=_.getHighWaterMark,m=r("5716").codes,w=m.ERR_INVALID_ARG_TYPE,S=m.ERR_STREAM_PUSH_AFTER_EOF,E=m.ERR_METHOD_NOT_IMPLEMENTED,k=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("3fb5")(j,s);var x=y.errorOrDestroy,O=["error","close","destroy","pause","resume"];function R(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}function T(t,e,n){i=i||r("4c72"),t=t||{},"boolean"!==typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",n),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r("7d72").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function j(t){if(i=i||r("4c72"),!(this instanceof j))return new j(t);var e=this instanceof i;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,n,i){l("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,N(t,s);else if(i||(o=I(s,e)),o)x(t,o);else if(s.objectMode||e&&e.length>0)if("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=c(e)),n)s.endEmitted?x(t,new k):M(t,s,e,!0);else if(s.ended)x(t,new S);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?M(t,s,e,!1):B(t,s)):M(t,s,e,!1)}else n||(s.reading=!1,B(t,s));return!s.ended&&(s.length=P?t=P:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function L(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=C(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function N(t,e){if(l("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?D(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,U(t)))}}function D(t){var e=t._readableState;l("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(U,t))}function U(t){var e=t._readableState;l("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Y(t)}function B(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(q,t,e))}function q(t,e){while(!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function H(t){l("readable nexttick read 0"),t.read(0)}function K(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(z,t,e))}function z(t,e){l("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Y(t),e.flowing&&!e.reading&&t.read(0)}function Y(t){var e=t._readableState;l("flow",e.flowing);while(e.flowing&&null!==t.read());}function V(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function Q(t){var e=t._readableState;l("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(G,e,t))}function G(t,e){if(l("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function $(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Q(this):D(this),null;if(t=L(t,e),0===t&&e.ended)return 0===e.length&&Q(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?V(t,e):null,null===n?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Q(this)),null!==n&&this.emit("data",n),n},j.prototype._read=function(t){x(this,new E("_read()"))},j.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr,a=s?c:_;function u(t,e){l("onunpipe"),t===r&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,p())}function c(){l("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",u);var f=W(r);t.on("drain",f);var h=!1;function p(){l("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",_),r.removeListener("data",d),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}function d(e){l("ondata");var n=t.write(e);l("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==$(i.pipes,t))&&!h&&(l("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function b(e){l("onerror",e),_(),t.removeListener("error",b),0===o(t,"error")&&x(t,e)}function g(){t.removeListener("finish",y),_()}function y(){l("onfinish"),t.removeListener("close",g),_()}function _(){l("unpipe"),r.unpipe(t)}return r.on("data",d),R(t,"error",b),t.once("close",g),t.once("finish",y),t.emit("pipe",r),i.flowing||(l("pipe resume"),r.resume()),t},j.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,l("on readable",i.length,i.reading),i.length?D(this):i.reading||n.nextTick(H,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(F,this),r},j.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(F,this),e},j.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!t.readableListening,K(this,t)),t.paused=!1,this},j.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){if(l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){var o=e.push(i);o||(n=!0,t.pause())}})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1?setImmediate:i.nextTick;v.WritableState=_;var u=Object.create(r("3a7c"));u.inherits=r("3fb5");var c={deprecate:r("b7d1")},f=r("429b"),l=r("8707").Buffer,h=n.Uint8Array||function(){};function p(t){return l.from(t)}function d(t){return l.isBuffer(t)||t instanceof h}var b,g=r("4681");function y(){}function _(t,e){s=s||r("b19a"),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,a=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){R(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function v(t){if(s=s||r("b19a"),!b.call(v,this)&&!(this instanceof s))return new v(t);this._writableState=new _(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),f.call(this)}function m(t,e){var r=new Error("write after end");t.emit("error",r),i.nextTick(e,r)}function w(t,e,r,n){var o=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(n,s),o=!1),o}function S(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=l.from(e,r)),e}function E(t,e,r,n,i,o){if(!r){var s=S(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||L(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r("f28c"),r("c8ba"))},df86:function(t,e,r){"use strict";(function(e,n){var i=r("faa1"),o=r("ea08"),s=r("ab52"),a=r("3409"),u=r("e372").Writable,c=r("3fb5"),f=r("29a2"),l=r("ae84"),h=r("53a8"),p=e.setImmediate||function(t){n.nextTick(t)},d={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0};function b(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function g(t,e,r){t.emit("packetsend",e);var n=a.writeToStream(e,t.stream);!n&&r?t.stream.once("drain",r):r&&r()}function y(t){t&&Object.keys(t).forEach((function(e){"function"===typeof t[e]&&(t[e](new Error("Connection closed")),delete t[e])}))}function _(t,e,r){t.outgoingStore.put(e,(function(n){if(n)return r&&r(n);g(t,e,r)}))}function v(){}function m(t,e){var r,n=this;if(!(this instanceof m))return new m(t,e);for(r in this.options=e||{},d)"undefined"===typeof this.options[r]?this.options[r]=d[r]:this.options[r]=e[r];this.options.clientId="string"===typeof this.options.clientId?this.options.clientId:b(),this.streamBuilder=t,this.outgoingStore=this.options.outgoingStore||new o,this.incomingStore=this.options.incomingStore||new o,this.queueQoSZero=void 0===this.options.queueQoSZero||this.options.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this.on("connect",(function(){if(!this.disconnected){this.connected=!0;var t=this.outgoingStore.createStream();this.once("close",e),t.on("end",(function(){n.removeListener("close",e)})),t.on("error",(function(t){n.removeListener("close",e),n.emit("error",t)})),r()}function e(){t.destroy(),t=null}function r(){if(t){var e,i=t.read(1);i?n.disconnecting||n.reconnectTimer?t.destroy&&t.destroy():(e=n.outgoing[i.messageId],n.outgoing[i.messageId]=function(t,n){e&&e(t,n),r()},n._sendPacket(i)):t.once("readable",r)}}})),this.on("close",(function(){this.connected=!1,clearTimeout(this.connackTimer)})),this.on("connect",this._setupPingTimer),this.on("connect",(function(){var t=this.queue;function e(){var r=t.shift(),i=null;r&&(i=r.packet,n._sendPacket(i,(function(t){r.cb&&r.cb(t),e()})))}e()}));var s=!0;this.on("connect",(function(){!s&&this.options.clean&&Object.keys(this._resubscribeTopics).length>0&&(this.options.resubscribe?(this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)):this._resubscribeTopics={}),s=!1})),this.on("close",(function(){null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null)})),this.on("close",this._setupReconnect),i.EventEmitter.call(this),this._setupStream()}c(m,i.EventEmitter),m.prototype._setupStream=function(){var t,e=this,r=new u,i=a.parser(this.options),o=null,c=[];function f(){n.nextTick(l)}function l(){var t=c.shift(),r=o;t?e._handlePacket(t,f):(o=null,r())}this._clearReconnect(),this.stream=this.streamBuilder(this),i.on("packet",(function(t){c.push(t)})),r._write=function(t,e,r){o=r,i.parse(t),l()},this.stream.pipe(r),this.stream.on("error",v),s(this.stream,this.emit.bind(this,"close")),t=Object.create(this.options),t.cmd="connect",g(this,t),i.on("error",this.emit.bind(this,"error")),this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){e._cleanUp(!0)}),this.options.connectTimeout)},m.prototype._handlePacket=function(t,e){switch(this.emit("packetreceive",t),t.cmd){case"publish":this._handlePublish(t,e);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(t),e();break;case"pubrel":this._handlePubrel(t,e);break;case"connack":this._handleConnack(t),e();break;case"pingresp":this._handlePingresp(t),e();break;default:break}},m.prototype._checkDisconnecting=function(t){return this.disconnecting&&(t?t(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},m.prototype.publish=function(t,e,r,n){var i;"function"===typeof r&&(n=r,r=null);var o={qos:0,retain:!1,dup:!1};if(r=h(o,r),this._checkDisconnecting(n))return this;switch(i={cmd:"publish",topic:t,payload:e,qos:r.qos,retain:r.retain,messageId:this._nextId(),dup:r.dup},r.qos){case 1:case 2:this.outgoing[i.messageId]=n||v,this._sendPacket(i);break;default:this._sendPacket(i,n);break}return this},m.prototype.subscribe=function(){var t,e,r=Array.prototype.slice.call(arguments),n=[],i=r.shift(),o=i.resubscribe,s=r.pop()||v,a=r.pop(),u=this;if(delete i.resubscribe,"string"===typeof i&&(i=[i]),"function"!==typeof s&&(a=s,s=v),e=l.validateTopics(i),null!==e)return p(s,new Error("Invalid topic "+e)),this;if(this._checkDisconnecting(s))return this;var c={qos:0};if(a=h(c,a),Array.isArray(i)?i.forEach((function(t){(u._resubscribeTopics[t]0&&(u._resubscribeTopics[t.topic]=t.qos,f.push(t.topic))})),u.messageIdToTopic[t.messageId]=f}return this.outgoing[t.messageId]=function(t,e){if(!t)for(var r=e.granted,i=0;i0?this.once("outgoingEmpty",setTimeout.bind(null,i,10)):i()),this},m.prototype.removeOutgoingMessage=function(t){var e=this.outgoing[t];return delete this.outgoing[t],this.outgoingStore.del({messageId:t},(function(){e(new Error("Message removed"))})),this},m.prototype.reconnect=function(t){var e=this,r=function(){t?(e.options.incomingStore=t.incomingStore,e.options.outgoingStore=t.outgoingStore):(e.options.incomingStore=null,e.options.outgoingStore=null),e.incomingStore=e.options.incomingStore||new o,e.outgoingStore=e.options.outgoingStore||new o,e.disconnecting=!1,e.disconnected=!1,e._deferredReconnect=null,e._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},m.prototype._reconnect=function(){this.emit("reconnect"),this._setupStream()},m.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0&&(this.reconnecting||(this.emit("offline"),this.reconnecting=!0),t.reconnectTimer=setInterval((function(){t._reconnect()}),t.options.reconnectPeriod))},m.prototype._clearReconnect=function(){this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},m.prototype._cleanUp=function(t,e){e&&this.stream.on("close",e),t?(0===this.options.reconnectPeriod&&this.options.clean&&y(this.outgoing),this.stream.destroy()):this._sendPacket({cmd:"disconnect"},p.bind(null,this.stream.end.bind(this.stream))),this.disconnecting||(this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(this.stream.removeListener("close",e),e())},m.prototype._sendPacket=function(t,e){if(this.connected){switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void _(this,t,e);default:return void g(this,t,e)}switch(t.qos){case 2:case 1:_(this,t,e);break;case 0:default:g(this,t,e);break}}else 0===(t.qos||0)&&this.queueQoSZero||"publish"!==t.cmd?this.queue.push({packet:t,cb:e}):t.qos>0?(e=this.outgoing[t.messageId],this.outgoingStore.put(t,(function(t){if(t)return e&&e(t)}))):e&&e(new Error("No connection to broker"))},m.prototype._setupPingTimer=function(){var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=f((function(){t._checkPing()}),1e3*this.options.keepalive))},m.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},m.prototype._checkPing=function(){this.pingResp?(this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):this._cleanUp(!0)},m.prototype._handlePingresp=function(){this.pingResp=!0},m.prototype._handleConnack=function(t){var e=t.returnCode,r=["","Unacceptable protocol version","Identifier rejected","Server unavailable","Bad username or password","Not authorized"];if(clearTimeout(this.connackTimer),0===e)this.reconnecting=!1,this.emit("connect",t);else if(e>0){var n=new Error("Connection refused: "+r[e]);n.code=e,this.emit("error",n)}},m.prototype._handlePublish=function(t,e){e="undefined"!==typeof e?e:v;var r=t.topic.toString(),n=t.payload,i=t.qos,o=t.messageId,s=this;switch(i){case 2:this.incomingStore.put(t,(function(t){if(t)return e(t);s._sendPacket({cmd:"pubrec",messageId:o},e)}));break;case 1:this.emit("message",r,n,t),this.handleMessage(t,(function(t){if(t)return e(t);s._sendPacket({cmd:"puback",messageId:o},e)}));break;case 0:this.emit("message",r,n,t),this.handleMessage(t,e);break;default:break}},m.prototype.handleMessage=function(t,e){e()},m.prototype._handleAck=function(t){var e=t.messageId,r=t.cmd,n=null,i=this.outgoing[e],o=this;if(i){switch(r){case"pubcomp":case"puback":delete this.outgoing[e],this.outgoingStore.del(t,i);break;case"pubrec":n={cmd:"pubrel",qos:2,messageId:e},this._sendPacket(n);break;case"suback":if(delete this.outgoing[e],1===t.granted.length&&0!==(128&t.granted[0])){var s=this.messageIdToTopic[e];s&&s.forEach((function(t){delete o._resubscribeTopics[t]}))}i(null,t);break;case"unsuback":delete this.outgoing[e],i(null);break;default:o.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}},m.prototype._handlePubrel=function(t,e){e="undefined"!==typeof e?e:v;var r=t.messageId,n=this,i={cmd:"pubcomp",messageId:r};n.incomingStore.get(t,(function(r,o){r||"pubrel"===o.cmd?n._sendPacket(i,e):(n.emit("message",o.topic,o.payload,o),n.incomingStore.put(t,(function(t){if(t)return e(t);n.handleMessage(o,(function(t){if(t)return e(t);n._sendPacket(i,e)}))})))}))},m.prototype._nextId=function(){var t=this.nextId++;return 65536===this.nextId&&(this.nextId=1),t},m.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},t.exports=m}).call(this,r("c8ba"),r("f28c"))},e03f:function(t,e,r){"use strict";var n=r("f508"),i=r("7c4a").Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",i&&i.hasInstance||t("hasInstance")),isConcatSpreadable:n("",i&&i.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",i&&i.iterator||t("iterator")),match:n("",i&&i.match||t("match")),replace:n("",i&&i.replace||t("replace")),search:n("",i&&i.search||t("search")),species:n("",i&&i.species||t("species")),split:n("",i&&i.split||t("split")),toPrimitive:n("",i&&i.toPrimitive||t("toPrimitive")),toStringTag:n("",i&&i.toStringTag||t("toStringTag")),unscopables:n("",i&&i.unscopables||t("unscopables"))})}},e099:function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"===typeof t?o(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n0;return f(t,s,a,(function(t){n||(n=t),t&&o.forEach(l),s||(o.forEach(l),i(n))}))}));return e.reduce(h)}t.exports=d},e19c:function(t,e,r){"use strict";var n,i=r("2160"),o=r("96ae"),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||i(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),i=s.call(t.nullPolyfill,e),i&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&a(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{t=n.set,t.call(e,r)}catch(i){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:(e={},e.__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),r("ba4b")},e372:function(t,e,r){e=t.exports=r("ad71"),e.Stream=e,e.Readable=e,e.Writable=r("dc14"),e.Duplex=r("b19a"),e.Transform=r("27bf"),e.PassThrough=r("780f")},e3db:function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},e5b1:function(t,e,r){"use strict";t.exports=i;var n=r("b798");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r("3fb5")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},e76c:function(t,e,r){"use strict";t.exports=function(){}},e7fc:function(t,e,r){"use strict";(function(e){var n=r("df86"),i=r("ea08"),o=r("0b16"),s=r("53a8"),a={};function u(t){var e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function c(t,e){if("object"!==typeof t||e||(e=t,t=null),e=e||{},t){var r=o.parse(t,!0);if(null!=r.port&&(r.port=Number(r.port)),e=s(r,e),null===e.protocol)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(u(e),e.query&&"string"===typeof e.query.clientId&&(e.clientId=e.query.clientId),e.cert&&e.key){if(!e.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs"].indexOf(e.protocol))switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;default:throw new Error('Unknown protocol for secure connection: "'+e.protocol+'"!')}}if(!a[e.protocol]){var i=-1!==["mqtts","wss"].indexOf(e.protocol);e.protocol=["mqtt","mqtts","ws","wss","wx","wxs"].filter((function(t,e){return(!i||e%2!==0)&&"function"===typeof a[t]}))[0]}if(!1===e.clean&&!e.clientId)throw new Error("Missing clientId for unclean clients");function c(t){return e.servers&&(t._reconnectCount&&t._reconnectCount!==e.servers.length||(t._reconnectCount=0),e.host=e.servers[t._reconnectCount].host,e.port=e.servers[t._reconnectCount].port,e.protocol=e.servers[t._reconnectCount].protocol?e.servers[t._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,t._reconnectCount++),a[e.protocol](t,e)}return e.protocol&&(e.defaultProtocol=e.protocol),new n(c,e)}"browser"!==e.title?(a.mqtt=r("05ee"),a.tcp=r("05ee"),a.ssl=r("fe3c"),a.tls=r("fe3c"),a.mqtts=r("fe3c")):(a.wx=r("8311"),a.wxs=r("8311")),a.ws=r("fcb9"),a.wss=r("fcb9"),t.exports=c,t.exports.connect=c,t.exports.MqttClient=n,t.exports.Store=i}).call(this,r("f28c"))},e9bd:function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call(function(){return arguments}());t.exports=function(t){return n.call(t)===i}},ea08:function(t,e,r){"use strict";(function(e){var n=r("53a8"),i=r("e372").Readable,o={objectMode:!0},s={clean:!0},a=r("546b");function u(t){if(!(this instanceof u))return new u(t);this.options=t||{},this.options=n(s,t),this._inflights=new a}u.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this},u.prototype.createStream=function(){var t=new i(o),r=!1,n=[],s=0;return this._inflights.forEach((function(t,e){n.push(t)})),t._read=function(){!r&&s0?1:-1}},f0cb:function(t,e,r){"use strict";var n=r("8707").Buffer,i=65536,o={};function s(t){var e=n.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(255&t,1),e}function a(){for(var t=0;t-1}},f973:function(t,e,r){"use strict";t.exports=r("18ec")()?String.prototype.contains:r("f967")},f9c1:function(t,e){function r(t){var e=t._readableState;return e?e.objectMode||"number"===typeof t._duplexState?t.read():t.read(n(e)):null}function n(t){return t.buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length}t.exports=r},faa1:function(t,e,r){"use strict";var n,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};function s(t){console&&console.warn}n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function f(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o,a;if(f(r),o=t._events,void 0===o?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"===typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=l(t),i>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s(u)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=p.bind(n);return i.listener=r,n.wrapFn=i,i}function b(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?v(i):y(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(t,e){for(var r=new Array(e),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"===typeof u)o(u,this,e);else{var c=u.length,f=y(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():_(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,r,n;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return b(this,t,!0)},u.prototype.rawListeners=function(t){return b(this,t,!1)},u.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},u.prototype.listenerCount=g,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},fb12:function(t,e,r){(function(e,n){var i=r("e372"),o=r("ab52"),s=r("3fb5"),a=r("f9c1"),u=e.from&&e.from!==Uint8Array.from?e.from([0]):new e([0]),c=function(t,e){t._corked?t.once("uncork",e):e()},f=function(t,e){t._autoDestroy&&t.destroy(e)},l=function(t,e){return function(r){r?f(t,"premature close"===r.message?null:r):e&&!t._ended&&t.end()}},h=function(t,e){return t?t._writableState&&t._writableState.finished?e():t._writableState?t.end(e):(t.end(),void e()):e()},p=function(t){return new i.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},d=function(t,e,r){if(!(this instanceof d))return new d(t,e,r);i.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};s(d,i.Duplex),d.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new d(t,e,r)},d.prototype.cork=function(){1===++this._corked&&this.emit("cork")},d.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},d.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed)t&&t.destroy&&t.destroy();else if(null!==t&&!1!==t){var e=this,r=o(t,{writable:!0,readable:!1},l(this,this._forwardEnd)),i=function(){var t=e._ondrain;e._ondrain=null,t&&t()},s=function(){e._writable.removeListener("drain",i),r()};this._unwrite&&n.nextTick(i),this._writable=t,this._writable.on("drain",i),this._unwrite=s,this.uncork()}else this.end()},d.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed)t&&t.destroy&&t.destroy();else{if(null===t||!1===t)return this.push(null),void this.resume();var e=this,r=o(t,{writable:!1,readable:!0},l(this)),n=function(){e._forward()},i=function(){e.push(null)},s=function(){e._readable2.removeListener("readable",n),e._readable2.removeListener("end",i),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:p(t),this._readable2.on("readable",n),this._readable2.on("end",i),this._unread=s,this._forward()}},d.prototype._read=function(){this._drained=!0,this._forward()},d.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var t;this._forwarding=!0;while(this._drained&&null!==(t=a(this._readable2)))this.destroyed||(this._drained=this.push(t));this._forwarding=!1}},d.prototype.destroy=function(t){if(!this.destroyed){this.destroyed=!0;var e=this;n.nextTick((function(){e._destroy(t)}))}},d.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},d.prototype._write=function(t,e,r){return this.destroyed?r():this._corked?c(this,this._write.bind(this,t,e,r)):t===u?this._finish(r):this._writable?void(!1===this._writable.write(t)?this._ondrain=r:r()):r()},d.prototype._finish=function(t){var e=this;this.emit("preend"),c(this,(function(){h(e._forwardEnd&&e._writable,(function(){!1===e._writableState.prefinished&&(e._writableState.prefinished=!0),e.emit("prefinish"),c(e,t)}))}))},d.prototype.end=function(t,e,r){return"function"===typeof t?this.end(null,null,t):"function"===typeof e?this.end(t,null,e):(this._ended=!0,t&&this.write(t),this._writableState.ending||this.write(u),i.Writable.prototype.end.call(this,r))},t.exports=d}).call(this,r("b639").Buffer,r("f28c"))},fcb9:function(t,e,r){"use strict";(function(e){var n=r("553e"),i=r("0b16"),o=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],s="browser"===e.title;function a(t,e){var r=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"===typeof t.transformWsUrl&&(r=t.transformWsUrl(r,t,e)),r}function u(t){t.hostname||(t.hostname="localhost"),t.port||("wss"===t.protocol?t.port=443:t.port=80),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={}),s||"wss"!==t.protocol||o.forEach((function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])}))}function c(t,e){var r="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";u(e);var i=a(e,t);return n(i,[r],e.wsOptions)}function f(t,e){return c(t,e)}function l(t,e){if(e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"===typeof document)throw new Error("Could not determine host. Specify host manually.");var r=i.parse(document.URL);e.hostname=r.hostname,e.port||(e.port=r.port)}return c(t,e)}t.exports=s?l:f}).call(this,r("f28c"))},fe3c:function(t,e,r){"use strict";var n=r(4);function i(t,e){var r;function i(n){e.rejectUnauthorized&&t.emit("error",n),r.end()}return e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=!1!==e.rejectUnauthorized,delete e.path,r=n.connect(e),r.on("secureConnect",(function(){e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",i)})),r.on("error",i),r}t.exports=i},ff55:function(t,e,r){"use strict";t.exports=function(){return"object"===typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}}}]);