UNPKG

@mindconnect/mindconnect-nodejs

Version:

NodeJS Library for Siemens Insights Hub Connectivity - TypeScript SDK for Insights Hub and Industrial IoT - Command Line Interface - Insights Hub Development Proxy (Siemens Insights Hub was formerly known as MindSphere)

1 lines 1.13 MB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@mindconnect/mindconnect-nodejs"]=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){var t=e.default;if("function"==typeof t){var a=function(){return t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),a}var i={},n={},r={exports:{}},o="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function s(){throw new Error("setTimeout has not been defined")}function p(){throw new Error("clearTimeout has not been defined")}var d=s,l=p;function c(e){if(d===setTimeout)return setTimeout(e,0);if((d===s||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}"function"==typeof o.setTimeout&&(d=setTimeout),"function"==typeof o.clearTimeout&&(l=clearTimeout);var u,m=[],h=!1,f=-1;function v(){h&&u&&(h=!1,u.length?m=u.concat(m):f=-1,m.length&&y())}function y(){if(!h){var e=c(v);h=!0;for(var t=m.length;t;){for(u=m,m=[];++f<t;)u&&u[f].run();f=-1,t=m.length}u=null,h=!1,function(e){if(l===clearTimeout)return clearTimeout(e);if((l===p||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}(e)}}function g(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];m.push(new w(e,t)),1!==m.length||h||c(y)}function w(e,t){this.fun=e,this.array=t}w.prototype.run=function(){this.fun.apply(null,this.array)};function b(){}var _=b,x=b,E=b,T=b,S=b,A=b,N=b;var $=o.performance||{},k=$.now||$.mozNow||$.msNow||$.oNow||$.webkitNow||function(){return(new Date).getTime()};var R=new Date;var D={nextTick:g,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:_,addListener:x,once:E,off:T,removeListener:S,removeAllListeners:A,emit:N,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*k.call($),a=Math.floor(t),i=Math.floor(t%1*1e9);return e&&(a-=e[0],(i-=e[1])<0&&(a--,i+=1e9)),[a,i]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-R)/1e3}},C=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(void 0===D||void 0===D.domain)throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||C.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||C.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||C.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=C.DEFAULT_MAX_PENDING};C.DEFAULT_TIMEOUT=0,C.DEFAULT_MAX_OCCUPATION_TIME=0,C.DEFAULT_MAX_EXECUTION_TIME=0,C.DEFAULT_MAX_PENDING=1e3,C.prototype.acquire=function(e,t,a,i){if(Array.isArray(e))return this._acquireBatch(e,t,a,i);if("function"!=typeof t)throw new Error("You must pass a function to execute");var n=null,r=null,o=null;"function"!=typeof a&&(i=a,a=null,o=new this.Promise((function(e,t){n=e,r=t}))),i=i||{};var s=!1,p=null,d=null,l=null,c=this,u=function(t,i,p){d&&(clearTimeout(d),d=null),l&&(clearTimeout(l),l=null),t&&(c.queues[e]&&0===c.queues[e].length&&delete c.queues[e],c.domainReentrant&&delete c.domains[e]),s||(o?i?r(i):n(p):"function"==typeof a&&a(i,p),s=!0),t&&c.queues[e]&&c.queues[e].length>0&&c.queues[e].shift()()},m=function(a){if(s)return u(a);p&&(clearTimeout(p),p=null),c.domainReentrant&&a&&(c.domains[e]=D.domain);var n=i.maxExecutionTime||c.maxExecutionTime;if(n&&(l=setTimeout((function(){c.queues[e]&&u(a,new Error("Maximum execution time is exceeded "+e))}),n)),1===t.length){var r=!1;try{t((function(e,t){r||(r=!0,u(a,e,t))}))}catch(e){r||(r=!0,u(a,e))}}else c._promiseTry((function(){return t()})).then((function(e){u(a,void 0,e)}),(function(e){u(a,e)}))};c.domainReentrant&&D.domain&&(m=D.domain.bind(m));var h=i.maxPending||c.maxPending;if(c.queues[e])if(c.domainReentrant&&D.domain&&D.domain===c.domains[e])m(!1);else if(c.queues[e].length>=h)u(!1,new Error("Too many pending tasks in queue "+e));else{var f=function(){m(!0)};i.skipQueue?c.queues[e].unshift(f):c.queues[e].push(f);var v=i.timeout||c.timeout;v&&(p=setTimeout((function(){p=null,u(!1,new Error("async-lock timed out in queue "+e))}),v))}else c.queues[e]=[],m(!0);var y=i.maxOccupationTime||c.maxOccupationTime;return y&&(d=setTimeout((function(){c.queues[e]&&u(!1,new Error("Maximum occupation time is exceeded in queue "+e))}),y)),o||void 0},C.prototype._acquireBatch=function(e,t,a,i){"function"!=typeof a&&(i=a,a=null);var n=this,r=e.reduceRight((function(e,t){return function(e,t){return function(a){n.acquire(e,t,a,i)}}(t,e)}),t);if("function"!=typeof a)return new this.Promise((function(e,t){1===r.length?r((function(a,i){a?t(a):e(i)})):e(r())}));r(a)},C.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},C.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}};var G=C;!function(e){e.exports=G}(r);var I={exports:{}};function O(){}function P(){P.init.call(this)}function U(e){return void 0===e._maxListeners?P.defaultMaxListeners:e._maxListeners}function M(e,t,a){if(t)e.call(a);else for(var i=e.length,n=B(e,i),r=0;r<i;++r)n[r].call(a)}function j(e,t,a,i){if(t)e.call(a,i);else for(var n=e.length,r=B(e,n),o=0;o<n;++o)r[o].call(a,i)}function L(e,t,a,i,n){if(t)e.call(a,i,n);else for(var r=e.length,o=B(e,r),s=0;s<r;++s)o[s].call(a,i,n)}function z(e,t,a,i,n,r){if(t)e.call(a,i,n,r);else for(var o=e.length,s=B(e,o),p=0;p<o;++p)s[p].call(a,i,n,r)}function V(e,t,a,i){if(t)e.apply(a,i);else for(var n=e.length,r=B(e,n),o=0;o<n;++o)r[o].apply(a,i)}function H(e,t,a,i){var n,r,o,s;if("function"!=typeof a)throw new TypeError('"listener" argument must be a function');if((r=e._events)?(r.newListener&&(e.emit("newListener",t,a.listener?a.listener:a),r=e._events),o=r[t]):(r=e._events=new O,e._eventsCount=0),o){if("function"==typeof o?o=r[t]=i?[a,o]:[o,a]:i?o.unshift(a):o.push(a),!o.warned&&(n=U(e))&&n>0&&o.length>n){o.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=o.length,s=p,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=r[t]=a,++e._eventsCount;return e}function F(e,t,a){var i=!1;function n(){e.removeListener(t,n),i||(i=!0,a.apply(e,arguments))}return n.listener=a,n}function q(e){var t=this._events;if(t){var a=t[e];if("function"==typeof a)return 1;if(a)return a.length}return 0}function B(e,t){for(var a=new Array(t);t--;)a[t]=e[t];return a}O.prototype=Object.create(null),P.EventEmitter=P,P.usingDomains=!1,P.prototype.domain=void 0,P.prototype._events=void 0,P.prototype._maxListeners=void 0,P.defaultMaxListeners=10,P.init=function(){this.domain=null,P.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new O,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},P.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},P.prototype.getMaxListeners=function(){return U(this)},P.prototype.emit=function(e){var t,a,i,n,r,o,s,p="error"===e;if(o=this._events)p=p&&null==o.error;else if(!p)return!1;if(s=this.domain,p){if(t=arguments[1],!s){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(a=o[e]))return!1;var l="function"==typeof a;switch(i=arguments.length){case 1:M(a,l,this);break;case 2:j(a,l,this,arguments[1]);break;case 3:L(a,l,this,arguments[1],arguments[2]);break;case 4:z(a,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(i-1),r=1;r<i;r++)n[r-1]=arguments[r];V(a,l,this,n)}return!0},P.prototype.addListener=function(e,t){return H(this,e,t,!1)},P.prototype.on=P.prototype.addListener,P.prototype.prependListener=function(e,t){return H(this,e,t,!0)},P.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,F(this,e,t)),this},P.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,F(this,e,t)),this},P.prototype.removeListener=function(e,t){var a,i,n,r,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(a=i[e]))return this;if(a===t||a.listener&&a.listener===t)0==--this._eventsCount?this._events=new O:(delete i[e],i.removeListener&&this.emit("removeListener",e,a.listener||t));else if("function"!=typeof a){for(n=-1,r=a.length;r-- >0;)if(a[r]===t||a[r].listener&&a[r].listener===t){o=a[r].listener,n=r;break}if(n<0)return this;if(1===a.length){if(a[0]=void 0,0==--this._eventsCount)return this._events=new O,this;delete i[e]}else!function(e,t){for(var a=t,i=a+1,n=e.length;i<n;a+=1,i+=1)e[a]=e[i];e.pop()}(a,n);i.removeListener&&this.emit("removeListener",e,o||t)}return this},P.prototype.removeAllListeners=function(e){var t,a;if(!(a=this._events))return this;if(!a.removeListener)return 0===arguments.length?(this._events=new O,this._eventsCount=0):a[e]&&(0==--this._eventsCount?this._events=new O:delete a[e]),this;if(0===arguments.length){for(var i,n=Object.keys(a),r=0;r<n.length;++r)"removeListener"!==(i=n[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new O,this._eventsCount=0,this}if("function"==typeof(t=a[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},P.prototype.listeners=function(e){var t,a=this._events;return a&&(t=a[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),a=0;a<t.length;++a)t[a]=e[a].listener||e[a];return t}(t):[]},P.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):q.call(e,t)},P.prototype.listenerCount=q,P.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var W=[],J=[],K="undefined"!=typeof Uint8Array?Uint8Array:Array,Q=!1;function Z(){Q=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,a=e.length;t<a;++t)W[t]=e[t],J[e.charCodeAt(t)]=t;J["-".charCodeAt(0)]=62,J["_".charCodeAt(0)]=63}function Y(e,t,a){for(var i,n,r=[],o=t;o<a;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],r.push(W[(n=i)>>18&63]+W[n>>12&63]+W[n>>6&63]+W[63&n]);return r.join("")}function X(e){var t;Q||Z();for(var a=e.length,i=a%3,n="",r=[],o=16383,s=0,p=a-i;s<p;s+=o)r.push(Y(e,s,s+o>p?p:s+o));return 1===i?(t=e[a-1],n+=W[t>>2],n+=W[t<<4&63],n+="=="):2===i&&(t=(e[a-2]<<8)+e[a-1],n+=W[t>>10],n+=W[t>>4&63],n+=W[t<<2&63],n+="="),r.push(n),r.join("")}function ee(e,t,a,i,n){var r,o,s=8*n-i-1,p=(1<<s)-1,d=p>>1,l=-7,c=a?n-1:0,u=a?-1:1,m=e[t+c];for(c+=u,r=m&(1<<-l)-1,m>>=-l,l+=s;l>0;r=256*r+e[t+c],c+=u,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+e[t+c],c+=u,l-=8);if(0===r)r=1-d;else{if(r===p)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,i),r-=d}return(m?-1:1)*o*Math.pow(2,r-i)}function te(e,t,a,i,n,r){var o,s,p,d=8*r-n-1,l=(1<<d)-1,c=l>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:r-1,h=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-o))<1&&(o--,p*=2),(t+=o+c>=1?u/p:u*Math.pow(2,1-c))*p>=2&&(o++,p/=2),o+c>=l?(s=0,o=l):o+c>=1?(s=(t*p-1)*Math.pow(2,n),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[a+m]=255&s,m+=h,s/=256,n-=8);for(o=o<<n|s,d+=n;d>0;e[a+m]=255&o,m+=h,o/=256,d-=8);e[a+m-h]|=128*f}var ae={}.toString,ie=Array.isArray||function(e){return"[object Array]"==ae.call(e)};se.TYPED_ARRAY_SUPPORT=void 0===o.TYPED_ARRAY_SUPPORT||o.TYPED_ARRAY_SUPPORT;var ne=re();function re(){return se.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function oe(e,t){if(re()<t)throw new RangeError("Invalid typed array length");return se.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=se.prototype:(null===e&&(e=new se(t)),e.length=t),e}function se(e,t,a){if(!(se.TYPED_ARRAY_SUPPORT||this instanceof se))return new se(e,t,a);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return le(this,e)}return pe(this,e,t,a)}function pe(e,t,a,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,a,i){if(t.byteLength,a<0||t.byteLength<a)throw new RangeError("'offset' is out of bounds");if(t.byteLength<a+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===a&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,a):new Uint8Array(t,a,i);se.TYPED_ARRAY_SUPPORT?(e=t).__proto__=se.prototype:e=ce(e,t);return e}(e,t,a,i):"string"==typeof t?function(e,t,a){"string"==typeof a&&""!==a||(a="utf8");if(!se.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding');var i=0|he(t,a),n=(e=oe(e,i)).write(t,a);n!==i&&(e=e.slice(0,n));return e}(e,t,a):function(e,t){if(me(t)){var a=0|ue(t.length);return 0===(e=oe(e,a)).length||t.copy(e,0,0,a),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?oe(e,0):ce(e,t);if("Buffer"===t.type&&ie(t.data))return ce(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function de(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function le(e,t){if(de(t),e=oe(e,t<0?0:0|ue(t)),!se.TYPED_ARRAY_SUPPORT)for(var a=0;a<t;++a)e[a]=0;return e}function ce(e,t){var a=t.length<0?0:0|ue(t.length);e=oe(e,a);for(var i=0;i<a;i+=1)e[i]=255&t[i];return e}function ue(e){if(e>=re())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re().toString(16)+" bytes");return 0|e}function me(e){return!(null==e||!e._isBuffer)}function he(e,t){if(me(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var a=e.length;if(0===a)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":case void 0:return ze(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return Ve(e).length;default:if(i)return ze(e).length;t=(""+t).toLowerCase(),i=!0}}function fe(e,t,a){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Re(this,t,a);case"utf8":case"utf-8":return Ae(this,t,a);case"ascii":return $e(this,t,a);case"latin1":case"binary":return ke(this,t,a);case"base64":return Se(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return De(this,t,a);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function ve(e,t,a){var i=e[t];e[t]=e[a],e[a]=i}function ye(e,t,a,i,n){if(0===e.length)return-1;if("string"==typeof a?(i=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,isNaN(a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"==typeof t&&(t=se.from(t,i)),me(t))return 0===t.length?-1:ge(e,t,a,i,n);if("number"==typeof t)return t&=255,se.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):ge(e,[t],a,i,n);throw new TypeError("val must be string, number or Buffer")}function ge(e,t,a,i,n){var r,o=1,s=e.length,p=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,p/=2,a/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var l=-1;for(r=a;r<s;r++)if(d(e,r)===d(t,-1===l?0:r-l)){if(-1===l&&(l=r),r-l+1===p)return l*o}else-1!==l&&(r-=r-l),l=-1}else for(a+p>s&&(a=s-p),r=a;r>=0;r--){for(var c=!0,u=0;u<p;u++)if(d(e,r+u)!==d(t,u)){c=!1;break}if(c)return r}return-1}function we(e,t,a,i){a=Number(a)||0;var n=e.length-a;i?(i=Number(i))>n&&(i=n):i=n;var r=t.length;if(r%2!=0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var o=0;o<i;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[a+o]=s}return o}function be(e,t,a,i){return He(ze(t,e.length-a),e,a,i)}function _e(e,t,a,i){return He(function(e){for(var t=[],a=0;a<e.length;++a)t.push(255&e.charCodeAt(a));return t}(t),e,a,i)}function xe(e,t,a,i){return _e(e,t,a,i)}function Ee(e,t,a,i){return He(Ve(t),e,a,i)}function Te(e,t,a,i){return He(function(e,t){for(var a,i,n,r=[],o=0;o<e.length&&!((t-=2)<0);++o)i=(a=e.charCodeAt(o))>>8,n=a%256,r.push(n),r.push(i);return r}(t,e.length-a),e,a,i)}function Se(e,t,a){return 0===t&&a===e.length?X(e):X(e.slice(t,a))}function Ae(e,t,a){a=Math.min(e.length,a);for(var i=[],n=t;n<a;){var r,o,s,p,d=e[n],l=null,c=d>239?4:d>223?3:d>191?2:1;if(n+c<=a)switch(c){case 1:d<128&&(l=d);break;case 2:128==(192&(r=e[n+1]))&&(p=(31&d)<<6|63&r)>127&&(l=p);break;case 3:r=e[n+1],o=e[n+2],128==(192&r)&&128==(192&o)&&(p=(15&d)<<12|(63&r)<<6|63&o)>2047&&(p<55296||p>57343)&&(l=p);break;case 4:r=e[n+1],o=e[n+2],s=e[n+3],128==(192&r)&&128==(192&o)&&128==(192&s)&&(p=(15&d)<<18|(63&r)<<12|(63&o)<<6|63&s)>65535&&p<1114112&&(l=p)}null===l?(l=65533,c=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),n+=c}return function(e){var t=e.length;if(t<=Ne)return String.fromCharCode.apply(String,e);var a="",i=0;for(;i<t;)a+=String.fromCharCode.apply(String,e.slice(i,i+=Ne));return a}(i)}se.poolSize=8192,se._augment=function(e){return e.__proto__=se.prototype,e},se.from=function(e,t,a){return pe(null,e,t,a)},se.TYPED_ARRAY_SUPPORT&&(se.prototype.__proto__=Uint8Array.prototype,se.__proto__=Uint8Array),se.alloc=function(e,t,a){return function(e,t,a,i){return de(t),t<=0?oe(e,t):void 0!==a?"string"==typeof i?oe(e,t).fill(a,i):oe(e,t).fill(a):oe(e,t)}(null,e,t,a)},se.allocUnsafe=function(e){return le(null,e)},se.allocUnsafeSlow=function(e){return le(null,e)},se.isBuffer=Fe,se.compare=function(e,t){if(!me(e)||!me(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var a=e.length,i=t.length,n=0,r=Math.min(a,i);n<r;++n)if(e[n]!==t[n]){a=e[n],i=t[n];break}return a<i?-1:i<a?1:0},se.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},se.concat=function(e,t){if(!ie(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return se.alloc(0);var a;if(void 0===t)for(t=0,a=0;a<e.length;++a)t+=e[a].length;var i=se.allocUnsafe(t),n=0;for(a=0;a<e.length;++a){var r=e[a];if(!me(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(i,n),n+=r.length}return i},se.byteLength=he,se.prototype._isBuffer=!0,se.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ve(this,t,t+1);return this},se.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ve(this,t,t+3),ve(this,t+1,t+2);return this},se.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ve(this,t,t+7),ve(this,t+1,t+6),ve(this,t+2,t+5),ve(this,t+3,t+4);return this},se.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Ae(this,0,e):fe.apply(this,arguments)},se.prototype.equals=function(e){if(!me(e))throw new TypeError("Argument must be a Buffer");return this===e||0===se.compare(this,e)},se.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},se.prototype.compare=function(e,t,a,i,n){if(!me(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||a>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=a)return 0;if(i>=n)return-1;if(t>=a)return 1;if(this===e)return 0;for(var r=(n>>>=0)-(i>>>=0),o=(a>>>=0)-(t>>>=0),s=Math.min(r,o),p=this.slice(i,n),d=e.slice(t,a),l=0;l<s;++l)if(p[l]!==d[l]){r=p[l],o=d[l];break}return r<o?-1:o<r?1:0},se.prototype.includes=function(e,t,a){return-1!==this.indexOf(e,t,a)},se.prototype.indexOf=function(e,t,a){return ye(this,e,t,a,!0)},se.prototype.lastIndexOf=function(e,t,a){return ye(this,e,t,a,!1)},se.prototype.write=function(e,t,a,i){if(void 0===t)i="utf8",a=this.length,t=0;else if(void 0===a&&"string"==typeof t)i=t,a=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(a)?(a|=0,void 0===i&&(i="utf8")):(i=a,a=void 0)}var n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return we(this,e,t,a);case"utf8":case"utf-8":return be(this,e,t,a);case"ascii":return _e(this,e,t,a);case"latin1":case"binary":return xe(this,e,t,a);case"base64":return Ee(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,e,t,a);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},se.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ne=4096;function $e(e,t,a){var i="";a=Math.min(e.length,a);for(var n=t;n<a;++n)i+=String.fromCharCode(127&e[n]);return i}function ke(e,t,a){var i="";a=Math.min(e.length,a);for(var n=t;n<a;++n)i+=String.fromCharCode(e[n]);return i}function Re(e,t,a){var i=e.length;(!t||t<0)&&(t=0),(!a||a<0||a>i)&&(a=i);for(var n="",r=t;r<a;++r)n+=Le(e[r]);return n}function De(e,t,a){for(var i=e.slice(t,a),n="",r=0;r<i.length;r+=2)n+=String.fromCharCode(i[r]+256*i[r+1]);return n}function Ce(e,t,a){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>a)throw new RangeError("Trying to access beyond buffer length")}function Ge(e,t,a,i,n,r){if(!me(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<r)throw new RangeError('"value" argument is out of bounds');if(a+i>e.length)throw new RangeError("Index out of range")}function Ie(e,t,a,i){t<0&&(t=65535+t+1);for(var n=0,r=Math.min(e.length-a,2);n<r;++n)e[a+n]=(t&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function Oe(e,t,a,i){t<0&&(t=4294967295+t+1);for(var n=0,r=Math.min(e.length-a,4);n<r;++n)e[a+n]=t>>>8*(i?n:3-n)&255}function Pe(e,t,a,i,n,r){if(a+i>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Ue(e,t,a,i,n){return n||Pe(e,0,a,4),te(e,t,a,i,23,4),a+4}function Me(e,t,a,i,n){return n||Pe(e,0,a,8),te(e,t,a,i,52,8),a+8}se.prototype.slice=function(e,t){var a,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),se.TYPED_ARRAY_SUPPORT)(a=this.subarray(e,t)).__proto__=se.prototype;else{var n=t-e;a=new se(n,void 0);for(var r=0;r<n;++r)a[r]=this[r+e]}return a},se.prototype.readUIntLE=function(e,t,a){e|=0,t|=0,a||Ce(e,t,this.length);for(var i=this[e],n=1,r=0;++r<t&&(n*=256);)i+=this[e+r]*n;return i},se.prototype.readUIntBE=function(e,t,a){e|=0,t|=0,a||Ce(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},se.prototype.readUInt8=function(e,t){return t||Ce(e,1,this.length),this[e]},se.prototype.readUInt16LE=function(e,t){return t||Ce(e,2,this.length),this[e]|this[e+1]<<8},se.prototype.readUInt16BE=function(e,t){return t||Ce(e,2,this.length),this[e]<<8|this[e+1]},se.prototype.readUInt32LE=function(e,t){return t||Ce(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},se.prototype.readUInt32BE=function(e,t){return t||Ce(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},se.prototype.readIntLE=function(e,t,a){e|=0,t|=0,a||Ce(e,t,this.length);for(var i=this[e],n=1,r=0;++r<t&&(n*=256);)i+=this[e+r]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},se.prototype.readIntBE=function(e,t,a){e|=0,t|=0,a||Ce(e,t,this.length);for(var i=t,n=1,r=this[e+--i];i>0&&(n*=256);)r+=this[e+--i]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},se.prototype.readInt8=function(e,t){return t||Ce(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},se.prototype.readInt16LE=function(e,t){t||Ce(e,2,this.length);var a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},se.prototype.readInt16BE=function(e,t){t||Ce(e,2,this.length);var a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},se.prototype.readInt32LE=function(e,t){return t||Ce(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},se.prototype.readInt32BE=function(e,t){return t||Ce(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},se.prototype.readFloatLE=function(e,t){return t||Ce(e,4,this.length),ee(this,e,!0,23,4)},se.prototype.readFloatBE=function(e,t){return t||Ce(e,4,this.length),ee(this,e,!1,23,4)},se.prototype.readDoubleLE=function(e,t){return t||Ce(e,8,this.length),ee(this,e,!0,52,8)},se.prototype.readDoubleBE=function(e,t){return t||Ce(e,8,this.length),ee(this,e,!1,52,8)},se.prototype.writeUIntLE=function(e,t,a,i){(e=+e,t|=0,a|=0,i)||Ge(this,e,t,a,Math.pow(2,8*a)-1,0);var n=1,r=0;for(this[t]=255&e;++r<a&&(n*=256);)this[t+r]=e/n&255;return t+a},se.prototype.writeUIntBE=function(e,t,a,i){(e=+e,t|=0,a|=0,i)||Ge(this,e,t,a,Math.pow(2,8*a)-1,0);var n=a-1,r=1;for(this[t+n]=255&e;--n>=0&&(r*=256);)this[t+n]=e/r&255;return t+a},se.prototype.writeUInt8=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,1,255,0),se.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},se.prototype.writeUInt16LE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,2,65535,0),se.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ie(this,e,t,!0),t+2},se.prototype.writeUInt16BE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,2,65535,0),se.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ie(this,e,t,!1),t+2},se.prototype.writeUInt32LE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,4,4294967295,0),se.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Oe(this,e,t,!0),t+4},se.prototype.writeUInt32BE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,4,4294967295,0),se.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Oe(this,e,t,!1),t+4},se.prototype.writeIntLE=function(e,t,a,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*a-1);Ge(this,e,t,a,n-1,-n)}var r=0,o=1,s=0;for(this[t]=255&e;++r<a&&(o*=256);)e<0&&0===s&&0!==this[t+r-1]&&(s=1),this[t+r]=(e/o>>0)-s&255;return t+a},se.prototype.writeIntBE=function(e,t,a,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*a-1);Ge(this,e,t,a,n-1,-n)}var r=a-1,o=1,s=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===s&&0!==this[t+r+1]&&(s=1),this[t+r]=(e/o>>0)-s&255;return t+a},se.prototype.writeInt8=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,1,127,-128),se.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},se.prototype.writeInt16LE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,2,32767,-32768),se.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ie(this,e,t,!0),t+2},se.prototype.writeInt16BE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,2,32767,-32768),se.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ie(this,e,t,!1),t+2},se.prototype.writeInt32LE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,4,2147483647,-2147483648),se.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Oe(this,e,t,!0),t+4},se.prototype.writeInt32BE=function(e,t,a){return e=+e,t|=0,a||Ge(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),se.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Oe(this,e,t,!1),t+4},se.prototype.writeFloatLE=function(e,t,a){return Ue(this,e,t,!0,a)},se.prototype.writeFloatBE=function(e,t,a){return Ue(this,e,t,!1,a)},se.prototype.writeDoubleLE=function(e,t,a){return Me(this,e,t,!0,a)},se.prototype.writeDoubleBE=function(e,t,a){return Me(this,e,t,!1,a)},se.prototype.copy=function(e,t,a,i){if(a||(a=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<a&&(i=a),i===a)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(a<0||a>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-a&&(i=e.length-t+a);var n,r=i-a;if(this===e&&a<t&&t<i)for(n=r-1;n>=0;--n)e[n+t]=this[n+a];else if(r<1e3||!se.TYPED_ARRAY_SUPPORT)for(n=0;n<r;++n)e[n+t]=this[n+a];else Uint8Array.prototype.set.call(e,this.subarray(a,a+r),t);return r},se.prototype.fill=function(e,t,a,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,a=this.length):"string"==typeof a&&(i=a,a=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!se.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<a)throw new RangeError("Out of range index");if(a<=t)return this;var r;if(t>>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(r=t;r<a;++r)this[r]=e;else{var o=me(e)?e:ze(new se(e,i).toString()),s=o.length;for(r=0;r<a-t;++r)this[r+t]=o[r%s]}return this};var je=/[^+\/0-9A-Za-z-_]/g;function Le(e){return e<16?"0"+e.toString(16):e.toString(16)}function ze(e,t){var a;t=t||1/0;for(var i=e.length,n=null,r=[],o=0;o<i;++o){if((a=e.charCodeAt(o))>55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&r.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&r.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&r.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;r.push(a)}else if(a<2048){if((t-=2)<0)break;r.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;r.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return r}function Ve(e){return function(e){var t,a,i,n,r,o;Q||Z();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[s-2]?2:"="===e[s-1]?1:0,o=new K(3*s/4-r),i=r>0?s-4:s;var p=0;for(t=0,a=0;t<i;t+=4,a+=3)n=J[e.charCodeAt(t)]<<18|J[e.charCodeAt(t+1)]<<12|J[e.charCodeAt(t+2)]<<6|J[e.charCodeAt(t+3)],o[p++]=n>>16&255,o[p++]=n>>8&255,o[p++]=255&n;return 2===r?(n=J[e.charCodeAt(t)]<<2|J[e.charCodeAt(t+1)]>>4,o[p++]=255&n):1===r&&(n=J[e.charCodeAt(t)]<<10|J[e.charCodeAt(t+1)]<<4|J[e.charCodeAt(t+2)]>>2,o[p++]=n>>8&255,o[p++]=255&n),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(je,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function He(e,t,a,i){for(var n=0;n<i&&!(n+a>=t.length||n>=e.length);++n)t[n+a]=e[n];return n}function Fe(e){return null!=e&&(!!e._isBuffer||qe(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&qe(e.slice(0,0))}(e))}function qe(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Be=Object.freeze({__proto__:null,Buffer:se,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),se.alloc(+e)},isBuffer:Fe,kMaxLength:ne}),We="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e},Je=/%[sdj%]/g;function Ke(e){if(!ct(e)){for(var t=[],a=0;a<arguments.length;a++)t.push(et(arguments[a]));return t.join(" ")}a=1;for(var i=arguments,n=i.length,r=String(e).replace(Je,(function(e){if("%%"===e)return"%";if(a>=n)return e;switch(e){case"%s":return String(i[a++]);case"%d":return Number(i[a++]);case"%j":try{return JSON.stringify(i[a++])}catch(e){return"[Circular]"}default:return e}})),o=i[a];a<n;o=i[++a])pt(o)||!ft(o)?r+=" "+o:r+=" "+et(o);return r}function Qe(e,t){if(mt(o.process))return function(){return Qe(e,t).apply(this,arguments)};if(!0===D.noDeprecation)return e;var a=!1;return function(){if(!a){if(D.throwDeprecation)throw new Error(t);D.traceDeprecation?console.trace(t):console.error(t),a=!0}return e.apply(this,arguments)}}var Ze,Ye={};function Xe(e){if(mt(Ze)&&(Ze=D.env.NODE_DEBUG||""),e=e.toUpperCase(),!Ye[e])if(new RegExp("\\b"+e+"\\b","i").test(Ze)){Ye[e]=function(){var t=Ke.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Ye[e]=function(){};return Ye[e]}function et(e,t){var a={seen:[],stylize:at};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),st(t)?a.showHidden=t:t&&At(a,t),mt(a.showHidden)&&(a.showHidden=!1),mt(a.depth)&&(a.depth=2),mt(a.colors)&&(a.colors=!1),mt(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=tt),it(a,e,a.depth)}function tt(e,t){var a=et.styles[t];return a?"["+et.colors[a][0]+"m"+e+"["+et.colors[a][1]+"m":e}function at(e,t){return e}function it(e,t,a){if(e.customInspect&&t&&gt(t.inspect)&&t.inspect!==et&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(a,e);return ct(i)||(i=it(e,i,a)),i}var n=function(e,t){if(mt(t))return e.stylize("undefined","undefined");if(ct(t)){var a="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(a,"string")}if(lt(t))return e.stylize(""+t,"number");if(st(t))return e.stylize(""+t,"boolean");if(pt(t))return e.stylize("null","null")}(e,t);if(n)return n;var r=Object.keys(t),o=function(e){var t={};return e.forEach((function(e,a){t[e]=!0})),t}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),yt(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return nt(t);if(0===r.length){if(gt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(ht(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(vt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(yt(t))return nt(t)}var p,d="",l=!1,c=["{","}"];(ot(t)&&(l=!0,c=["[","]"]),gt(t))&&(d=" [Function"+(t.name?": "+t.name:"")+"]");return ht(t)&&(d=" "+RegExp.prototype.toString.call(t)),vt(t)&&(d=" "+Date.prototype.toUTCString.call(t)),yt(t)&&(d=" "+nt(t)),0!==r.length||l&&0!=t.length?a<0?ht(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),p=l?function(e,t,a,i,n){for(var r=[],o=0,s=t.length;o<s;++o)Nt(t,String(o))?r.push(rt(e,t,a,i,String(o),!0)):r.push("");return n.forEach((function(n){n.match(/^\d+$/)||r.push(rt(e,t,a,i,n,!0))})),r}(e,t,a,o,r):r.map((function(i){return rt(e,t,a,o,i,l)})),e.seen.pop(),function(e,t,a){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return a[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+a[1];return a[0]+t+" "+e.join(", ")+" "+a[1]}(p,d,c)):c[0]+d+c[1]}function nt(e){return"["+Error.prototype.toString.call(e)+"]"}function rt(e,t,a,i,n,r){var o,s,p;if((p=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=p.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):p.set&&(s=e.stylize("[Setter]","special")),Nt(i,n)||(o="["+n+"]"),s||(e.seen.indexOf(p.value)<0?(s=pt(a)?it(e,p.value,null):it(e,p.value,a-1)).indexOf("\n")>-1&&(s=r?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),mt(o)){if(r&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function ot(e){return Array.isArray(e)}function st(e){return"boolean"==typeof e}function pt(e){return null===e}function dt(e){return null==e}function lt(e){return"number"==typeof e}function ct(e){return"string"==typeof e}function ut(e){return"symbol"==typeof e}function mt(e){return void 0===e}function ht(e){return ft(e)&&"[object RegExp]"===_t(e)}function ft(e){return"object"==typeof e&&null!==e}function vt(e){return ft(e)&&"[object Date]"===_t(e)}function yt(e){return ft(e)&&("[object Error]"===_t(e)||e instanceof Error)}function gt(e){return"function"==typeof e}function wt(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function bt(e){return se.isBuffer(e)}function _t(e){return Object.prototype.toString.call(e)}function xt(e){return e<10?"0"+e.toString(10):e.toString(10)}et.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]},et.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Tt(){var e=new Date,t=[xt(e.getHours()),xt(e.getMinutes()),xt(e.getSeconds())].join(":");return[e.getDate(),Et[e.getMonth()],t].join(" ")}function St(){console.log("%s - %s",Tt(),Ke.apply(null,arguments))}function At(e,t){if(!t||!ft(t))return e;for(var a=Object.keys(t),i=a.length;i--;)e[a[i]]=t[a[i]];return e}function Nt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var $t={inherits:We,_extend:At,log:St,isBuffer:bt,isPrimitive:wt,isFunction:gt,isError:yt,isDate:vt,isObject:ft,isRegExp:ht,isUndefined:mt,isSymbol:ut,isString:ct,isNumber:lt,isNullOrUndefined:dt,isNull:pt,isBoolean:st,isArray:ot,inspect:et,deprecate:Qe,format:Ke,debuglog:Xe},kt=Object.freeze({__proto__:null,format:Ke,deprecate:Qe,debuglog:Xe,inspect:et,isArray:ot,isBoolean:st,isNull:pt,isNullOrUndefined:dt,isNumber:lt,isString:ct,isSymbol:ut,isUndefined:mt,isRegExp:ht,isObject:ft,isDate:vt,isError:yt,isFunction:gt,isPrimitive:wt,isBuffer:bt,log:St,inherits:We,_extend:At,default:$t});function Rt(){this.head=null,this.tail=null,this.length=0}Rt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Rt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Rt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Rt.prototype.clear=function(){this.head=this.tail=null,this.length=0},Rt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,a=""+t.data;t=t.next;)a+=e+t.data;return a},Rt.prototype.concat=function(e){if(0===this.length)return se.alloc(0);if(1===this.length)return this.head.data;for(var t=se.allocUnsafe(e>>>0),a=this.head,i=0;a;)a.data.copy(t,i),i+=a.data.length,a=a.next;return t};var Dt=se.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ct(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Dt(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=It;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Ot;break;default:return void(this.write=Gt)}this.charBuffer=new se(6),this.charReceived=0,this.charLength=0}function Gt(e){return e.toString(this.encoding)}function It(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Ot(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Ct.prototype.write=function(e){for(var t="";this.charLength;){var a=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,a),this.charReceived+=a,this.charReceived<this.charLength)return"";if(e=e.slice(a,e.length),!((n=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived);var n;i=(t+=e.toString(this.encoding,0,i)).length-1;if((n=t.charCodeAt(i))>=55296&&n<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,i)}return t},Ct.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var a=e[e.length-t];if(1==t&&a>>5==6){this.charLength=2;break}if(t<=2&&a>>4==14){this.charLength=3;break}if(t<=3&&a>>3==30){this.charLength=4;break}}this.charReceived=t},Ct.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var a=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,a).toString(n)}return t},Mt.ReadableState=Ut;var Pt=Xe("stream");function Ut(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof ua&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new Rt,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.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ct(e.encoding),this.encoding=e.encoding)}function Mt(e){if(!(this instanceof Mt))return new Mt(e);this._readableState=new Ut(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),P.call(this)}function jt(e,t,a,i,n){var r=function(e,t){var a=null;se.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk"));return a}(t,a);if(r)e.emit("error",r);else if(null===a)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var a=t.decoder.end();a&&a.length&&(t.buffer.push(a),t.length+=t.objectMode?1:a.length)}t.ended=!0,Vt(e)}(e,t);else if(t.objectMode||a&&a.length>0)if(t.ended&&!n){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var p;!t.decoder||n||i||(a=t.decoder.write(a),p=!t.objectMode&&0===a.length),n||(t.reading=!1),p||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",a),e.read(0)):(t.length+=t.objectMode?1:a.length,n?t.buffer.unshift(a):t.buffer.push(a),t.needReadable&&Vt(e))),function(e,t){t.readingMore||(t.readingMore=!0,g(Ft,e,t))}(e,t)}else n||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}We(Mt,P),Mt.prototype.push=function(e,t){var a=this._readableState;return a.objectMode||"string"!=typeof e||(t=t||a.defaultEncoding)!==a.encoding&&(e=se.from(e,t),t=""),jt(this,a,e,t,!1)},Mt.prototype.unshift=function(e){return jt(this,this._readableState,e,"",!0)},Mt.prototype.isPaused=function(){return!1===this._readableState.flowing},Mt.prototype.setEncoding=function(e){return this._readableState.decoder=new Ct(e),this._readableState.encoding=e,this};var Lt=8388608;function zt(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=Lt?e=Lt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Vt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Pt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?g(Ht,e):Ht(e))}function Ht(e){Pt("emit readable"),e.emit("readable"),Wt(e)}function Ft(e,t){for(var a=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Pt("maybeReadMore read 0"),e.read(0),a!==t.length);)a=t.length;t.readingMore=!1}function qt(e){Pt("readable nexttick read 0"),e.read(0)}function Bt(e,t){t.reading||(Pt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Wt(e),t.flowing&&!t.reading&&e.read(0)}function Wt(e){var t=e._readableState;for(Pt("flow",t.flowing);t.flowing&&null!==e.read(););}function Jt(e,t){return 0===t.length?null:(t.objectMode?a=t.buffer.shift():!e||e>=t.length?(a=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):a=function(e,t,a){var i;e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):i=e===t.head.data.length?t.shift():a?function(e,t){var a=t.head,i=1,n=a.data;e-=n.length;for(;a=a.next;){var r=a.data,o=e>r.length?r.length:e;if(o===r.length?n+=r:n+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=r.slice(o));break}++i}return t.length-=i,n}(e,t):function(e,t){var a=se.allocUnsafe(e),i=t.head,n=1;i.data.copy(a),e-=i.data.length;for(;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(a,a.length-e,0,o),0===(e-=o)){o===r.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++n}return t.length-=n,a}(e,t);return i}(e,t.buffer,t.decoder),a);var a}function Kt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,g(Qt,t,e))}function Qt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Zt(e,t){for(var a=0,i=e.length;a<i;a++)if(e[a]===t)return a;return-1}function Yt(){}function Xt(e,t,a){this.chunk=e,this.encoding=t,this.callback=a,this.next=null}function ea(e,t){Object.defineProperty(this,"buffer",{get:Qe((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof ua&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var a=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var a=e._writableState,i=a.sync,n=a.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(a),t)!function(e,t,a,i,n){--t.pendingcb,a?g(n,i):n(i);e._writableState.errorEmitted=!0,e.emit("error",i)}(e,a,i,t,n);else{var r=ra(a);r||a.corked||a.bufferProcessing||!a.bufferedRequest||na(e,a),i?g(ia,e,a,r,n):ia(e,a,r,n)}}(t,e)},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 pa(this)}function ta(e){if(!(this instanceof ta||this instanceof ua))return new ta(e);this._writableState=new ea(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),P.call(this)}function aa(e,t,a,i,n,r,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,a?e._writev(n,t.onwrite):e._write(n,r,t.onwrite),t.sync=!1}function ia(e,t,a,i){a||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),sa(e,t)}function na(e,t){t.bufferProcessing=!0;var a=t.bufferedRequest;if(e._writev&&a&&a.next){var i=t.bufferedRequestCount,n=new Array(i),r=t.corkedRequestsFree;r.entry=a;for(var o=0;a;)n[o]=a,a=a.next,o+=1;aa(e,t,!0,t.length,n,"",r.finish),t.pendingcb++,t.lastBufferedRequest=null,r.next?(t.corkedRequestsFree=r.next,r.next=null):t.corkedRequestsFree=new pa(t)}else{for(;a;){var s=a.chunk,p=a.encoding,d=a.callback;if(aa(e,t,!1,t