forked from OneIdentity/safeguard.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
safeguard.min.js
1 lines (1 loc) · 191 KB
/
safeguard.min.js
1
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SafeguardJs=e()}(function(){return function n(o,i,s){function a(t,e){if(!i[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(c)return c(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=i[t]={exports:{}},o[t][0].call(r.exports,function(e){return a(o[t][1][e]||e)},r,r.exports,n,o,i,s)}return i[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=(o.prototype.abort=function(){this.isAborted||(this.isAborted=!0,this.onabort&&this.onabort())},Object.defineProperty(o.prototype,"signal",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"aborted",{get:function(){return this.isAborted},enumerable:!0,configurable:!0}),o);function o(){this.isAborted=!1,this.onabort=null}r.AbortController=n},{}],2:[function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var i,s=e("./Errors"),a=e("./FetchHttpClient"),c=e("./HttpClient"),u=e("./Utils"),l=e("./XhrHttpClient"),o=(i=c.HttpClient,o(h,i),h.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new s.AbortError):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},h.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},h);function h(e){var t=i.call(this)||this;if("undefined"!=typeof fetch||u.Platform.isNode)t.httpClient=new a.FetchHttpClient(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");t.httpClient=new l.XhrHttpClient(e)}return t}r.DefaultHttpClient=o},{"./Errors":4,"./FetchHttpClient":5,"./HttpClient":7,"./Utils":20,"./XhrHttpClient":22}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=[0,2e3,1e4,3e4,null],o=(i.prototype.nextRetryDelayInMilliseconds=function(e){return this.retryDelays[e.previousRetryCount]},i);function i(e){this.retryDelays=void 0!==e?e.concat([null]):n}r.DefaultReconnectPolicy=o},{}],4:[function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var i,s=(i=Error,o(a,i),a);function a(e,t){var r=this,n=this.constructor.prototype;return(r=i.call(this,e)||this).statusCode=t,r.__proto__=n,r}r.HttpError=s;var c,s=(c=Error,o(u,c),u);function u(e){var t=this,r=this.constructor.prototype;return(t=c.call(this,e=void 0===e?"A timeout occurred.":e)||this).__proto__=r,t}r.TimeoutError=s;var l,o=(l=Error,o(h,l),h);function h(e){var t=this,r=this.constructor.prototype;return(t=l.call(this,e=void 0===e?"An abort occurred.":e)||this).__proto__=r,t}r.AbortError=o},{}],5:[function(r,e,t){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},u=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var s,l=r("./Errors"),h=r("./HttpClient"),f=r("./ILogger"),a=r("./Utils"),o=(s=h.HttpClient,o(p,s),p.prototype.send=function(a){return i(this,void 0,void 0,function(){var t,r,n,o,i,s=this;return u(this,function(e){switch(e.label){case 0:if(a.abortSignal&&a.abortSignal.aborted)throw new l.AbortError;if(!a.method)throw new Error("No method defined.");if(!a.url)throw new Error("No url defined.");t=new this.abortControllerType,a.abortSignal&&(a.abortSignal.onabort=function(){t.abort(),r=new l.AbortError}),i=null,a.timeout&&(o=a.timeout,i=setTimeout(function(){t.abort(),s.logger.log(f.LogLevel.Warning,"Timeout from HTTP request."),r=new l.TimeoutError},o)),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.fetchType(a.url,{body:a.content,cache:"no-cache",credentials:!0===a.withCredentials?"include":"same-origin",headers:c({"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest"},a.headers),method:a.method,mode:"cors",redirect:"manual",signal:t.signal})];case 2:return n=e.sent(),[3,5];case 3:if(o=e.sent(),r)throw r;throw this.logger.log(f.LogLevel.Warning,"Error from HTTP request. "+o+"."),o;case 4:return i&&clearTimeout(i),a.abortSignal&&(a.abortSignal.onabort=null),[7];case 5:if(!n.ok)throw new l.HttpError(n.statusText,n.status);return[4,function(e,t){var r;switch(t){case"arraybuffer":r=e.arrayBuffer();break;case"text":r=e.text();break;case"blob":case"document":case"json":throw new Error(t+" is not supported.");default:r=e.text()}return r}(n,a.responseType)];case 6:return i=e.sent(),[2,new h.HttpResponse(n.status,n.statusText,i)]}})})},p.prototype.getCookieString=function(e){var r="";return a.Platform.isNode&&this.jar&&this.jar.getCookies(e,function(e,t){return r=t.join("; ")}),r},p);function p(e){var t=s.call(this)||this;return t.logger=e,"undefined"==typeof fetch?(e="function"==typeof __webpack_require__?__non_webpack_require__:r,t.jar=new(e("tough-cookie").CookieJar),t.fetchType=e("node-fetch"),t.fetchType=e("fetch-cookie")(t.fetchType,t.jar),t.abortControllerType=e("abort-controller")):(t.fetchType=fetch.bind(self),t.abortControllerType=AbortController),t}t.FetchHttpClient=o},{"./Errors":4,"./HttpClient":7,"./ILogger":12,"./Utils":20}],6:[function(r,e,n){!function(a){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=r("./TextMessageFormat"),s=r("./Utils"),e=(t.prototype.writeHandshakeRequest=function(e){return i.TextMessageFormat.write(JSON.stringify(e))},t.prototype.parseHandshakeResponse=function(e){if(s.isArrayBuffer(e)||void 0!==a&&e instanceof a){var t=new Uint8Array(e);if(-1===(o=t.indexOf(i.TextMessageFormat.RecordSeparatorCode)))throw new Error("Message is incomplete.");var r=o+1,n=String.fromCharCode.apply(null,t.slice(0,r)),t=t.byteLength>r?t.slice(r).buffer:null}else{var o,e=e;if(-1===(o=e.indexOf(i.TextMessageFormat.RecordSeparator)))throw new Error("Message is incomplete.");n=e.substring(0,r=o+1),t=e.length>r?e.substring(r):null}n=i.TextMessageFormat.parse(n),n=JSON.parse(n[0]);if(n.type)throw new Error("Expected a handshake response from the server.");return[t,n]},t);function t(){}n.HandshakeProtocol=e}.call(this)}.call(this,r("buffer").Buffer)},{"./TextMessageFormat":19,"./Utils":20,buffer:55}],7:[function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(r,"__esModule",{value:!0}),r.HttpResponse=function(e,t,r){this.statusCode=e,this.statusText=t,this.content=r};var o=(i.prototype.get=function(e,t){return this.send(n({},t,{method:"GET",url:e}))},i.prototype.post=function(e,t){return this.send(n({},t,{method:"POST",url:e}))},i.prototype.delete=function(e,t){return this.send(n({},t,{method:"DELETE",url:e}))},i.prototype.getCookieString=function(e){return""},i);function i(){}r.HttpClient=o},{}],8:[function(o,e,t){"use strict";var s=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},f=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=o("./DefaultHttpClient"),p=o("./ILogger"),a=o("./ITransport"),c=o("./LongPollingTransport"),r=o("./ServerSentEventsTransport"),u=o("./Utils"),l=o("./WebSocketTransport"),h=(d.prototype.start=function(r){return n(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return(r=r||a.TransferFormat.Binary,u.Arg.isIn(r,a.TransferFormat,"transferFormat"),this.logger.log(p.LogLevel.Debug,"Starting connection with transfer format '"+a.TransferFormat[r]+"'."),"Disconnected"!==this.connectionState)?[2,Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))]:(this.connectionState="Connecting",this.startInternalPromise=this.startInternal(r),[4,this.startInternalPromise]);case 1:return(e.sent(),"Disconnecting"!==this.connectionState)?[3,3]:(t="Failed to start the HttpConnection before stop() was called.",this.logger.log(p.LogLevel.Error,t),[4,this.stopPromise]);case 2:return e.sent(),[2,Promise.reject(new Error(t))];case 3:if("Connected"!==this.connectionState)return t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!",this.logger.log(p.LogLevel.Error,t),[2,Promise.reject(new Error(t))];e.label=4;case 4:return this.connectionStarted=!0,[2]}})})},d.prototype.send=function(e){return"Connected"!==this.connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.sendQueue||(this.sendQueue=new g(this.transport)),this.sendQueue.send(e))},d.prototype.stop=function(r){return n(this,void 0,void 0,function(){var t=this;return f(this,function(e){switch(e.label){case 0:return"Disconnected"===this.connectionState?(this.logger.log(p.LogLevel.Debug,"Call to HttpConnection.stop("+r+") ignored because the connection is already in the disconnected state."),[2,Promise.resolve()]):"Disconnecting"===this.connectionState?(this.logger.log(p.LogLevel.Debug,"Call to HttpConnection.stop("+r+") ignored because the connection is already in the disconnecting state."),[2,this.stopPromise]):(this.connectionState="Disconnecting",this.stopPromise=new Promise(function(e){t.stopPromiseResolver=e}),[4,this.stopInternal(r)]);case 1:return e.sent(),[4,this.stopPromise];case 2:return e.sent(),[2]}})})},d.prototype.stopInternal=function(r){return n(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:this.stopError=r,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.startInternalPromise];case 2:return e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:if(!this.transport)return[3,9];e.label=5;case 5:return e.trys.push([5,7,,8]),[4,this.transport.stop()];case 6:return e.sent(),[3,8];case 7:return t=e.sent(),this.logger.log(p.LogLevel.Error,"HttpConnection.transport.stop() threw error '"+t+"'."),this.stopConnection(),[3,8];case 8:return this.transport=void 0,[3,10];case 9:this.logger.log(p.LogLevel.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."),this.stopConnection(),e.label=10;case 10:return[2]}})})},d.prototype.startInternal=function(s){return n(this,void 0,void 0,function(){var r,n,o,i,t;return f(this,function(e){switch(e.label){case 0:r=this.baseUrl,this.accessTokenFactory=this.options.accessTokenFactory,e.label=1;case 1:return(e.trys.push([1,12,,13]),this.options.skipNegotiation)?this.options.transport!==a.HttpTransportType.WebSockets?[3,3]:(this.transport=this.constructTransport(a.HttpTransportType.WebSockets),[4,this.startTransport(r,s)]):[3,5];case 2:return e.sent(),[3,4];case 3:throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:n=null,o=0,t=function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,i.getNegotiationResponse(r)];case 1:if(n=e.sent(),"Disconnecting"===i.connectionState||"Disconnected"===i.connectionState)throw new Error("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");return n.url&&(r=n.url),n.accessToken&&(t=n.accessToken,i.accessTokenFactory=function(){return t}),o++,[2]}})},i=this,e.label=6;case 6:return[5,t()];case 7:e.sent(),e.label=8;case 8:if(n.url&&o<100)return[3,6];e.label=9;case 9:if(100===o&&n.url)throw new Error("Negotiate redirection limit exceeded.");return[4,this.createTransport(r,this.options.transport,n,s)];case 10:e.sent(),e.label=11;case 11:return this.transport instanceof c.LongPollingTransport&&(this.features.inherentKeepAlive=!0),"Connecting"===this.connectionState&&(this.logger.log(p.LogLevel.Debug,"The HttpConnection connected successfully."),this.connectionState="Connected"),[3,13];case 12:return t=e.sent(),this.logger.log(p.LogLevel.Error,"Failed to start the connection: "+t),this.connectionState="Disconnected",this.transport=void 0,[2,Promise.reject(t)];case 13:return[2]}})})},d.prototype.getNegotiationResponse=function(i){return n(this,void 0,void 0,function(){var t,r,n,o;return f(this,function(e){switch(e.label){case 0:return n={},this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(t=e.sent())&&(n.Authorization="Bearer "+t),e.label=2;case 2:r=u.getUserAgentHeader(),t=r[0],r=r[1],n[t]=r,r=this.resolveNegotiateUrl(i),this.logger.log(p.LogLevel.Debug,"Sending negotiation request: "+r+"."),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,this.httpClient.post(r,{content:"",headers:s({},n,this.options.headers),withCredentials:this.options.withCredentials})];case 4:return 200!==(n=e.sent()).statusCode?[2,Promise.reject(new Error("Unexpected status code returned from negotiate '"+n.statusCode+"'"))]:((!(o=JSON.parse(n.content)).negotiateVersion||o.negotiateVersion<1)&&(o.connectionToken=o.connectionId),[2,o]);case 5:return o=e.sent(),this.logger.log(p.LogLevel.Error,"Failed to complete negotiation with the server: "+o),[2,Promise.reject(o)];case 6:return[2]}})})},d.prototype.createConnectUrl=function(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+"id="+t:e},d.prototype.createTransport=function(c,u,l,h){return n(this,void 0,void 0,function(){var t,r,n,o,i,s,a;return f(this,function(e){switch(e.label){case 0:return(a=this.createConnectUrl(c,l.connectionToken),this.isITransport(u))?(this.logger.log(p.LogLevel.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=u,[4,this.startTransport(a,h)]):[3,2];case 1:return e.sent(),this.connectionId=l.connectionId,[2];case 2:t=[],o=l.availableTransports||[],r=l,n=0,o=o,e.label=3;case 3:return n<o.length?(i=o[n],(s=this.resolveTransportOrError(i,u,h))instanceof Error?(t.push(i.transport+" failed: "+s),[3,12]):[3,4]):[3,13];case 4:if(!this.isITransport(s))return[3,12];if(this.transport=s,r)return[3,9];e.label=5;case 5:return e.trys.push([5,7,,8]),[4,this.getNegotiationResponse(c)];case 6:return r=e.sent(),[3,8];case 7:return s=e.sent(),[2,Promise.reject(s)];case 8:a=this.createConnectUrl(c,r.connectionToken),e.label=9;case 9:return e.trys.push([9,11,,12]),[4,this.startTransport(a,h)];case 10:return e.sent(),this.connectionId=r.connectionId,[2];case 11:return a=e.sent(),this.logger.log(p.LogLevel.Error,"Failed to start the transport '"+i.transport+"': "+a),r=void 0,t.push(i.transport+" failed: "+a),"Connecting"!==this.connectionState?(a="Failed to select transport before stop() was called.",this.logger.log(p.LogLevel.Debug,a),[2,Promise.reject(new Error(a))]):[3,12];case 12:return n++,[3,3];case 13:return 0<t.length?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+t.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},d.prototype.constructTransport=function(e){switch(e){case a.HttpTransportType.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new l.WebSocketTransport(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket,this.options.headers||{});case a.HttpTransportType.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new r.ServerSentEventsTransport(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource,this.options.withCredentials,this.options.headers||{});case a.HttpTransportType.LongPolling:return new c.LongPollingTransport(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.withCredentials,this.options.headers||{});default:throw new Error("Unknown transport: "+e+".")}},d.prototype.startTransport=function(e,t){var r=this;return this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return r.stopConnection(e)},this.transport.connect(e,t)},d.prototype.resolveTransportOrError=function(e,t,r){var n,o=a.HttpTransportType[e.transport];if(null==o)return this.logger.log(p.LogLevel.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(n=o,(t=t)&&0==(n&t))return this.logger.log(p.LogLevel.Debug,"Skipping transport '"+a.HttpTransportType[o]+"' because it was disabled by the client."),new Error("'"+a.HttpTransportType[o]+"' is disabled by the client.");if(!(0<=e.transferFormats.map(function(e){return a.TransferFormat[e]}).indexOf(r)))return this.logger.log(p.LogLevel.Debug,"Skipping transport '"+a.HttpTransportType[o]+"' because it does not support the requested transfer format '"+a.TransferFormat[r]+"'."),new Error("'"+a.HttpTransportType[o]+"' does not support "+a.TransferFormat[r]+".");if(o===a.HttpTransportType.WebSockets&&!this.options.WebSocket||o===a.HttpTransportType.ServerSentEvents&&!this.options.EventSource)return this.logger.log(p.LogLevel.Debug,"Skipping transport '"+a.HttpTransportType[o]+"' because it is not supported in your environment.'"),new Error("'"+a.HttpTransportType[o]+"' is not supported in your environment.");this.logger.log(p.LogLevel.Debug,"Selecting transport '"+a.HttpTransportType[o]+"'.");try{return this.constructTransport(o)}catch(e){return e}},d.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},d.prototype.stopConnection=function(t){var r=this;if(this.logger.log(p.LogLevel.Debug,"HttpConnection.stopConnection("+t+") called while in state "+this.connectionState+"."),this.transport=void 0,t=this.stopError||t,this.stopError=void 0,"Disconnected"!==this.connectionState){if("Connecting"===this.connectionState)throw this.logger.log(p.LogLevel.Warning,"Call to HttpConnection.stopConnection("+t+") was ignored because the connection is still in the connecting state."),new Error("HttpConnection.stopConnection("+t+") was called while the connection is still in the connecting state.");if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),t?this.logger.log(p.LogLevel.Error,"Connection disconnected with error '"+t+"'."):this.logger.log(p.LogLevel.Information,"Connection disconnected."),this.sendQueue&&(this.sendQueue.stop().catch(function(e){r.logger.log(p.LogLevel.Error,"TransportSendQueue.stop() threw error '"+e+"'.")}),this.sendQueue=void 0),this.connectionId=void 0,this.connectionState="Disconnected",this.connectionStarted){this.connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(e){this.logger.log(p.LogLevel.Error,"HttpConnection.onclose("+t+") threw error '"+e+"'.")}}}else this.logger.log(p.LogLevel.Debug,"Call to HttpConnection.stopConnection("+t+") was ignored because the connection is already in the disconnected state.")},d.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!u.Platform.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(p.LogLevel.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},d.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),r=e.substring(0,-1===t?e.length:t);return"/"!==r[r.length-1]&&(r+="/"),r+="negotiate",-1===(r+=-1===t?"":e.substring(t)).indexOf("negotiateVersion")&&(r+=-1===t?"?":"&",r+="negotiateVersion="+this.negotiateVersion),r},d);function d(e,t){if(void 0===t&&(t={}),this.features={},this.negotiateVersion=1,u.Arg.isRequired(e,"url"),this.logger=u.createLogger(t.logger),this.baseUrl=this.resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials;var r=null,n=null;u.Platform.isNode&&void 0!==o&&(r=(e="function"==typeof __webpack_require__?__non_webpack_require__:o)("ws"),n=e("eventsource")),u.Platform.isNode||"undefined"==typeof WebSocket||t.WebSocket?u.Platform.isNode&&!t.WebSocket&&r&&(t.WebSocket=r):t.WebSocket=WebSocket,u.Platform.isNode||"undefined"==typeof EventSource||t.EventSource?u.Platform.isNode&&!t.EventSource&&void 0!==n&&(t.EventSource=n):t.EventSource=EventSource,this.httpClient=t.httpClient||new i.DefaultHttpClient(this.logger),this.connectionState="Disconnected",this.connectionStarted=!1,this.options=t,this.onreceive=null,this.onclose=null}t.HttpConnection=h;var g=(y.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new b),this.transportResult.promise},y.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},y.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},y.prototype.sendLoop=function(){return n(this,void 0,void 0,function(){var t,r;return f(this,function(e){switch(e.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(e.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new b,t=this.transportResult,this.transportResult=void 0,r="string"==typeof this.buffer[0]?this.buffer.join(""):y.concatBuffers(this.buffer),this.buffer.length=0,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.transport.send(r)];case 3:return e.sent(),t.resolve(),[3,5];case 4:return r=e.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},y.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),r=new Uint8Array(t),n=0,o=0,i=e;o<i.length;o++){var s=i[o];r.set(new Uint8Array(s),n),n+=s.byteLength}return r.buffer},y);function y(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new b,this.transportResult=new b,this.sendLoopPromise=this.sendLoop()}t.TransportSendQueue=g;var b=(m.prototype.resolve=function(){this.resolver()},m.prototype.reject=function(e){this.rejecter(e)},m);function m(){var r=this;this.promise=new Promise(function(e,t){t=[e,t];return r.resolver=t[0],r.rejecter=t[1],t})}},{"./DefaultHttpClient":2,"./ILogger":12,"./ITransport":13,"./LongPollingTransport":16,"./ServerSentEventsTransport":17,"./Utils":20,"./WebSocketTransport":21}],9:[function(e,t,r){"use strict";var n=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},c=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(r,"__esModule",{value:!0});var u,i=e("./HandshakeProtocol"),l=e("./IHubProtocol"),h=e("./ILogger"),f=e("./Subject"),s=e("./Utils");(e=u=r.HubConnectionState||(r.HubConnectionState={})).Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting";o.create=function(e,t,r,n){return new o(e,t,r,n)},Object.defineProperty(o.prototype,"state",{get:function(){return this.connectionState},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"connectionId",{get:function(){return this.connection&&this.connection.connectionId||null},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"baseUrl",{get:function(){return this.connection.baseUrl||""},set:function(e){if(this.connectionState!==u.Disconnected&&this.connectionState!==u.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e},enumerable:!0,configurable:!0}),o.prototype.start=function(){return this.startPromise=this.startWithStateTransitions(),this.startPromise},o.prototype.startWithStateTransitions=function(){return n(this,void 0,void 0,function(){var t;return c(this,function(e){switch(e.label){case 0:if(this.connectionState!==u.Disconnected)return[2,Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))];this.connectionState=u.Connecting,this.logger.log(h.LogLevel.Debug,"Starting HubConnection."),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.startInternal()];case 2:return e.sent(),this.connectionState=u.Connected,this.connectionStarted=!0,this.logger.log(h.LogLevel.Debug,"HubConnection connected successfully."),[3,4];case 3:return t=e.sent(),this.connectionState=u.Disconnected,this.logger.log(h.LogLevel.Debug,"HubConnection failed to start successfully because of error '"+t+"'."),[2,Promise.reject(t)];case 4:return[2]}})})},o.prototype.startInternal=function(){return n(this,void 0,void 0,function(){var t,r,n,o=this;return c(this,function(e){switch(e.label){case 0:return this.stopDuringStartError=void 0,this.receivedHandshakeResponse=!1,t=new Promise(function(e,t){o.handshakeResolver=e,o.handshakeRejecter=t}),[4,this.connection.start(this.protocol.transferFormat)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,5,,7]),r={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(h.LogLevel.Debug,"Sending handshake request."),[4,this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(r))];case 3:return e.sent(),this.logger.log(h.LogLevel.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.resetTimeoutPeriod(),this.resetKeepAliveInterval(),[4,t];case 4:if(e.sent(),this.stopDuringStartError)throw this.stopDuringStartError;return[3,7];case 5:return n=e.sent(),this.logger.log(h.LogLevel.Debug,"Hub handshake failed with error '"+n+"' during start(). Stopping HubConnection."),this.cleanupTimeout(),this.cleanupPingTimer(),[4,this.connection.stop(n)];case 6:throw e.sent(),n;case 7:return[2]}})})},o.prototype.stop=function(){return n(this,void 0,void 0,function(){var t;return c(this,function(e){switch(e.label){case 0:return t=this.startPromise,this.stopPromise=this.stopInternal(),[4,this.stopPromise];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t];case 3:return e.sent(),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}})})},o.prototype.stopInternal=function(e){return this.connectionState===u.Disconnected?(this.logger.log(h.LogLevel.Debug,"Call to HubConnection.stop("+e+") ignored because it is already in the disconnected state."),Promise.resolve()):this.connectionState===u.Disconnecting?(this.logger.log(h.LogLevel.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnecting state."),this.stopPromise):(this.connectionState=u.Disconnecting,this.logger.log(h.LogLevel.Debug,"Stopping HubConnection."),this.reconnectDelayHandle?(this.logger.log(h.LogLevel.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.reconnectDelayHandle),this.reconnectDelayHandle=void 0,this.completeClose(),Promise.resolve()):(this.cleanupTimeout(),this.cleanupPingTimer(),this.stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))},o.prototype.stream=function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o,i=this.replaceStreamingParams(r),s=i[0],i=i[1],a=this.createStreamInvocation(e,r,i),c=new f.Subject;return c.cancelCallback=function(){var e=t.createCancelInvocation(a.invocationId);return delete t.callbacks[a.invocationId],o.then(function(){return t.sendWithProtocol(e)})},this.callbacks[a.invocationId]=function(e,t){t?c.error(t):e&&(e.type===l.MessageType.Completion?e.error?c.error(new Error(e.error)):c.complete():c.next(e.item))},o=this.sendWithProtocol(a).catch(function(e){c.error(e),delete t.callbacks[a.invocationId]}),this.launchStreams(s,o),c},o.prototype.sendMessage=function(e){return this.resetKeepAliveInterval(),this.connection.send(e)},o.prototype.sendWithProtocol=function(e){return this.sendMessage(this.protocol.writeMessage(e))},o.prototype.send=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.replaceStreamingParams(t),o=n[0],n=n[1],n=this.sendWithProtocol(this.createInvocation(e,t,!0,n));return this.launchStreams(o,n),n},o.prototype.invoke=function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=this.replaceStreamingParams(r),i=o[0],o=o[1],s=this.createInvocation(e,r,!1,o);return new Promise(function(r,n){t.callbacks[s.invocationId]=function(e,t){t?n(t):e&&(e.type===l.MessageType.Completion?e.error?n(new Error(e.error)):r(e.result):n(new Error("Unexpected message type: "+e.type)))};var e=t.sendWithProtocol(s).catch(function(e){n(e),delete t.callbacks[s.invocationId]});t.launchStreams(i,e)})},o.prototype.on=function(e,t){e&&t&&(e=e.toLowerCase(),this.methods[e]||(this.methods[e]=[]),-1===this.methods[e].indexOf(t)&&this.methods[e].push(t))},o.prototype.off=function(e,t){var r;e&&(e=e.toLowerCase(),(r=this.methods[e])&&(t?-1!==(t=r.indexOf(t))&&(r.splice(t,1),0===r.length&&delete this.methods[e]):delete this.methods[e]))},o.prototype.onclose=function(e){e&&this.closedCallbacks.push(e)},o.prototype.onreconnecting=function(e){e&&this.reconnectingCallbacks.push(e)},o.prototype.onreconnected=function(e){e&&this.reconnectedCallbacks.push(e)},o.prototype.processIncomingData=function(e){if(this.cleanupTimeout(),this.receivedHandshakeResponse||(e=this.processHandshakeResponse(e),this.receivedHandshakeResponse=!0),e)for(var t=0,r=this.protocol.parseMessages(e,this.logger);t<r.length;t++){var n=r[t];switch(n.type){case l.MessageType.Invocation:this.invokeClientMethod(n);break;case l.MessageType.StreamItem:case l.MessageType.Completion:var o=this.callbacks[n.invocationId];o&&(n.type===l.MessageType.Completion&&delete this.callbacks[n.invocationId],o(n));break;case l.MessageType.Ping:break;case l.MessageType.Close:this.logger.log(h.LogLevel.Information,"Close message received from server.");o=n.error?new Error("Server returned an error on close: "+n.error):void 0;!0===n.allowReconnect?this.connection.stop(o):this.stopPromise=this.stopInternal(o);break;default:this.logger.log(h.LogLevel.Warning,"Invalid message type: "+n.type+".")}}this.resetTimeoutPeriod()},o.prototype.processHandshakeResponse=function(e){var t,r,n;try{n=(t=this.handshakeProtocol.parseHandshakeResponse(e))[0],r=t[1]}catch(e){this.logger.log(h.LogLevel.Error,i="Error parsing handshake response: "+e);var o=new Error(i);throw this.handshakeRejecter(o),o}if(r.error){var i="Server returned handshake error: "+r.error;this.logger.log(h.LogLevel.Error,i);o=new Error(i);throw this.handshakeRejecter(o),o}return this.logger.log(h.LogLevel.Debug,"Server handshake complete."),this.handshakeResolver(),n},o.prototype.resetKeepAliveInterval=function(){var e=this;this.connection.features.inherentKeepAlive||(this.cleanupPingTimer(),this.pingServerHandle=setTimeout(function(){return n(e,void 0,void 0,function(){return c(this,function(e){switch(e.label){case 0:if(this.connectionState!==u.Connected)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.sendMessage(this.cachedPingMessage)];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.cleanupPingTimer(),[3,4];case 4:return[2]}})})},this.keepAliveIntervalInMilliseconds))},o.prototype.resetTimeoutPeriod=function(){var e=this;this.connection.features&&this.connection.features.inherentKeepAlive||(this.timeoutHandle=setTimeout(function(){return e.serverTimeout()},this.serverTimeoutInMilliseconds))},o.prototype.serverTimeout=function(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))},o.prototype.invokeClientMethod=function(t){var r=this,e=this.methods[t.target.toLowerCase()];if(e){try{e.forEach(function(e){return e.apply(r,t.arguments)})}catch(e){this.logger.log(h.LogLevel.Error,"A callback for the method "+t.target.toLowerCase()+" threw error '"+e+"'.")}t.invocationId&&(this.logger.log(h.LogLevel.Error,e="Server requested a response, which is not supported in this version of the client."),this.stopPromise=this.stopInternal(new Error(e)))}else this.logger.log(h.LogLevel.Warning,"No client method with the name '"+t.target+"' found.")},o.prototype.connectionClosed=function(e){this.logger.log(h.LogLevel.Debug,"HubConnection.connectionClosed("+e+") called while in state "+this.connectionState+"."),this.stopDuringStartError=this.stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this.handshakeResolver&&this.handshakeResolver(),this.cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this.cleanupTimeout(),this.cleanupPingTimer(),this.connectionState===u.Disconnecting?this.completeClose(e):this.connectionState===u.Connected&&this.reconnectPolicy?this.reconnect(e):this.connectionState===u.Connected&&this.completeClose(e)},o.prototype.completeClose=function(t){var r=this;if(this.connectionStarted){this.connectionState=u.Disconnected,this.connectionStarted=!1;try{this.closedCallbacks.forEach(function(e){return e.apply(r,[t])})}catch(e){this.logger.log(h.LogLevel.Error,"An onclose callback called with error '"+t+"' threw error '"+e+"'.")}}},o.prototype.reconnect=function(a){return n(this,void 0,void 0,function(){var t,r,n,o,i,s=this;return c(this,function(e){switch(e.label){case 0:if(t=Date.now(),n=void(r=0)!==a?a:new Error("Attempting to reconnect due to a unknown error."),null===(o=this.getNextRetryDelay(r++,0,n)))return this.logger.log(h.LogLevel.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this.completeClose(a),[2];if(this.connectionState=u.Reconnecting,a?this.logger.log(h.LogLevel.Information,"Connection reconnecting because of error '"+a+"'."):this.logger.log(h.LogLevel.Information,"Connection reconnecting."),this.onreconnecting){try{this.reconnectingCallbacks.forEach(function(e){return e.apply(s,[a])})}catch(e){this.logger.log(h.LogLevel.Error,"An onreconnecting callback called with error '"+a+"' threw error '"+e+"'.")}if(this.connectionState!==u.Reconnecting)return this.logger.log(h.LogLevel.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting."),[2]}e.label=1;case 1:return null===o?[3,7]:(this.logger.log(h.LogLevel.Information,"Reconnect attempt number "+r+" will start in "+o+" ms."),[4,new Promise(function(e){s.reconnectDelayHandle=setTimeout(e,o)})]);case 2:if(e.sent(),this.reconnectDelayHandle=void 0,this.connectionState!==u.Reconnecting)return this.logger.log(h.LogLevel.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting."),[2];e.label=3;case 3:return e.trys.push([3,5,,6]),[4,this.startInternal()];case 4:if(e.sent(),this.connectionState=u.Connected,this.logger.log(h.LogLevel.Information,"HubConnection reconnected successfully."),this.onreconnected)try{this.reconnectedCallbacks.forEach(function(e){return e.apply(s,[s.connection.connectionId])})}catch(e){this.logger.log(h.LogLevel.Error,"An onreconnected callback called with connectionId '"+this.connection.connectionId+"; threw error '"+e+"'.")}return[2];case 5:return(i=e.sent(),this.logger.log(h.LogLevel.Information,"Reconnect attempt failed because of error '"+i+"'."),this.connectionState!==u.Reconnecting)?(this.logger.log(h.LogLevel.Debug,"Connection left the reconnecting state during reconnect attempt. Done reconnecting."),[2]):(n=i instanceof Error?i:new Error(i.toString()),o=this.getNextRetryDelay(r++,Date.now()-t,n),[3,6]);case 6:return[3,1];case 7:return this.logger.log(h.LogLevel.Information,"Reconnect retries have been exhausted after "+(Date.now()-t)+" ms and "+r+" failed attempts. Connection disconnecting."),this.completeClose(),[2]}})})},o.prototype.getNextRetryDelay=function(t,r,e){try{return this.reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:r,previousRetryCount:t,retryReason:e})}catch(e){return this.logger.log(h.LogLevel.Error,"IRetryPolicy.nextRetryDelayInMilliseconds("+t+", "+r+") threw error '"+e+"'."),null}},o.prototype.cancelCallbacksWithError=function(t){var r=this.callbacks;this.callbacks={},Object.keys(r).forEach(function(e){(0,r[e])(null,t)})},o.prototype.cleanupPingTimer=function(){this.pingServerHandle&&clearTimeout(this.pingServerHandle)},o.prototype.cleanupTimeout=function(){this.timeoutHandle&&clearTimeout(this.timeoutHandle)},o.prototype.createInvocation=function(e,t,r,n){if(r)return 0!==n.length?{arguments:t,streamIds:n,target:e,type:l.MessageType.Invocation}:{arguments:t,target:e,type:l.MessageType.Invocation};r=this.invocationId;return this.invocationId++,0!==n.length?{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:l.MessageType.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:l.MessageType.Invocation}},o.prototype.launchStreams=function(e,n){var o=this;if(0!==e.length){n=n||Promise.resolve();for(var t in e)!function(r){e[r].subscribe({complete:function(){n=n.then(function(){return o.sendWithProtocol(o.createCompletionMessage(r))})},error:function(e){var t=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error";n=n.then(function(){return o.sendWithProtocol(o.createCompletionMessage(r,t))})},next:function(e){n=n.then(function(){return o.sendWithProtocol(o.createStreamItemMessage(r,e))})}})}(t)}},o.prototype.replaceStreamingParams=function(e){for(var t=[],r=[],n=0;n<e.length;n++){var o,i=e[n];this.isObservable(i)&&(o=this.invocationId,this.invocationId++,t[o]=i,r.push(o.toString()),e.splice(n,1))}return[t,r]},o.prototype.isObservable=function(e){return e&&e.subscribe&&"function"==typeof e.subscribe},o.prototype.createStreamInvocation=function(e,t,r){var n=this.invocationId;return this.invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:l.MessageType.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:l.MessageType.StreamInvocation}},o.prototype.createCancelInvocation=function(e){return{invocationId:e,type:l.MessageType.CancelInvocation}},o.prototype.createStreamItemMessage=function(e,t){return{invocationId:e,item:t,type:l.MessageType.StreamItem}},o.prototype.createCompletionMessage=function(e,t,r){return t?{error:t,invocationId:e,type:l.MessageType.Completion}:{invocationId:e,result:r,type:l.MessageType.Completion}},e=o;function o(e,t,r,n){var o=this;s.Arg.isRequired(e,"connection"),s.Arg.isRequired(t,"logger"),s.Arg.isRequired(r,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this.logger=t,this.protocol=r,this.connection=e,this.reconnectPolicy=n,this.handshakeProtocol=new i.HandshakeProtocol,this.connection.onreceive=function(e){return o.processIncomingData(e)},this.connection.onclose=function(e){return o.connectionClosed(e)},this.callbacks={},this.methods={},this.closedCallbacks=[],this.reconnectingCallbacks=[],this.reconnectedCallbacks=[],this.invocationId=0,this.receivedHandshakeResponse=!1,this.connectionState=u.Disconnected,this.connectionStarted=!1,this.cachedPingMessage=this.protocol.writeMessage({type:l.MessageType.Ping})}r.HubConnection=e},{"./HandshakeProtocol":6,"./IHubProtocol":11,"./ILogger":12,"./Subject":18,"./Utils":20}],10:[function(e,t,r){"use strict";var n=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(r,"__esModule",{value:!0});var o=e("./DefaultReconnectPolicy"),i=e("./HttpConnection"),s=e("./HubConnection"),a=e("./ILogger"),c=e("./JsonHubProtocol"),u=e("./Loggers"),l=e("./Utils"),h={trace:a.LogLevel.Trace,debug:a.LogLevel.Debug,info:a.LogLevel.Information,information:a.LogLevel.Information,warn:a.LogLevel.Warning,warning:a.LogLevel.Warning,error:a.LogLevel.Error,critical:a.LogLevel.Critical,none:a.LogLevel.None};f.prototype.configureLogging=function(e){var t;return l.Arg.isRequired(e,"logging"),void 0!==e.log?this.logger=e:"string"==typeof e?(t=function(e){var t=h[e.toLowerCase()];if(void 0!==t)return t;throw new Error("Unknown log level: "+e)}(e),this.logger=new l.ConsoleLogger(t)):this.logger=new l.ConsoleLogger(e),this},f.prototype.withUrl=function(e,t){return l.Arg.isRequired(e,"url"),l.Arg.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=n({},this.httpConnectionOptions,"object"==typeof t?t:{transport:t}),this},f.prototype.withHubProtocol=function(e){return l.Arg.isRequired(e,"protocol"),this.protocol=e,this},f.prototype.withAutomaticReconnect=function(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new o.DefaultReconnectPolicy(e):this.reconnectPolicy=e:this.reconnectPolicy=new o.DefaultReconnectPolicy,this},f.prototype.build=function(){var e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");e=new i.HttpConnection(this.url,e);return s.HubConnection.create(e,this.logger||u.NullLogger.instance,this.protocol||new c.JsonHubProtocol,this.reconnectPolicy)},a=f;function f(){}r.HubConnectionBuilder=a},{"./DefaultReconnectPolicy":3,"./HttpConnection":8,"./HubConnection":9,"./ILogger":12,"./JsonHubProtocol":14,"./Loggers":15,"./Utils":20}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),(r=r.MessageType||(r.MessageType={}))[r.Invocation=1]="Invocation",r[r.StreamItem=2]="StreamItem",r[r.Completion=3]="Completion",r[r.StreamInvocation=4]="StreamInvocation",r[r.CancelInvocation=5]="CancelInvocation",r[r.Ping=6]="Ping",r[r.Close=7]="Close"},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),(r=r.LogLevel||(r.LogLevel={}))[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Information=2]="Information",r[r.Warning=3]="Warning",r[r.Error=4]="Error",r[r.Critical=5]="Critical",r[r.None=6]="None"},{}],13:[function(e,t,r){"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),(n=r.HttpTransportType||(r.HttpTransportType={}))[n.None=0]="None",n[n.WebSockets=1]="WebSockets",n[n.ServerSentEvents=2]="ServerSentEvents",n[n.LongPolling=4]="LongPolling",(r=r.TransferFormat||(r.TransferFormat={}))[r.Text=1]="Text",r[r.Binary=2]="Binary"},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("./IHubProtocol"),c=e("./ILogger"),n=e("./ITransport"),u=e("./Loggers"),l=e("./TextMessageFormat"),e=(o.prototype.parseMessages=function(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=u.NullLogger.instance);for(var r=[],n=0,o=l.TextMessageFormat.parse(e);n<o.length;n++){var i=o[n],s=JSON.parse(i);if("number"!=typeof s.type)throw new Error("Invalid payload.");switch(s.type){case a.MessageType.Invocation:this.isInvocationMessage(s);break;case a.MessageType.StreamItem:this.isStreamItemMessage(s);break;case a.MessageType.Completion:this.isCompletionMessage(s);break;case a.MessageType.Ping:case a.MessageType.Close:break;default:t.log(c.LogLevel.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r},o.prototype.writeMessage=function(e){return l.TextMessageFormat.write(JSON.stringify(e))},o.prototype.isInvocationMessage=function(e){this.assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this.assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")},o.prototype.isStreamItemMessage=function(e){if(this.assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")},o.prototype.isCompletionMessage=function(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this.assertNotEmptyString(e.error,"Invalid payload for Completion message."),this.assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")},o.prototype.assertNotEmptyString=function(e,t){if("string"!=typeof e||""===e)throw new Error(t)},o);function o(){this.name="json",this.version=1,this.transferFormat=n.TransferFormat.Text}r.JsonHubProtocol=e},{"./IHubProtocol":11,"./ILogger":12,"./ITransport":13,"./Loggers":15,"./TextMessageFormat":19}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=(o.prototype.log=function(e,t){},o.instance=new o,o);function o(){}r.NullLogger=n},{}],16:[function(e,t,r){"use strict";var a=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},u=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(r,"__esModule",{value:!0});var s=e("./AbortController"),l=e("./Errors"),h=e("./ILogger"),f=e("./ITransport"),p=e("./Utils"),e=(Object.defineProperty(n.prototype,"pollAborted",{get:function(){return this.pollAbort.aborted},enumerable:!0,configurable:!0}),n.prototype.connect=function(i,s){return c(this,void 0,void 0,function(){var t,r,n,o;return u(this,function(e){switch(e.label){case 0:if(p.Arg.isRequired(i,"url"),p.Arg.isRequired(s,"transferFormat"),p.Arg.isIn(s,f.TransferFormat,"transferFormat"),this.url=i,this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Connecting."),s===f.TransferFormat.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");return n=p.getUserAgentHeader(),t=n[0],r=n[1],n=a(((n={})[t]=r,n),this.headers),n={abortSignal:this.pollAbort.signal,headers:n,timeout:1e5,withCredentials:this.withCredentials},s===f.TransferFormat.Binary&&(n.responseType="arraybuffer"),[4,this.getAccessToken()];case 1:return o=e.sent(),this.updateHeaderToken(n,o),o=i+"&_="+Date.now(),this.logger.log(h.LogLevel.Trace,"(LongPolling transport) polling: "+o+"."),[4,this.httpClient.get(o,n)];case 2:return 200!==(o=e.sent()).statusCode?(this.logger.log(h.LogLevel.Error,"(LongPolling transport) Unexpected response code: "+o.statusCode+"."),this.closeError=new l.HttpError(o.statusText||"",o.statusCode),this.running=!1):this.running=!0,this.receiving=this.poll(this.url,n),[2]}})})},n.prototype.getAccessToken=function(){return c(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,null]}})})},n.prototype.updateHeaderToken=function(e,t){e.headers||(e.headers={}),t?e.headers.Authorization="Bearer "+t:e.headers.Authorization&&delete e.headers.Authorization},n.prototype.poll=function(n,o){return c(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:e.trys.push([0,,8,9]),e.label=1;case 1:return this.running?[4,this.getAccessToken()]:[3,7];case 2:t=e.sent(),this.updateHeaderToken(o,t),e.label=3;case 3:return e.trys.push([3,5,,6]),t=n+"&_="+Date.now(),this.logger.log(h.LogLevel.Trace,"(LongPolling transport) polling: "+t+"."),[4,this.httpClient.get(t,o)];case 4:return 204===(r=e.sent()).statusCode?(this.logger.log(h.LogLevel.Information,"(LongPolling transport) Poll terminated by server."),this.running=!1):200!==r.statusCode?(this.logger.log(h.LogLevel.Error,"(LongPolling transport) Unexpected response code: "+r.statusCode+"."),this.closeError=new l.HttpError(r.statusText||"",r.statusCode),this.running=!1):r.content?(this.logger.log(h.LogLevel.Trace,"(LongPolling transport) data received. "+p.getDataDetail(r.content,this.logMessageContent)+"."),this.onreceive&&this.onreceive(r.content)):this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Poll timed out, reissuing."),[3,6];case 5:return r=e.sent(),this.running?r instanceof l.TimeoutError?this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.closeError=r,this.running=!1):this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Poll errored after shutdown: "+r.message),[3,6];case 6:return[3,1];case 7:return[3,9];case 8:return this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.raiseOnClose(),[7];case 9:return[2]}})})},n.prototype.send=function(t){return c(this,void 0,void 0,function(){return u(this,function(e){return this.running?[2,p.sendMessage(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,t,this.logMessageContent,this.withCredentials,this.headers)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},n.prototype.stop=function(){return c(this,void 0,void 0,function(){var t,r,n;return u(this,function(e){switch(e.label){case 0:this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Stopping polling."),this.running=!1,this.pollAbort.abort(),e.label=1;case 1:return e.trys.push([1,,5,6]),[4,this.receiving];case 2:return e.sent(),this.logger.log(h.LogLevel.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),n={},r=p.getUserAgentHeader(),t=r[0],r=r[1],n[t]=r,r={headers:a({},n,this.headers),withCredentials:this.withCredentials},[4,this.getAccessToken()];case 3:return n=e.sent(),this.updateHeaderToken(r,n),[4,this.httpClient.delete(this.url,r)];case 4:return e.sent(),this.logger.log(h.LogLevel.Trace,"(LongPolling transport) DELETE request sent."),[3,6];case 5:return this.logger.log(h.LogLevel.Trace,"(LongPolling transport) Stop finished."),this.raiseOnClose(),[7];case 6:return[2]}})})},n.prototype.raiseOnClose=function(){var e;this.onclose&&(e="(LongPolling transport) Firing onclose event.",this.closeError&&(e+=" Error: "+this.closeError),this.logger.log(h.LogLevel.Trace,e),this.onclose(this.closeError))},n);function n(e,t,r,n,o,i){this.httpClient=e,this.accessTokenFactory=t,this.logger=r,this.pollAbort=new s.AbortController,this.logMessageContent=n,this.withCredentials=o,this.headers=i,this.running=!1,this.onreceive=null,this.onclose=null}r.LongPollingTransport=e},{"./AbortController":1,"./Errors":4,"./ILogger":12,"./ITransport":13,"./Utils":20}],17:[function(e,t,r){"use strict";var l=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},o=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(r,"__esModule",{value:!0});var h=e("./ILogger"),f=e("./ITransport"),p=e("./Utils"),e=(i.prototype.connect=function(c,u){return n(this,void 0,void 0,function(){var t,a=this;return o(this,function(e){switch(e.label){case 0:return p.Arg.isRequired(c,"url"),p.Arg.isRequired(u,"transferFormat"),p.Arg.isIn(u,f.TransferFormat,"transferFormat"),this.logger.log(h.LogLevel.Trace,"(SSE transport) Connecting."),this.url=c,this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(t=e.sent())&&(c+=(c.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(t)),e.label=2;case 2:return[2,new Promise(function(e,t){var r=!1;if(u===f.TransferFormat.Text){var n,o,i,s=p.Platform.isBrowser||p.Platform.isWebWorker?new a.eventSourceConstructor(c,{withCredentials:a.withCredentials}):(o=a.httpClient.getCookieString(c),(n={}).Cookie=o,o=(i=p.getUserAgentHeader())[0],i=i[1],n[o]=i,new a.eventSourceConstructor(c,{withCredentials:a.withCredentials,headers:l({},n,a.headers)}));try{s.onmessage=function(e){if(a.onreceive)try{a.logger.log(h.LogLevel.Trace,"(SSE transport) data received. "+p.getDataDetail(e.data,a.logMessageContent)+"."),a.onreceive(e.data)}catch(e){return void a.close(e)}},s.onerror=function(e){e=new Error(e.data||"Error occurred");r?a.close(e):t(e)},s.onopen=function(){a.logger.log(h.LogLevel.Information,"SSE connected to "+a.url),a.eventSource=s,r=!0,e()}}catch(e){return void t(e)}}else t(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})]}})})},i.prototype.send=function(t){return n(this,void 0,void 0,function(){return o(this,function(e){return this.eventSource?[2,p.sendMessage(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,t,this.logMessageContent,this.withCredentials,this.headers)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},i.prototype.stop=function(){return this.close(),Promise.resolve()},i.prototype.close=function(e){this.eventSource&&(this.eventSource.close(),this.eventSource=void 0,this.onclose&&this.onclose(e))},i);function i(e,t,r,n,o,i,s){this.httpClient=e,this.accessTokenFactory=t,this.logger=r,this.logMessageContent=n,this.withCredentials=i,this.eventSourceConstructor=o,this.headers=s,this.onreceive=null,this.onclose=null}r.ServerSentEventsTransport=e},{"./ILogger":12,"./ITransport":13,"./Utils":20}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./Utils"),e=(o.prototype.next=function(e){for(var t=0,r=this.observers;t<r.length;t++)r[t].next(e)},o.prototype.error=function(e){for(var t=0,r=this.observers;t<r.length;t++){var n=r[t];n.error&&n.error(e)}},o.prototype.complete=function(){for(var e=0,t=this.observers;e<t.length;e++){var r=t[e];r.complete&&r.complete()}},o.prototype.subscribe=function(e){return this.observers.push(e),new n.SubjectSubscription(this,e)},o);function o(){this.observers=[]}r.Subject=e},{"./Utils":20}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=(o.write=function(e){return""+e+o.RecordSeparator},o.parse=function(e){if(e[e.length-1]!==o.RecordSeparator)throw new Error("Message is incomplete.");e=e.split(o.RecordSeparator);return e.pop(),e},o.RecordSeparatorCode=30,o.RecordSeparator=String.fromCharCode(o.RecordSeparatorCode),o);function o(){}r.TextMessageFormat=n},{}],20:[function(f,e,p){!function(h){!function(){"use strict";var d=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},g=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(p,"__esModule",{value:!0});var y=f("./ILogger"),t=f("./Loggers");p.VERSION="5.0.4";var r=(n.isRequired=function(e,t){if(null==e)throw new Error("The '"+t+"' argument is required.")},n.isNotEmpty=function(e,t){if(!e||e.match(/^\s*$/))throw new Error("The '"+t+"' argument should not be empty.")},n.isIn=function(e,t,r){if(!(e in t))throw new Error("Unknown "+r+" value: "+e+".")},n);function n(){}p.Arg=r;var o=(Object.defineProperty(i,"isBrowser",{get:function(){return"object"==typeof window},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isWebWorker",{get:function(){return"object"==typeof self&&"importScripts"in self},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isNode",{get:function(){return!this.isBrowser&&!this.isWebWorker},enumerable:!0,configurable:!0}),i);function i(){}function b(e,t){var r="";return m(e)?(r="Binary data of length "+e.byteLength,t&&(r+=". Content: '"+s(e)+"'")):"string"==typeof e&&(r="String data of length "+e.length,t&&(r+=". Content: '"+e+"'")),r}function s(e){var e=new Uint8Array(e),t="";return e.forEach(function(e){t+="0x"+(e<16?"0":"")+e.toString(16)+" "}),t.substr(0,t.length-1)}function m(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}p.Platform=o,p.getDataDetail=b,p.formatArrayBuffer=s,p.isArrayBuffer=m,p.sendMessage=function(i,s,a,c,u,l,h,f,p){return e(this,void 0,void 0,function(){var t,r,n,o;return g(this,function(e){switch(e.label){case 0:return t={},u?[4,u()]:[3,2];case 1:(r=e.sent())&&((n={}).Authorization="Bearer "+r,t=n),e.label=2;case 2:return o=v(),n=o[0],o=o[1],t[n]=o,i.log(y.LogLevel.Trace,"("+s+" transport) sending data. "+b(l,h)+"."),o=m(l)?"arraybuffer":"text",[4,a.post(c,{content:l,headers:d({},t,p),responseType:o,withCredentials:f})];case 3:return o=e.sent(),i.log(y.LogLevel.Trace,"("+s+" transport) request complete. Response status: "+o.statusCode+"."),[2]}})})},p.createLogger=function(e){return void 0===e?new c(y.LogLevel.Information):null===e?t.NullLogger.instance:e.log?e:new c(e)};a.prototype.dispose=function(){var e=this.subject.observers.indexOf(this.observer);-1<e&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},r=a;function a(e,t){this.subject=e,this.observer=t}p.SubjectSubscription=r;var c=(u.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case y.LogLevel.Critical:case y.LogLevel.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+y.LogLevel[e]+": "+t);break;case y.LogLevel.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+y.LogLevel[e]+": "+t);break;case y.LogLevel.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+y.LogLevel[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+y.LogLevel[e]+": "+t)}},u);function u(e){this.minimumLogLevel=e,this.outputConsole=console}function v(){var e="X-SignalR-User-Agent";return[e=o.isNode?"User-Agent":e,l(p.VERSION,function(){{if(!o.isNode)return"";switch(h.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return h.platform}}}(),o.isNode?"NodeJS":"Browser",function(){if(o.isNode)return h.versions.node;return}())]}function l(e,t,r,n){var o="Microsoft SignalR/",i=e.split(".");return o+=i[0]+"."+i[1],o+=" ("+e+"; ",o+=t&&""!==t?t+"; ":"Unknown OS; ",o+=""+r,o+=n?"; "+n:"; Unknown Runtime Version",o+=")"}p.ConsoleLogger=c,p.getUserAgentHeader=v,p.constructUserAgent=l}.call(this)}.call(this,f("_process"))},{"./ILogger":12,"./Loggers":15,_process:61}],21:[function(e,t,r){"use strict";var h=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n=this&&this.__awaiter||function(i,s,a,c){return new(a=a||Promise)(function(e,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function n(e){try{o(c.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(r,n)}o((c=c.apply(i,s||[])).next())})},o=this&&this.__generator||function(r,n){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(r,"__esModule",{value:!0});var f=e("./ILogger"),p=e("./ITransport"),d=e("./Utils"),e=(i.prototype.connect=function(u,l){return n(this,void 0,void 0,function(){var t,c=this;return o(this,function(e){switch(e.label){case 0:return d.Arg.isRequired(u,"url"),d.Arg.isRequired(l,"transferFormat"),d.Arg.isIn(l,p.TransferFormat,"transferFormat"),this.logger.log(f.LogLevel.Trace,"(WebSockets transport) Connecting."),this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(t=e.sent())&&(u+=(u.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(t)),e.label=2;case 2:return[2,new Promise(function(t,r){var n;u=u.replace(/^http/,"ws");var e,o,i,s=c.httpClient.getCookieString(u),a=!1;d.Platform.isNode&&(e={},o=(i=d.getUserAgentHeader())[0],i=i[1],e[o]=i,s&&(e.Cookie=""+s),n=new c.webSocketConstructor(u,void 0,{headers:h({},e,c.headers)})),n=n||new c.webSocketConstructor(u),l===p.TransferFormat.Binary&&(n.binaryType="arraybuffer"),n.onopen=function(e){c.logger.log(f.LogLevel.Information,"WebSocket connected to "+u+"."),c.webSocket=n,a=!0,t()},n.onerror=function(e){var t=null,t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:new Error("There was an error with the transport.");r(t)},n.onmessage=function(e){if(c.logger.log(f.LogLevel.Trace,"(WebSockets transport) data received. "+d.getDataDetail(e.data,c.logMessageContent)+"."),c.onreceive)try{c.onreceive(e.data)}catch(e){return void c.close(e)}},n.onclose=function(e){var t;a?c.close(e):(t=null,t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:new Error("There was an error with the transport."),r(t))}})]}})})},i.prototype.send=function(e){return this.webSocket&&this.webSocket.readyState===this.webSocketConstructor.OPEN?(this.logger.log(f.LogLevel.Trace,"(WebSockets transport) sending data. "+d.getDataDetail(e,this.logMessageContent)+"."),this.webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},i.prototype.stop=function(){return this.webSocket&&this.close(void 0),Promise.resolve()},i.prototype.close=function(e){this.webSocket&&(this.webSocket.onclose=function(){},this.webSocket.onmessage=function(){},this.webSocket.onerror=function(){},this.webSocket.close(),this.webSocket=void 0),this.logger.log(f.LogLevel.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error("WebSocket closed with status code: "+e.code+" ("+e.reason+").")))},i.prototype.isCloseEvent=function(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code},i);function i(e,t,r,n,o,i){this.logger=r,this.accessTokenFactory=t,this.logMessageContent=n,this.webSocketConstructor=o,this.httpClient=e,this.onreceive=null,this.onclose=null,this.headers=i}r.WebSocketTransport=e},{"./ILogger":12,"./ITransport":13,"./Utils":20}],22:[function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var i,s=e("./Errors"),a=e("./HttpClient"),c=e("./ILogger"),o=(i=a.HttpClient,o(u,i),u.prototype.send=function(o){var i=this;return o.abortSignal&&o.abortSignal.aborted?Promise.reject(new s.AbortError):o.method?o.url?new Promise(function(e,t){var r=new XMLHttpRequest;r.open(o.method,o.url,!0),r.withCredentials=void 0===o.withCredentials||o.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var n=o.headers;n&&Object.keys(n).forEach(function(e){r.setRequestHeader(e,n[e])}),o.responseType&&(r.responseType=o.responseType),o.abortSignal&&(o.abortSignal.onabort=function(){r.abort(),t(new s.AbortError)}),o.timeout&&(r.timeout=o.timeout),r.onload=function(){o.abortSignal&&(o.abortSignal.onabort=null),200<=r.status&&r.status<300?e(new a.HttpResponse(r.status,r.statusText,r.response||r.responseText)):t(new s.HttpError(r.statusText,r.status))},r.onerror=function(){i.logger.log(c.LogLevel.Warning,"Error from HTTP request. "+r.status+": "+r.statusText+"."),t(new s.HttpError(r.statusText,r.status))},r.ontimeout=function(){i.logger.log(c.LogLevel.Warning,"Timeout from HTTP request."),t(new s.TimeoutError)},r.send(o.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},u);function u(e){var t=i.call(this)||this;return t.logger=e,t}r.XhrHttpClient=o},{"./Errors":4,"./HttpClient":7,"./ILogger":12}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./Errors");r.AbortError=n.AbortError,r.HttpError=n.HttpError,r.TimeoutError=n.TimeoutError;n=e("./HttpClient");r.HttpClient=n.HttpClient,r.HttpResponse=n.HttpResponse;n=e("./DefaultHttpClient");r.DefaultHttpClient=n.DefaultHttpClient;n=e("./HubConnection");r.HubConnection=n.HubConnection,r.HubConnectionState=n.HubConnectionState;n=e("./HubConnectionBuilder");r.HubConnectionBuilder=n.HubConnectionBuilder;n=e("./IHubProtocol");r.MessageType=n.MessageType;n=e("./ILogger");r.LogLevel=n.LogLevel;n=e("./ITransport");r.HttpTransportType=n.HttpTransportType,r.TransferFormat=n.TransferFormat;n=e("./Loggers");r.NullLogger=n.NullLogger;n=e("./JsonHubProtocol");r.JsonHubProtocol=n.JsonHubProtocol;n=e("./Subject");r.Subject=n.Subject;e=e("./Utils");r.VERSION=e.VERSION},{"./DefaultHttpClient":2,"./Errors":4,"./HttpClient":7,"./HubConnection":9,"./HubConnectionBuilder":10,"./IHubProtocol":11,"./ILogger":12,"./ITransport":13,"./JsonHubProtocol":14,"./Loggers":15,"./Subject":18,"./Utils":20}],24:[function(e,t,r){t.exports=e("./lib/axios")},{"./lib/axios":26}],25:[function(e,t,r){"use strict";var c=e("./../utils"),u=e("./../core/settle"),l=e("./../helpers/cookies"),h=e("./../helpers/buildURL"),f=e("../core/buildFullPath"),p=e("./../helpers/parseHeaders"),d=e("./../helpers/isURLSameOrigin"),g=e("../core/createError");t.exports=function(a){return new Promise(function(t,r){var n=a.data,o=a.headers;c.isFormData(n)&&delete o["Content-Type"];var e,i=new XMLHttpRequest;a.auth&&(e=a.auth.username||"",s=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"",o.Authorization="Basic "+btoa(e+":"+s));var s=f(a.baseURL,a.url);if(i.open(a.method.toUpperCase(),h(s,a.params,a.paramsSerializer),!0),i.timeout=a.timeout,i.onreadystatechange=function(){var e;i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))&&(e="getAllResponseHeaders"in i?p(i.getAllResponseHeaders()):null,e={data:a.responseType&&"text"!==a.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:e,config:a,request:i},u(t,r,e),i=null)},i.onabort=function(){i&&(r(g("Request aborted",a,"ECONNABORTED",i)),i=null)},i.onerror=function(){r(g("Network Error",a,null,i)),i=null},i.ontimeout=function(){var e="timeout of "+a.timeout+"ms exceeded";a.timeoutErrorMessage&&(e=a.timeoutErrorMessage),r(g(e,a,"ECONNABORTED",i)),i=null},!c.isStandardBrowserEnv()||(s=(a.withCredentials||d(s))&&a.xsrfCookieName?l.read(a.xsrfCookieName):void 0)&&(o[a.xsrfHeaderName]=s),"setRequestHeader"in i&&c.forEach(o,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)}),c.isUndefined(a.withCredentials)||(i.withCredentials=!!a.withCredentials),a.responseType)try{i.responseType=a.responseType}catch(e){if("json"!==a.responseType)throw e}"function"==typeof a.onDownloadProgress&&i.addEventListener("progress",a.onDownloadProgress),"function"==typeof a.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",a.onUploadProgress),a.cancelToken&&a.cancelToken.promise.then(function(e){i&&(i.abort(),r(e),i=null)}),i.send(n=n||null)})}},{"../core/buildFullPath":32,"../core/createError":33,"./../core/settle":37,"./../helpers/buildURL":41,"./../helpers/cookies":43,"./../helpers/isURLSameOrigin":46,"./../helpers/parseHeaders":48,"./../utils":50}],26:[function(e,t,r){"use strict";var n=e("./utils"),o=e("./helpers/bind"),i=e("./core/Axios"),s=e("./core/mergeConfig");function a(e){var t=new i(e),e=o(i.prototype.request,t);return n.extend(e,i.prototype,t),n.extend(e,t),e}var c=a(e("./defaults"));c.Axios=i,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=e("./cancel/Cancel"),c.CancelToken=e("./cancel/CancelToken"),c.isCancel=e("./cancel/isCancel"),c.all=function(e){return Promise.all(e)},c.spread=e("./helpers/spread"),c.isAxiosError=e("./helpers/isAxiosError"),t.exports=c,t.exports.default=c},{"./cancel/Cancel":27,"./cancel/CancelToken":28,"./cancel/isCancel":29,"./core/Axios":30,"./core/mergeConfig":36,"./defaults":39,"./helpers/bind":40,"./helpers/isAxiosError":45,"./helpers/spread":49,"./utils":50}],27:[function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},{}],28:[function(e,t,r){"use strict";var n=e("./Cancel");function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new n(e),t(r.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},{"./Cancel":27}],29:[function(e,t,r){"use strict";t.exports=function(e){return!(!e||!e.__CANCEL__)}},{}],30:[function(e,t,r){"use strict";var n=e("./../utils"),o=e("../helpers/buildURL"),i=e("./InterceptorManager"),s=e("./dispatchRequest"),a=e("./mergeConfig");function c(e){this.defaults=e,this.interceptors={request:new i,response:new i}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],function(r){c.prototype[r]=function(e,t){return this.request(a(t||{},{method:r,url:e,data:(t||{}).data}))}}),n.forEach(["post","put","patch"],function(n){c.prototype[n]=function(e,t,r){return this.request(a(r||{},{method:n,url:e,data:t}))}}),t.exports=c},{"../helpers/buildURL":41,"./../utils":50,"./InterceptorManager":31,"./dispatchRequest":34,"./mergeConfig":36}],31:[function(e,t,r){"use strict";var n=e("./../utils");function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},{"./../utils":50}],32:[function(e,t,r){"use strict";var n=e("../helpers/isAbsoluteURL"),o=e("../helpers/combineURLs");t.exports=function(e,t){return e&&!n(t)?o(e,t):t}},{"../helpers/combineURLs":42,"../helpers/isAbsoluteURL":44}],33:[function(e,t,r){"use strict";var i=e("./enhanceError");t.exports=function(e,t,r,n,o){e=new Error(e);return i(e,t,r,n,o)}},{"./enhanceError":35}],34:[function(e,t,r){"use strict";var n=e("./../utils"),o=e("./transformData"),i=e("../cancel/isCancel"),s=e("../defaults");function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}t.exports=function(t){return a(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return a(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(a(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},{"../cancel/isCancel":29,"../defaults":39,"./../utils":50,"./transformData":38}],35:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},{}],36:[function(e,t,r){"use strict";var l=e("../utils");t.exports=function(t,r){r=r||{};var n={},e=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function a(e,t){return l.isPlainObject(e)&&l.isPlainObject(t)?l.merge(e,t):l.isPlainObject(t)?l.merge({},t):l.isArray(t)?t.slice():t}function c(e){l.isUndefined(r[e])?l.isUndefined(t[e])||(n[e]=a(void 0,t[e])):n[e]=a(t[e],r[e])}l.forEach(e,function(e){l.isUndefined(r[e])||(n[e]=a(void 0,r[e]))}),l.forEach(o,c),l.forEach(i,function(e){l.isUndefined(r[e])?l.isUndefined(t[e])||(n[e]=a(void 0,t[e])):n[e]=a(void 0,r[e])}),l.forEach(s,function(e){e in r?n[e]=a(t[e],r[e]):e in t&&(n[e]=a(void 0,t[e]))});var u=e.concat(o).concat(i).concat(s),s=Object.keys(t).concat(Object.keys(r)).filter(function(e){return-1===u.indexOf(e)});return l.forEach(s,c),n}},{"../utils":50}],37:[function(e,t,r){"use strict";var o=e("./createError");t.exports=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(o("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},{"./createError":33}],38:[function(e,t,r){"use strict";var n=e("./../utils");t.exports=function(t,r,e){return n.forEach(e,function(e){t=e(t,r)}),t}},{"./../utils":50}],39:[function(a,c,e){!function(s){!function(){"use strict";var r=a("./utils"),n=a("./helpers/normalizeHeaderName"),t={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var e,i={adapter:("undefined"!=typeof XMLHttpRequest?e=a("./adapters/xhr"):void 0!==s&&"[object process]"===Object.prototype.toString.call(s)&&(e=a("./adapters/http")),e),transformRequest:[function(e,t){return n(t,"Accept"),n(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){i.headers[e]={}}),r.forEach(["post","put","patch"],function(e){i.headers[e]=r.merge(t)}),c.exports=i}.call(this)}.call(this,a("_process"))},{"./adapters/http":25,"./adapters/xhr":25,"./helpers/normalizeHeaderName":47,"./utils":50,_process:61}],40:[function(e,t,r){"use strict";t.exports=function(r,n){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return r.apply(n,e)}}},{}],41:[function(e,t,r){"use strict";var o=e("./../utils");function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(e,t,r){if(!t)return e;var n,r=r?r(t):o.isURLSearchParams(t)?t.toString():(n=[],o.forEach(t,function(e,t){null!=e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),n.push(i(t)+"="+i(e))}))}),n.join("&"));return r&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r),e}},{"./../utils":50}],42:[function(e,t,r){"use strict";t.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},{}],43:[function(e,t,r){"use strict";var a=e("./../utils");t.exports=a.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),a.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),a.isString(n)&&s.push("path="+n),a.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},{"./../utils":50}],44:[function(e,t,r){"use strict";t.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},{}],45:[function(e,t,r){"use strict";t.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},{}],46:[function(e,t,r){"use strict";var n,o,i,s=e("./../utils");function a(e){return o&&(i.setAttribute("href",e),e=i.href),i.setAttribute("href",e),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}t.exports=s.isStandardBrowserEnv()?(o=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),n=a(window.location.href),function(e){e=s.isString(e)?a(e):e;return e.protocol===n.protocol&&e.host===n.host}):function(){return!0}},{"./../utils":50}],47:[function(e,t,r){"use strict";var o=e("../utils");t.exports=function(r,n){o.forEach(r,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(r[n]=e,delete r[t])})}},{"../utils":50}],48:[function(e,t,r){"use strict";var o=e("./../utils"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(e){var t,r,n={};return e&&o.forEach(e.split("\n"),function(e){r=e.indexOf(":"),t=o.trim(e.substr(0,r)).toLowerCase(),r=o.trim(e.substr(r+1)),t&&(n[t]&&0<=i.indexOf(t)||(n[t]="set-cookie"===t?(n[t]||[]).concat([r]):n[t]?n[t]+", "+r:r))}),n}},{"./../utils":50}],49:[function(e,t,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},{}],50:[function(e,t,r){"use strict";var o=e("./helpers/bind"),n=Object.prototype.toString;function i(e){return"[object Array]"===n.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==n.call(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}function u(e){return"[object Function]"===n.call(e)}function l(e,t){if(null!=e)if(i(e="object"!=typeof e?[e]:e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}t.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===n.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===n.call(e)},isFile:function(e){return"[object File]"===n.call(e)},isBlob:function(e){return"[object Blob]"===n.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function r(){var n={};function e(e,t){c(n[t])&&c(e)?n[t]=r(n[t],e):c(e)?n[t]=r({},e):i(e)?n[t]=e.slice():n[t]=e}for(var t=0,o=arguments.length;t<o;t++)l(arguments[t],e);return n},extend:function(r,e,n){return l(e,function(e,t){r[t]=n&&"function"==typeof e?o(e,n):e}),r},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e}}},{"./helpers/bind":40}],51:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},r.toByteArray=function(e){var t,r,n=l(e),o=n[0],n=n[1],i=new u(function(e,t){return 3*(e+t)/4-t}(o,n)),s=0,a=0<n?o-4:o;for(r=0;r<a;r+=4)t=c[e.charCodeAt(r)]<<18|c[e.charCodeAt(r+1)]<<12|c[e.charCodeAt(r+2)]<<6|c[e.charCodeAt(r+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=255&t;2===n&&(t=c[e.charCodeAt(r)]<<2|c[e.charCodeAt(r+1)]>>4,i[s++]=255&t);1===n&&(t=c[e.charCodeAt(r)]<<10|c[e.charCodeAt(r+1)]<<4|c[e.charCodeAt(r+2)]>>2,i[s++]=t>>8&255,i[s++]=255&t);return i},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(function(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return o.join("")}(e,i,s<i+16383?s:i+16383));1==n?(t=e[r-1],o.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return o.join("")};for(var a=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=n.length;o<i;++o)a[o]=n[o],c[n.charCodeAt(o)]=o;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],52:[function(e,t,r){},{}],53:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{dup:52}],54:[function(e,O,I){!function(P){!function(){!function(e){var t="object"==typeof I&&I&&!I.nodeType&&I,r="object"==typeof O&&O&&!O.nodeType&&O,n="object"==typeof P&&P;n.global!==n&&n.window!==n&&n.self!==n||(e=n);var o,i,y=2147483647,b=36,m=1,v=26,s=38,a=700,w=72,S=128,_="-",c=/^xn--/,u=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=b-m,E=Math.floor,T=String.fromCharCode;function C(e){throw new RangeError(h[e])}function p(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function d(e,t){var r=e.split("@"),n="";return 1<r.length&&(n=r[0]+"@",e=r[1]),n+p((e=e.replace(l,".")).split("."),t).join(".")}function L(e){for(var t,r,n=[],o=0,i=e.length;o<i;)55296<=(t=e.charCodeAt(o++))&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function g(e){return p(e,function(e){var t="";return 65535<e&&(t+=T((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=T(e)}).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function R(e,t,r){var n=0;for(e=r?E(e/a):e>>1,e+=E(e/t);f*v>>1<e;n+=b)e=E(e/f);return E(n+(f+1)*e/(e+s))}function A(e){var t,r,n,o,i,s,a,c=[],u=e.length,l=0,h=S,f=w,p=e.lastIndexOf(_);for(p<0&&(p=0),r=0;r<p;++r)128<=e.charCodeAt(r)&&C("not-basic"),c.push(e.charCodeAt(r));for(n=0<p?p+1:0;n<u;){for(o=l,i=1,s=b;u<=n&&C("invalid-input"),a=e.charCodeAt(n++),(b<=(a=a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:b)||a>E((y-l)/i))&&C("overflow"),l+=a*i,!(a<(a=s<=f?m:f+v<=s?v:s-f));s+=b)i>E(y/(a=b-a))&&C("overflow"),i*=a;f=R(l-o,t=c.length+1,0==o),E(l/t)>y-h&&C("overflow"),h+=E(l/t),l%=t,c.splice(l++,0,h)}return g(c)}function x(e){for(var t,r,n,o,i,s,a,c,u,l,h=[],f=(e=L(e)).length,p=S,d=w,g=t=0;g<f;++g)(a=e[g])<128&&h.push(T(a));for(r=n=h.length,n&&h.push(_);r<f;){for(o=y,g=0;g<f;++g)p<=(a=e[g])&&a<o&&(o=a);for(o-p>E((y-t)/(c=r+1))&&C("overflow"),t+=(o-p)*c,p=o,g=0;g<f;++g)if((a=e[g])<p&&++t>y&&C("overflow"),a==p){for(i=t,s=b;!(i<(u=s<=d?m:d+v<=s?v:s-d));s+=b)h.push(T(k(u+(l=i-u)%(u=b-u),0))),i=E(l/u);h.push(T(k(i,0))),d=R(t,c,r==n),t=0,++r}++t,++p}return h.join("")}if(o={version:"1.4.1",ucs2:{decode:L,encode:g},decode:A,encode:x,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+x(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?A(e.slice(4).toLowerCase()):e})}},0,t&&r)if(O.exports==t)r.exports=o;else for(i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);else e.punycode=o}(this)}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],55:[function(P,e,O){!function(e){!function(){"use strict";var a=P("base64-js"),i=P("ieee754");O.Buffer=h,O.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},O.INSPECT_MAX_BYTES=50;var t=2147483647;function o(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return e.__proto__=h.prototype,e}function h(e,t,r){if("number"!=typeof e)return n(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}function n(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=o(r),t=n.write(e,t);t!==r&&(n=n.slice(0,t));return n}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');r=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return r.__proto__=h.prototype,r}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return h.from(n,t,r);n=function(e){if(h.isBuffer(e)){var t=0|l(e.length),r=o(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(void 0!==e.length)return"number"!=typeof e.length||x(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return s(e),o(e<0?0:0|l(e))}function u(e){for(var t=e.length<0?0:0|l(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function f(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(e).length;default:if(o)return n?-1:L(e).length;t=(""+t).toLowerCase(),o=!0}}function r(e,t,r){var n,o,i,s=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||n<r)&&(r=n);for(var o="",i=t;i<r;++i)o+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[i]);return o}(this,t,r);case"utf8":case"utf-8":return m(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}(this,t,r);case"base64":return n=this,i=r,0===(o=t)&&i===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,t,r);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=x(r=+r)?o?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=h.from(t,n)),h.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){var i=1,s=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=i=2,a/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o)for(var u=-1,l=r;l<s;l++)if(c(e,l)===c(t,-1===u?0:l-u)){if(l-(u=-1===u?l:u)+1===a)return u*i}else-1!==u&&(l-=l-u),u=-1;else for(l=r=s<r+a?s-a:r;0<=l;l--){for(var h=!0,f=0;f<a;f++)if(c(e,l+f)!==c(t,f)){h=!1;break}if(h)return l}return-1}function y(e,t,r,n){return R(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return R(function(e,t){for(var r,n,o=[],i=0;i<e.length&&!((t-=2)<0);++i)n=e.charCodeAt(i),r=n>>8,n=n%256,o.push(n),o.push(r);return o}(t,e.length-r),e,r,n)}function m(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,c,u=e[o],l=null,h=239<u?4:223<u?3:191<u?2:1;if(o+h<=r)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[o+1]))&&127<(c=(31&u)<<6|63&i)&&(l=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&2047<(c=(15&u)<<12|(63&i)<<6|63&s)&&(c<55296||57343<c)&&(l=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,h=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=h}return function(e){var t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=v));return r}(n)}O.kMaxLength=t,(h.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=n,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(e,t,r){return t=t,r=r,s(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},h.allocUnsafe=c,h.allocUnsafeSlow=c,h.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==h.prototype},h.compare=function(e,t){if(A(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},h.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}},h.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);if(void 0===t)for(o=t=0;o<e.length;++o)t+=e[o].length;for(var r=h.allocUnsafe(t),n=0,o=0;o<e.length;++o){var i=e[o];if(A(i,Uint8Array)&&(i=h.from(i)),!h.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},h.byteLength=f,h.prototype._isBuffer=!0,h.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)p(this,t,t+1);return this},h.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)p(this,t,t+3),p(this,t+1,t+2);return this},h.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)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?m(this,0,e):r.apply(this,arguments)},h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function(){var e="",t=O.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h.prototype.compare=function(e,t,r,n,o){if(A(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=t)return 0;if(o<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),c=this.slice(n,o),u=e.slice(t,r),l=0;l<a;++l)if(c[l]!==u[l]){i=c[l],s=u[l];break}return i<s?-1:s<i?1:0},h.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},h.prototype.indexOf=function(e,t,r){return d(this,e,t,r,!0)},h.prototype.lastIndexOf=function(e,t,r){return d(this,e,t,r,!1)},h.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||o<r)&&(r=o),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,s,a,c=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var o=e.length-r;(!n||o<(n=Number(n)))&&(n=o),(o=t.length)/2<n&&(n=o/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(x(s))return i;e[r+i]=s}return i}(this,e,t,r);case"utf8":case"utf-8":return s=t,a=r,R(L(e,(i=this).length-s),i,s,a);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return i=this,s=t,a=r,R(k(e),i,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function w(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,r,n,o,i){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<t||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function _(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(e,t,r,n,o){return t=+t,r>>>=0,o||_(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function T(e,t,r,n,o){return t=+t,r>>>=0,o||_(e,0,r,8),i.write(e,t,r,n,52,8),r+8}h.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r);t=this.subarray(e,t=t<e?e:t);return t.__proto__=h.prototype,t},h.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},h.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],o=1;0<t&&(o*=256);)n+=this[e+--t]*o;return n},h.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*t)),n},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,o=1,i=this[e+--n];0<n&&(o*=256);)i+=this[e+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*t)),i},h.prototype.readInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},h.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},h.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;0<=--o&&(i*=256);)this[t+o]=e/i&255;return t+r},h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||S(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||S(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,s=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||S(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return T(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return T(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,n){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=e.length-t<n-r?e.length-t+r:n)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=o-1;0<=i;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o},h.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o;1===e.length&&(o=e.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(e=o))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(i=t;i<r;++i)this[i]=e;else{var s=h.isBuffer(e)?e:h.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var C=/[^+/0-9A-Za-z-_]/g;function L(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if(55295<(r=e.charCodeAt(s))&&r<57344){if(!o){if(56319<r){-1<(t-=3)&&i.push(239,191,189);continue}if(s+1===n){-1<(t-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(t-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(t-=3)&&i.push(239,191,189);if(o=null,r<128){if(--t<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function k(e){return a.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function R(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function x(e){return e!=e}}.call(this)}.call(this,P("buffer").Buffer)},{"base64-js":51,buffer:55,ieee754:59}],56:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],57:[function(e,t,r){"use strict";var n="object"==typeof Reflect?Reflect:null,c=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};var o=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(a,c){return new Promise(function(e,t){function r(e){a.removeListener(c,n),t(e)}function n(){"function"==typeof a.removeListener&&a.removeListener("error",r),e([].slice.call(arguments))}var o,i,s;y(a,c,n,{once:!0}),"error"!==c&&(i=r,s={once:!0},"function"==typeof(o=a).on&&y(o,"error",i,s))})},(s.EventEmitter=s).prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var o,i;return u(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener||r),o=e._events),i=o[t]),void 0===i?(i=o[t]=r,++e._eventsCount):("function"==typeof i?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),0<(r=l(e))&&i.length>r&&!i.warned&&(i.warned=!0,(r=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=e,r.type=t,r.count=i.length,r=r,console&&console.warn&&console.warn(r))),e}function f(e,t,r){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},t=function(){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)}.bind(e);return t.listener=r,e.wrapFn=t}function p(e,t,r){e=e._events;if(void 0===e)return[];t=e[t];return void 0===t?[]:"function"==typeof t?r?[t.listener||t]:[t]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):g(t,t.length)}function d(e){var t=this._events;if(void 0!==t){e=t[e];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(r,n,o,i){if("function"==typeof r.on)i.once?r.once(n,o):r.on(n,o);else{if("function"!=typeof r.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r);r.addEventListener(n,function e(t){i.once&&r.removeEventListener(n,e),o(t)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n,o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){if((n=0<t.length?t[0]:n)instanceof Error)throw n;o=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw o.context=n,o}e=i[e];if(void 0===e)return!1;if("function"==typeof e)c(e,this,t);else for(var s=e.length,a=g(e,s),r=0;r<s;++r)c(a[r],this,t);return!0},s.prototype.addListener=function(e,t){return h(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return h(this,e,t,!0)},s.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,o,i,s;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;0<=i;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r=this._events;if(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[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){for(var n,o=Object.keys(r),i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;0<=i;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return 0<this._eventsCount?o(this._events):[]}},{}],58:[function(e,t,r){var n,o=e("http"),i=e("url"),s=t.exports;for(n in o)o.hasOwnProperty(n)&&(s[n]=o[n]);function a(e){if((e="string"==typeof e?i.parse(e):e).protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}s.request=function(e,t){return e=a(e),o.request.call(this,e,t)},s.get=function(e,t){return e=a(e),o.get.call(this,e,t)}},{http:66,url:86}],59:[function(e,t,r){r.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,l=-7,h=r?o-1:0,f=r?-1:1,r=e[t+h];for(h+=f,i=r&(1<<-l)-1,r>>=-l,l+=a;0<l;i=256*i+e[t+h],h+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;0<l;s=256*s+e[t+h],h+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(r?-1:1);s+=Math.pow(2,n),i-=u}return(r?-1:1)*s*Math.pow(2,i-n)},r.write=function(e,t,r,n,o,i){var s,a,c=8*i-o-1,u=(1<<c)-1,l=u>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,p=n?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+l?h/n:h*Math.pow(2,1-l))*n&&(s++,n/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(t*n-1)*Math.pow(2,o),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));8<=o;e[r+f]=255&a,f+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;0<c;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*i}},{}],60:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){var r;t&&(e.super_=t,(r=function(){}).prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e)}},{}],61:[function(e,t,r){var n,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}}();var c,u=[],l=!1,h=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length}c=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=g,t.addListener=g,t.once=g,t.off=g,t.removeListener=g,t.removeAllListeners=g,t.emit=g,t.prependListener=g,t.prependOnceListener=g,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],62:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(t=t||"&");t=1e3;n&&"number"==typeof n.maxKeys&&(t=n.maxKeys);var s=e.length;0<t&&t<s&&(s=t);for(var a=0;a<s;++a){var c,u=e[a].replace(i,"%20"),l=u.indexOf(r),h=0<=l?(c=u.substr(0,l),u.substr(l+1)):(c=u,""),f=decodeURIComponent(c),l=decodeURIComponent(h);u=o,h=f,Object.prototype.hasOwnProperty.call(u,h)?p(o[f])?o[f].push(l):o[f]=[o[f],l]:o[f]=l}return o};var p=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],63:[function(e,t,r){"use strict";function i(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}t.exports=function(r,n,o,e){return n=n||"&",o=o||"=","object"==typeof(r=null===r?void 0:r)?a(c(r),function(e){var t=encodeURIComponent(i(e))+o;return s(r[e])?a(r[e],function(e){return t+encodeURIComponent(i(e))}).join(n):t+encodeURIComponent(i(r[e]))}).join(n):e?encodeURIComponent(i(e))+o+encodeURIComponent(i(r)):""};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var c=Object.keys||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}},{}],64:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":62,"./encode":63}],65:[function(e,t,r){var n=e("buffer"),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(i(n,r),r.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=o(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:55}],66:[function(n,e,o){!function(u){!function(){var s=n("./lib/request"),e=n("./lib/response"),a=n("xtend"),t=n("builtin-status-codes"),c=n("url"),r=o;r.request=function(e,t){e="string"==typeof e?c.parse(e):a(e);var r=-1===u.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||r,o=e.hostname||e.host,i=e.port,r=e.path||"/";o&&-1!==o.indexOf(":")&&(o="["+o+"]"),e.url=(o?n+"//"+o:"")+(i?":"+i:"")+r,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};e=new s(e);return t&&e.on("response",t),e},r.get=function(e,t){t=r.request(e,t);return t.end(),t},r.ClientRequest=s,r.IncomingMessage=e.IncomingMessage,r.Agent=function(){},r.Agent.defaultMaxSockets=4,r.globalAgent=new r.Agent,r.STATUS_CODES=t,r.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":68,"./lib/response":69,"builtin-status-codes":56,url:86,xtend:89}],67:[function(e,t,i){!function(o){!function(){var t;function r(){if(void 0!==t)return t;if(o.XMLHttpRequest){t=new o.XMLHttpRequest;try{t.open("GET",o.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function e(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function n(e){return"function"==typeof e}i.fetch=n(o.fetch)&&n(o.ReadableStream),i.writableStream=n(o.WritableStream),i.abortController=n(o.AbortController),i.arraybuffer=i.fetch||e("arraybuffer"),i.msstream=!i.fetch&&e("ms-stream"),i.mozchunkedarraybuffer=!i.fetch&&e("moz-chunked-arraybuffer"),i.overrideMimeType=i.fetch||!!r()&&n(r().overrideMimeType),t=null}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],68:[function(s,a,e){!function(l,h,i){!function(){var c=s("./capability"),e=s("inherits"),t=s("./response"),o=s("readable-stream"),r=t.IncomingMessage,u=t.readyStates;t=a.exports=function(t){var r=this;o.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+i.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){r.setHeader(e,t.headers[e])});var e,n=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!c.abortController)e=!(n=!1);else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!c.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=(e=e,n=n,c.fetch&&n?"fetch":c.mozchunkedarraybuffer?"moz-chunked-arraybuffer":c.msstream?"ms-stream":c.arraybuffer&&e?"arraybuffer":"text"),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};e(t,o.Writable),t.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===n.indexOf(r)&&(this._headers[r]={name:e,value:t})},t.prototype.getHeader=function(e){e=this._headers[e.toLowerCase()];return e?e.value:null},t.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},t.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,r=t._headers,n=null;"GET"!==e.method&&"HEAD"!==e.method&&(n=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var o=[];if(Object.keys(r).forEach(function(e){var t=r[e].name,e=r[e].value;Array.isArray(e)?e.forEach(function(e){o.push([t,e])}):o.push([t,e])}),"fetch"===t._mode){var i,s=null;c.abortController&&(s=(i=new AbortController).signal,t._fetchAbortController=i,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=h.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))),h.fetch(t._opts.url,{method:t._opts.method,headers:o,body:n||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:s}).then(function(e){t._fetchResponse=e,t._connect()},function(e){h.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)})}else{var a=t._xhr=new h.XMLHttpRequest;try{a.open(t._opts.method,t._opts.url,!0)}catch(e){return void l.nextTick(function(){t.emit("error",e)})}"responseType"in a&&(a.responseType=t._mode),"withCredentials"in a&&(a.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(a.timeout=e.requestTimeout,a.ontimeout=function(){t.emit("requestTimeout")}),o.forEach(function(e){a.setRequestHeader(e[0],e[1])}),t._response=null,a.onreadystatechange=function(){switch(a.readyState){case u.LOADING:case u.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(a.onprogress=function(){t._onXHRProgress()}),a.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{a.send(n)}catch(e){return void l.nextTick(function(){t.emit("error",e)})}}}},t.prototype._onXHRProgress=function(){var e=this;!function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return}}(e._xhr)||e._destroyed||(e._response||e._connect(),e._response._onXHRProgress())},t.prototype._connect=function(){var t=this;t._destroyed||(t._response=new r(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},t.prototype._write=function(e,t,r){this._body.push(e),r()},t.prototype.abort=t.prototype.destroy=function(){var e=this;e._destroyed=!0,h.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},t.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),o.Writable.prototype.end.call(this,e,t,r)},t.prototype.flushHeaders=function(){},t.prototype.setTimeout=function(){},t.prototype.setNoDelay=function(){},t.prototype.setSocketKeepAlive=function(){};var n=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}.call(this)}.call(this,s("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s("buffer").Buffer)},{"./capability":67,"./response":69,_process:61,buffer:55,inherits:60,"readable-stream":84}],69:[function(r,e,n){!function(u,l,h){!function(){var s=r("./capability"),e=r("inherits"),a=r("readable-stream"),c=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},t=n.IncomingMessage=function(e,t,r,n){var o=this;if(a.Readable.call(o),o._mode=r,o.headers={},o.rawHeaders=[],o.trailers={},o.rawTrailers=[],o.on("end",function(){u.nextTick(function(){o.emit("close")})}),"fetch"===r){if(o._fetchResponse=t,o.url=t.url,o.statusCode=t.status,o.statusMessage=t.statusText,t.headers.forEach(function(e,t){o.headers[t.toLowerCase()]=e,o.rawHeaders.push(t,e)}),s.writableStream){r=new WritableStream({write:function(r){return new Promise(function(e,t){o._destroyed?t():o.push(h.from(r))?e():o._resumeFetch=e})},close:function(){l.clearTimeout(n),o._destroyed||o.push(null)},abort:function(e){o._destroyed||o.emit("error",e)}});try{return void t.body.pipeTo(r).catch(function(e){l.clearTimeout(n),o._destroyed||o.emit("error",e)})}catch(e){}}var i=t.body.getReader();!function t(){i.read().then(function(e){if(!o._destroyed){if(e.done)return l.clearTimeout(n),void o.push(null);o.push(h.from(e.value)),t()}}).catch(function(e){l.clearTimeout(n),o._destroyed||o.emit("error",e)})}()}else o._xhr=e,o._pos=0,o.url=e.responseURL,o.statusCode=e.status,o.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);t&&("set-cookie"===(e=t[1].toLowerCase())?(void 0===o.headers[e]&&(o.headers[e]=[]),o.headers[e].push(t[2])):void 0!==o.headers[e]?o.headers[e]+=", "+t[2]:o.headers[e]=t[2],o.rawHeaders.push(t[1],t[2]))}),o._charset="x-user-defined",s.overrideMimeType||(!(e=o.rawHeaders["mime-type"])||(e=e.match(/;\s*charset=([^;])(;|$)/))&&(o._charset=e[1].toLowerCase()),o._charset||(o._charset="utf-8"))};e(t,a.Readable),t.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},t.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text":if((r=t.responseText).length>e._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var o=h.alloc(n.length),i=0;i<n.length;i++)o[i]=255&n.charCodeAt(i);e.push(o)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==c.DONE||!t.response)break;r=t.response,e.push(h.from(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==c.LOADING||!r)break;e.push(h.from(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==c.LOADING)break;var s=new l.MSStreamReader;s.onprogress=function(){s.result.byteLength>e._pos&&(e.push(h.from(new Uint8Array(s.result.slice(e._pos)))),e._pos=s.result.byteLength)},s.onload=function(){e.push(null)},s.readAsArrayBuffer(r)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}.call(this)}.call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":67,_process:61,buffer:55,inherits:60,"readable-stream":84}],70:[function(e,t,r){"use strict";var n={};function o(e,o,t){var r=function(n){var e,t;function r(e,t,r){return n.call(this,(e=e,t=t,r=r,"string"==typeof o?o:o(e,t,r)))||this}return t=n,(e=r).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t,r}(t=t||Error);r.prototype.name=t.name,r.prototype.code=e,n[e]=r}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),2<r?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,o,i,s,a;return"string"==typeof t&&(s="not ",t.substr(!i||i<0?0:+i,s.length)===s)?(n="must not be",t=t.replace(/^not /,"")):n="must be",i=e,s=" argument",(void 0===a||a>i.length)&&(a=i.length),t=i.substring(a-s.length,a)===s?"The ".concat(e," ").concat(n," ").concat(c(t,"type")):(o=(o="number"!=typeof o?0:o)+(a=".").length>(s=e).length||-1===s.indexOf(a,o)?"argument":"property",'The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(c(t,"type"))),t+=". Received type ".concat(typeof r)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],71:[function(l,h,e){!function(u){!function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r};h.exports=s;var t=l("./_stream_readable"),r=l("./_stream_writable");l("inherits")(s,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];s.prototype[i]||(s.prototype[i]=r.prototype[i])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||u.nextTick(c,this)}function c(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}.call(this)}.call(this,l("_process"))},{"./_stream_readable":73,"./_stream_writable":75,_process:61,inherits:60}],72:[function(e,t,r){"use strict";t.exports=o;var n=e("./_stream_transform");function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}e("inherits")(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":74,inherits:60}],73:[function(D,B,e){!function(U,H){!function(){"use strict";var n;(B.exports=w).ReadableState=v;function d(e,t){return e.listeners(t).length}D("events").EventEmitter;var o=D("./internal/streams/stream"),l=D("buffer").Buffer,h=H.Uint8Array||function(){};var i,e,r,t=D("util"),g=t&&t.debuglog?t.debuglog("stream"):function(){},s=D("./internal/streams/buffer_list"),a=D("./internal/streams/destroy"),c=D("./internal/streams/state").getHighWaterMark,t=D("../errors").codes,f=t.ERR_INVALID_ARG_TYPE,p=t.ERR_STREAM_PUSH_AFTER_EOF,u=t.ERR_METHOD_NOT_IMPLEMENTED,y=t.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;D("inherits")(w,o);var b=a.errorOrDestroy,m=["error","close","destroy","pause","resume"];function v(e,t,r){n=n||D("./_stream_duplex"),"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!(e=e||{}).objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=c(this,e,"readableHighWaterMark",r),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(i=i||D("string_decoder/").StringDecoder,this.decoder=new i(e.encoding),this.encoding=e.encoding)}function w(e){if(n=n||D("./_stream_duplex"),!(this instanceof w))return new w(e);this._readableState=new v(e,this,this instanceof n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function S(e,t,r,n,o){g("readableAddChunk",t);var i,s,a,c,u=e._readableState;if(null===t)u.reading=!1,s=e,a=u,g("onEofChunk"),a.ended||(!a.decoder||(c=a.decoder.end())&&c.length&&(a.buffer.push(c),a.length+=a.objectMode?1:c.length),a.ended=!0,a.sync?C(s):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,L(s))));else if(i=!o?function(e,t){var r;(function(e){return l.isBuffer(e)||e instanceof h})(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new f("chunk",["string","Buffer","Uint8Array"],t));return r}(u,t):i)b(e,i);else if(u.objectMode||t&&0<t.length)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===l.prototype||(i=t,t=l.from(i)),n)u.endEmitted?b(e,new y):_(e,u,t,!0);else if(u.ended)b(e,new p);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?_(e,u,t,!1):k(e,u)):_(e,u,t,!1)}else n||(u.reading=!1,k(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&C(e)),k(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=a.destroy,w.prototype._undestroy=a.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},w.prototype.unshift=function(e){return S(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){var t=new(i=i||D("string_decoder/").StringDecoder)(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var E=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?(t.flowing&&t.length?t.buffer.head.data:t).length:(e>t.highWaterMark&&(t.highWaterMark=(E<=(r=e)?r=E:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function C(e){var t=e._readableState;g("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,U.nextTick(L,e))}function L(e){var t=e._readableState;g("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,O(e)}function k(e,t){t.readingMore||(t.readingMore=!0,U.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(g("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function A(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function x(e){g("readable nexttick read 0"),e.read(0)}function P(e,t){g("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(g("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;g("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,U.nextTick(M,t,e))}function M(e,t){g("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),!e.autoDestroy||(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function N(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){g("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:0<t.length)||t.ended))return g("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?j:C)(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&j(this),null;var n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&g("length less than watermark",n=!0),t.ended||t.reading?g("reading or ended",n=!1):n&&(g("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(n=0<e?I(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){b(this,new u("_read()"))},w.prototype.pipe=function(r,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=r;break;case 1:o.pipes=[o.pipes,r];break;default:o.pipes.push(r)}o.pipesCount+=1,g("pipe count=%d opts=%j",o.pipesCount,e);e=(!e||!1!==e.end)&&r!==U.stdout&&r!==U.stderr?s:p;function i(e,t){g("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,g("cleanup"),r.removeListener("close",h),r.removeListener("finish",f),r.removeListener("drain",a),r.removeListener("error",l),r.removeListener("unpipe",i),n.removeListener("end",s),n.removeListener("end",p),n.removeListener("data",u),c=!0,!o.awaitDrain||r._writableState&&!r._writableState.needDrain||a())}function s(){g("onend"),r.end()}o.endEmitted?U.nextTick(e):n.once("end",e),r.on("unpipe",i);var t,a=(t=n,function(){var e=t._readableState;g("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&d(t,"data")&&(e.flowing=!0,O(t))});r.on("drain",a);var c=!1;function u(e){g("ondata");e=r.write(e);g("dest.write",e),!1===e&&((1===o.pipesCount&&o.pipes===r||1<o.pipesCount&&-1!==N(o.pipes,r))&&!c&&(g("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function l(e){g("onerror",e),p(),r.removeListener("error",l),0===d(r,"error")&&b(r,e)}function h(){r.removeListener("finish",f),p()}function f(){g("onfinish"),r.removeListener("close",h),p()}function p(){g("unpipe"),n.unpipe(r)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(r,"error",l),r.once("close",h),r.once("finish",f),r.emit("pipe",n),o.flowing||(g("pipe resume"),n.resume()),r},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e=e||t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=N(t.pipes,e);return-1===s||(t.pipes.splice(s,1),--t.pipesCount,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.addListener=w.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),t=this._readableState;return"data"===e?(t.readableListening=0<this.listenerCount("readable"),!1!==t.flowing&&this.resume()):"readable"===e&&(t.endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.flowing=!1,t.emittedReadable=!1,g("on readable",t.length,t.reading),t.length?C(this):t.reading||U.nextTick(x,this))),r},w.prototype.removeListener=function(e,t){t=o.prototype.removeListener.call(this,e,t);return"readable"===e&&U.nextTick(A,this),t},w.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||U.nextTick(A,this),t},w.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(g("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,U.nextTick(P,e,t))),r.paused=!1,this},w.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(t){var e,r=this,n=this._readableState,o=!1;for(e in t.on("end",function(){var e;g("wrapped end"),!n.decoder||n.ended||(e=n.decoder.end())&&e.length&&r.push(e),r.push(null)}),t.on("data",function(e){g("wrapped data"),n.decoder&&(e=n.decoder.write(e)),n.objectMode&&null==e||(n.objectMode||e&&e.length)&&(r.push(e)||(o=!0,t.pause()))}),t)void 0===this[e]&&"function"==typeof t[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));for(var i=0;i<m.length;i++)t.on(m[i],this.emit.bind(this,m[i]));return this._read=function(e){g("wrapped _read",e),o&&(o=!1,t.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return(e=void 0===e?D("./internal/streams/async_iterator"):e)(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=I,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return(r=void 0===r?D("./internal/streams/from"):r)(w,e,t)})}.call(this)}.call(this,D("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":70,"./_stream_duplex":71,"./internal/streams/async_iterator":76,"./internal/streams/buffer_list":77,"./internal/streams/destroy":78,"./internal/streams/from":80,"./internal/streams/state":82,"./internal/streams/stream":83,_process:61,buffer:55,events:57,inherits:60,"string_decoder/":85,util:52}],74:[function(e,t,r){"use strict";t.exports=c;var t=e("../errors").codes,n=t.ERR_METHOD_NOT_IMPLEMENTED,o=t.ERR_MULTIPLE_CALLBACK,i=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=t.ERR_TRANSFORM_WITH_LENGTH_0,a=e("./_stream_duplex");function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),this._transformState={afterTransform:function(e,t){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)!=t&&this.push(t),n(e),(e=this._readableState).reading=!1,(e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var r=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush(function(e,t){l(r,e,t)})}function l(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new i;return e.push(null)}e("inherits")(c,a),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new n("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r,n.writechunk=e,n.writeencoding=t,n.transforming||(t=this._readableState,(n.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark))},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){a.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":70,"./_stream_duplex":71,inherits:60}],75:[function(x,P,e){!function(R,A){!function(){"use strict";function l(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var n;(P.exports=S).WritableState=w;var e={deprecate:x("util-deprecate")},r=x("./internal/streams/stream"),h=x("buffer").Buffer,f=A.Uint8Array||function(){};var o,t=x("./internal/streams/destroy"),i=x("./internal/streams/state").getHighWaterMark,s=x("../errors").codes,p=s.ERR_INVALID_ARG_TYPE,a=s.ERR_METHOD_NOT_IMPLEMENTED,c=s.ERR_MULTIPLE_CALLBACK,u=s.ERR_STREAM_CANNOT_PIPE,d=s.ERR_STREAM_DESTROYED,g=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,m=t.errorOrDestroy;function v(){}function w(e,t,r){n=n||x("./_stream_duplex"),"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!(e=e||{}).objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=i(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;r=(this.destroyed=!1)===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new c;(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0})(r),t?function(e,t,r,n,o){--t.pendingcb,r?(R.nextTick(o,n),R.nextTick(k,e,t),e._writableState.errorEmitted=!0,m(e,n)):(o(n),e._writableState.errorEmitted=!0,m(e,n),k(e,t))}(e,r,n,t,o):((t=C(r)||e.destroyed)||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?R.nextTick(E,e,r,t,o):E(e,r,t,o))}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function S(e){var t=this instanceof(n=n||x("./_stream_duplex"));if(!t&&!o.call(S,this))return new S(e);this._writableState=new w(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),r.call(this)}function _(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new d("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function E(e,t,r,n){var o;r||(o=e,0===(r=t).length&&r.needDrain&&(r.needDrain=!1,o.emit("drain"))),t.pendingcb--,n(),k(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),n=t.corkedRequestsFree;n.entry=r;for(var i=0,s=!0;r;)(o[i]=r).isBuf||(s=!1),r=r.next,i+=1;o.allBuffers=s,_(e,t,!0,t.length,o,"",n.finish),t.pendingcb++,t.lastBufferedRequest=null,n.next?(t.corkedRequestsFree=n.next,n.next=null):t.corkedRequestsFree=new l(t),t.bufferedRequestCount=0}else{for(;r;){var a=r.chunk,c=r.encoding,u=r.callback;if(_(e,t,!1,t.objectMode?1:a.length,a,c,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function L(t,r){t._final(function(e){r.pendingcb--,e&&m(t,e),r.prefinished=!0,t.emit("prefinish"),k(t,r)})}function k(e,t){var r,n,o=C(t);return o&&(r=e,(n=t).prefinished||n.finalCalled||("function"!=typeof r._final||n.destroyed?(n.prefinished=!0,r.emit("prefinish")):(n.pendingcb++,n.finalCalled=!0,R.nextTick(L,r,n))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),!t.autoDestroy||(!(t=e._readableState)||t.autoDestroy&&t.endEmitted)&&e.destroy())),o}x("inherits")(S,r),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===S&&(e&&e._writableState instanceof w)}})):o=function(e){return e instanceof this},S.prototype.pipe=function(){m(this,new u)},S.prototype.write=function(e,t,r){var n,o,i,s,a,c,u=this._writableState,l=!1,n=!u.objectMode&&(n=e,h.isBuffer(n)||n instanceof f);return n&&!h.isBuffer(e)&&(o=e,e=h.from(o)),"function"==typeof t&&(r=t,t=null),t=n?"buffer":t||u.defaultEncoding,"function"!=typeof r&&(r=v),u.ending?(s=this,a=r,c=new y,m(s,c),R.nextTick(a,c)):!n&&(o=this,s=u,a=r,null===(c=e)?i=new g:"string"==typeof c||s.objectMode||(i=new p("chunk",["string","Buffer"],c)),i&&(m(o,i),!void R.nextTick(a,i)))||(u.pendingcb++,l=function(e,t,r,n,o,i){r||(c=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,o),n!==c&&(r=!0,o="buffer",n=c));var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;a||(t.needDrain=!0);{var c;t.writing||t.corked?(c=t.lastBufferedRequest,t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1):_(e,t,!1,s,n,o,i)}return a}(this,u,n,e,t,r)),l},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new b(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new a("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,t=e=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?R.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=t.destroy,S.prototype._undestroy=t.undestroy,S.prototype._destroy=function(e,t){t(e)}}.call(this)}.call(this,x("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":70,"./_stream_duplex":71,"./internal/streams/destroy":78,"./internal/streams/state":82,"./internal/streams/stream":83,_process:61,buffer:55,inherits:60,"util-deprecate":88}],76:[function(n,y,e){!function(g){!function(){"use strict";var e;function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=n("./end-of-stream"),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t,r=e[i];null===r||null!==(t=e[h].read())&&(e[u]=null,e[i]=null,e[s]=null,r(f(t,!1)))}var t=Object.getPrototypeOf(function(){}),d=Object.setPrototypeOf((r(e={get stream(){return this[h]},next:function(){var r=this,e=this[a];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise(function(e,t){g.nextTick(function(){r[a]?t(r[a]):e(f(void 0,!0))})});var t,n,o,e=this[u];if(e)t=new Promise((n=e,o=this,function(e,t){n.then(function(){o[c]?e(f(void 0,!0)):o[l](e,t)},t)}));else{e=this[h].read();if(null!==e)return Promise.resolve(f(e,!1));t=new Promise(this[l])}return this[u]=t}},Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(f(void 0,!0))})})}),e),t);y.exports=function(e){var t,n=Object.create(d,(r(t={},h,{value:e,writable:!0}),r(t,i,{value:null,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:e._readableState.endEmitted,writable:!0}),r(t,l,{value:function(e,t){var r=n[h].read();r?(n[u]=null,n[i]=null,n[s]=null,e(f(r,!1))):(n[i]=e,n[s]=t)},writable:!0}),t));return n[u]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[u]=null,n[i]=null,n[s]=null,t(e)),void(n[a]=e)}e=n[i];null!==e&&(n[u]=null,n[i]=null,e(f(void 0,!(n[s]=null)))),n[c]=!0}),e.on("readable",function(e){g.nextTick(p,e)}.bind(null,n)),n}}.call(this)}.call(this,n("_process"))},{"./end-of-stream":79,_process:61}],77:[function(e,t,r){"use strict";function i(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function o(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach(function(e){var t,r;t=n,e=o[r=e],r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=e("buffer").Buffer,c=e("util").inspect,u=c&&c.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){e={data:e,next:null};0<this.length?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(e){e={data:e,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,o=a.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=o,n=s,a.prototype.copy.call(t,r,n),s+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t).data=o.slice(i);break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0===(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=o.slice(i);break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return c(this,o({},t,{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),n&&s(t,n),e}()},{buffer:55,util:52}],78:[function(e,t,r){!function(c){!function(){"use strict";function i(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(a,this,e)):c.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?c.nextTick(s,r):(r._writableState.errorEmitted=!0,c.nextTick(i,r,e)):c.nextTick(i,r,e):t?(c.nextTick(s,r),t(e)):c.nextTick(s,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}.call(this)}.call(this,e("_process"))},{_process:61}],79:[function(e,t,r){"use strict";var b=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function m(){}t.exports=function e(t,r,n){if("function"==typeof r)return e(t,null,r);var o,i;o=n||m,i=!1,n=function(){if(!i){i=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t)}};function s(){t.writable||g()}function a(){y=!(f=!1),p||n.call(t)}function c(e){n.call(t,e)}function u(){var e;return f&&!y?(t._readableState&&t._readableState.ended||(e=new b),n.call(t,e)):p&&!d?(t._writableState&&t._writableState.ended||(e=new b),n.call(t,e)):void 0}function l(){t.req.on("finish",g)}var h,f=(r=r||{}).readable||!1!==r.readable&&t.readable,p=r.writable||!1!==r.writable&&t.writable,d=t._writableState&&t._writableState.finished,g=function(){d=!(p=!1),f||n.call(t)},y=t._readableState&&t._readableState.endEmitted;return(h=t).setHeader&&"function"==typeof h.abort?(t.on("complete",g),t.on("abort",u),t.req?l():t.on("request",l)):p&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",a),t.on("finish",g),!1!==r.error&&t.on("error",c),t.on("close",u),function(){t.removeListener("complete",g),t.removeListener("abort",u),t.removeListener("request",l),t.req&&t.req.removeListener("finish",g),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",g),t.removeListener("end",a),t.removeListener("error",c),t.removeListener("close",u)}}},{"../../../errors":70}],80:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],81:[function(c,e,t){"use strict";var u;var r=c("../../../errors").codes,a=r.ERR_MISSING_ARGS,l=r.ERR_STREAM_DESTROYED;function h(e){if(e)throw e}function f(r,e,t,n){var o,i;o=n,i=!1;var s=!(n=function(){i||(i=!0,o.apply(void 0,arguments))});r.on("close",function(){s=!0}),(u=void 0===u?c("./end-of-stream"):u)(r,{readable:e,writable:t},function(e){return e?n(e):(s=!0,void n())});var a=!1;return function(e){var t;if(!s&&!a)return a=!0,(t=r).setHeader&&"function"==typeof t.abort?r.abort():"function"==typeof r.destroy?r.destroy():void n(e||new l("pipe"))}}function p(e){e()}function d(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,o,i=!(r=n).length||"function"!=typeof r[r.length-1]?h:r.pop();if((n=Array.isArray(n[0])?n[0]:n).length<2)throw new a("streams");var s=n.map(function(e,t){var r=t<n.length-1;return f(e,r,0<t,function(e){o=o||e,e&&s.forEach(p),r||(s.forEach(p),i(o))})});return n.reduce(d)}},{"../../../errors":70,"./end-of-stream":79}],82:[function(e,t,r){"use strict";var s=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,n){var o,i=(o=n,i=r,null!=(t=t).highWaterMark?t.highWaterMark:o?t[i]:null);if(null==i)return e.objectMode?16:16384;if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new s(n?r:"highWaterMark",i);return Math.floor(i)}}},{"../../../errors":70}],83:[function(e,t,r){t.exports=e("events").EventEmitter},{events:57}],84:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":71,"./lib/_stream_passthrough.js":72,"./lib/_stream_readable.js":73,"./lib/_stream_transform.js":74,"./lib/_stream_writable.js":75,"./lib/internal/streams/end-of-stream.js":79,"./lib/internal/streams/pipeline.js":81}],85:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=i(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=h,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t,r,n=this.lastTotal-this.lastNeed,t=(t=this,128!=(192&(r=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<r.length?128!=(192&r[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<r.length&&128!=(192&r[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,n,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);var r=e.toString("utf16le",t);if(r){t=r.charCodeAt(r.length-1);if(55296<=t&&t<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){e=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,e)}return t}function h(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}(r.StringDecoder=s).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(0<=(o=a(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(0<=(o=a(t[n])))return 0<o&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":65}],86:[function(e,t,r){"use strict";var L=e("punycode"),k=e("./util");function S(){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}r.parse=o,r.resolve=function(e,t){return o(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?o(e,!1,!0).resolveObject(t):t},r.format=function(e){k.isString(e)&&(e=o(e));return e instanceof S?e.format():S.prototype.format.call(e)},r.Url=S;var R=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,A=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,r=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),x=["'"].concat(r),P=["%","/","?",";","#"].concat(x),O=["/","?","#"],I=/^[+a-z0-9A-Z_-]{0,63}$/,j=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&k.isObject(e)&&e instanceof S)return e;var n=new S;return n.parse(e,t,r),n}S.prototype.parse=function(e,t,r){if(!k.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),o=-1!==n&&n<e.indexOf("#")?"?":"#",n=e.split(o);n[0]=n[0].replace(/\\/g,"/");var i=(i=e=n.join(o)).trim();if(!r&&1===e.split("#").length){var s=A.exec(i);if(s)return this.path=i,this.href=i,this.pathname=s[1],s[2]?(this.search=s[2],this.query=t?H.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var a,s=R.exec(i);if(s&&(C=(s=s[0]).toLowerCase(),this.protocol=C,i=i.substr(s.length)),(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(a="//"===i.substr(0,2))||s&&N[s]||(i=i.substr(2),this.slashes=!0)),!N[s]&&(a||s&&!U[s])){for(var c=-1,u=0;u<O.length;u++)-1!==(l=i.indexOf(O[u]))&&(-1===c||l<c)&&(c=l);-1!==(S=-1===c?i.lastIndexOf("@"):i.lastIndexOf("@",c))&&(_=i.slice(0,S),i=i.slice(S+1),this.auth=decodeURIComponent(_));for(var l,c=-1,u=0;u<P.length;u++)-1!==(l=i.indexOf(P[u]))&&(-1===c||l<c)&&(c=l);-1===c&&(c=i.length),this.host=i.slice(0,c),i=i.slice(c),this.parseHost(),this.hostname=this.hostname||"";var h="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!h)for(var f=this.hostname.split(/\./),u=0,p=f.length;u<p;u++){var d=f[u];if(d&&!d.match(I)){for(var g="",y=0,b=d.length;y<b;y++)127<d.charCodeAt(y)?g+="x":g+=d[y];if(!g.match(I)){var m=f.slice(0,u),v=f.slice(u+1),w=d.match(j);w&&(m.push(w[1]),v.unshift(w[2])),v.length&&(i="/"+v.join(".")+i),this.hostname=m.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),h||(this.hostname=L.toASCII(this.hostname));var S=this.port?":"+this.port:"",_=this.hostname||"";this.host=_+S,this.href+=this.host,h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!M[C])for(u=0,p=x.length;u<p;u++){var E,T=x[u];-1!==i.indexOf(T)&&((E=encodeURIComponent(T))===T&&(E=escape(T)),i=i.split(T).join(E))}h=i.indexOf("#");-1!==h&&(this.hash=i.substr(h),i=i.slice(0,h));var C,h=i.indexOf("?");return-1!==h?(this.search=i.substr(h),this.query=i.substr(h+1),t&&(this.query=H.parse(this.query)),i=i.slice(0,h)):t&&(this.search="",this.query={}),i&&(this.pathname=i),U[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(S=this.pathname||"",C=this.search||"",this.path=S+C),this.href=this.format(),this},S.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&k.isObject(this.query)&&Object.keys(this.query).length&&(i=H.stringify(this.query));i=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||U[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o=o||"",n&&"#"!==n.charAt(0)&&(n="#"+n),i&&"?"!==i.charAt(0)&&(i="?"+i),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(i=i.replace("#","%23"))+n},S.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},S.prototype.resolveObject=function(e){k.isString(e)&&((p=new S).parse(e,!1,!0),e=p);for(var t=new S,r=Object.keys(this),n=0;n<r.length;n++){var o=r[n];t[o]=this[o]}if(t.hash=e.hash,""===e.href)return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),s=0;s<i.length;s++){var a=i[s];"protocol"!==a&&(t[a]=e[a])}return U[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!U[e.protocol]){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];t[l]=e[l]}return t.href=t.format(),t}if(t.protocol=e.protocol,e.host||N[e.protocol])t.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),t.pathname=h.join("/")}return t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,(t.pathname||t.search)&&(d=t.pathname||"",g=t.search||"",t.path=d+g),t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var f=t.pathname&&"/"===t.pathname.charAt(0),p=e.host||e.pathname&&"/"===e.pathname.charAt(0),d=p||f||t.host&&e.pathname,g=d,y=t.pathname&&t.pathname.split("/")||[],h=e.pathname&&e.pathname.split("/")||[],f=t.protocol&&!U[t.protocol];if(f&&(t.hostname="",t.port=null,t.host&&(""===y[0]?y[0]=t.host:y.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),d=d&&(""===h[0]||""===y[0])),p)t.host=(e.host||""===e.host?e:t).host,t.hostname=(e.hostname||""===e.hostname?e:t).hostname,t.search=e.search,t.query=e.query,y=h;else if(h.length)(y=y||[]).pop(),y=y.concat(h),t.search=e.search,t.query=e.query;else if(!k.isNullOrUndefined(e.search))return f&&(t.hostname=t.host=y.shift(),(w=!!(t.host&&0<t.host.indexOf("@"))&&t.host.split("@"))&&(t.auth=w.shift(),t.host=t.hostname=w.shift())),t.search=e.search,t.query=e.query,k.isNull(t.pathname)&&k.isNull(t.search)||(t.path=(t.pathname||"")+(t.search||"")),t.href=t.format(),t;if(!y.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var b=y.slice(-1)[0],p=(t.host||e.host||1<y.length)&&("."===b||".."===b)||""===b,m=0,v=y.length;0<=v;v--)"."===(b=y[v])?y.splice(v,1):".."===b?(y.splice(v,1),m++):m&&(y.splice(v,1),m--);if(!d&&!g)for(;m--;)y.unshift("..");!d||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),p&&"/"!==y.join("/").substr(-1)&&y.push("");var w,p=""===y[0]||y[0]&&"/"===y[0].charAt(0);return f&&(t.hostname=t.host=!p&&y.length?y.shift():"",(w=!!(t.host&&0<t.host.indexOf("@"))&&t.host.split("@"))&&(t.auth=w.shift(),t.host=t.hostname=w.shift())),(d=d||t.host&&y.length)&&!p&&y.unshift(""),y.length?t.pathname=y.join("/"):(t.pathname=null,t.path=null),k.isNull(t.pathname)&&k.isNull(t.search)||(t.path=(t.pathname||"")+(t.search||"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},S.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":87,punycode:54,querystring:64}],87:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],88:[function(e,r,t){!function(t){!function(){function n(e){try{if(!t.localStorage)return}catch(e){return}e=t.localStorage[e];return null!=e&&"true"===String(e).toLowerCase()}r.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],89:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r,n=arguments[t];for(r in n)o.call(n,r)&&(e[r]=n[r])}return e};var o=Object.prototype.hasOwnProperty},{}],90:[function(e,t,r){t.exports={LocalStorage:class{constructor(){this.hostName="",this.accessToken="",this.userToken=""}getAccessToken(){return this.accessToken}getUserToken(){return this.userToken}getHostName(){return this.hostName}setAccessToken(e){this.accessToken=e}setUserToken(e){this.userToken=e}setHostName(e){this.hostName=e}clearStorage(){this.setUserToken(""),this.setAccessToken(""),this.setHostName("")}}}},{}],91:[function(e,t,r){t.exports={SessionStorage:class{SessionStorageKeys={ACCESSTOKEN:"AccessToken",USERTOKEN:"UserToken",HOSTNAME:"HostName"};getAccessToken(){return sessionStorage.getItem(this.SessionStorageKeys.ACCESSTOKEN)}getUserToken(){return sessionStorage.getItem(this.SessionStorageKeys.USERTOKEN)}getHostName(){return sessionStorage.getItem(this.SessionStorageKeys.HOSTNAME)}setAccessToken(e){sessionStorage.setItem(this.SessionStorageKeys.ACCESSTOKEN,e)}setUserToken(e){sessionStorage.setItem(this.SessionStorageKeys.USERTOKEN,e)}setHostName(e){sessionStorage.setItem(this.SessionStorageKeys.HOSTNAME,e)}clearStorage(){var e=this.getUserToken(),t=this.getAccessToken(),r=this.getHostName();e&&this.setUserToken(""),t&&this.setAccessToken(""),r&&this.setHostName("")}}}},{}],92:[function(n,e,t){const h=n("fs"),o=n("@microsoft/signalr"),l=n("axios"),p=n("https"),d=n("./LocalStorage"),i=n("./SessionStorage"),g={hubConnection:o.HubConnection,CAs:[],CAFiles:[],Services:{CORE:"core",APPLIANCE:"appliance",NOTIFICATION:"notification",A2A:"a2a"},HttpMethods:{POST:"post",GET:"get",PUT:"put",DELETE:"delete"},A2ATypes:{PASSWORD:"password",PRIVATEKEY:"privatekey"},SshKeyFormats:{OPENSSH:"openssh",SSH2:"ssh2",PUTTY:"putty"},_saveUserToken:(e,t)=>{if(e)throw new Error("Failed to save user token.");try{var r=JSON.parse(t);if("Success"!==r.Status)throw new Error("Failed to save user token.");g.Storage.setUserToken(r.UserToken)}catch(e){throw new Error("Failed to save user token.")}},_execute:(e,t,r,n,o,i,s,a=null,c=!1)=>{o?("accept"in o||(o.accept="application/json"),"accept-language"in o||(o["accept-language"]="en-US,en;q=0.9"),"content-type"in o||(o["content-type"]="application/json")):o={accept:"application/json","accept-language":"en-US,en;q=0.9","content-type":"application/json"};let u=null;u=a?l({method:t,url:e,headers:o,data:r,responseType:n,httpsAgent:a}):l({method:t,url:e,headers:o,data:r,responseType:n,httpsAgent:new p.Agent({ca:g.CAs})}),u.then(function(e){let t=null;t=c?JSON.stringify(e.headers):JSON.stringify(e.data),i&&i(null,t,s)}).catch(function(e){let t=null;t=e.response&&e.response.data?JSON.stringify(e.response.data):e.message,i&&i(new Error(t),t,s)})},_executePromise:(e,t,r,i,s,a,c,u=null,l=!1)=>new Promise((n,o)=>{g._execute(e,t,r,i,s,(e,t,r)=>{a?a(e,t,r):e&&o(e),n(t)},c,u,l)}),_getProviderId:async(t,r,n)=>{if(null==n||""===n||"LOCAL"==n.toUpperCase()||"CERTIFICATE"==n.toUpperCase())return r;var o={accept:"application/json","content-type":"application/x-www-form-urlencoded"},r={RelayState:""};let i=null;try{i=await g._executePromise(`https://${t}/RSTS/UserLogin/LoginController?response_type=token&redirect_uri=urn:InstalledApplication&loginRequestStep=1`,g.HttpMethods.POST,r,"json",o),i=JSON.parse(i)}catch(e){try{i=await g._executePromise(`https://${t}/RSTS/UserLogin/LoginController?response_type=token&redirect_uri=urn:InstalledApplication&loginRequestStep=1`,g.HttpMethods.GET,r,"json",o),i=JSON.parse(i)}catch(e){throw new Error(`Could not find the provider: '${n}'. ${e}`)}}try{for(const e of i.Providers){if(n.toUpperCase()==e.DisplayName.toUpperCase())return e.Id;if(n.toUpperCase()==e.Id.toUpperCase())return e.Id;if(e.Id.toUpperCase().includes(n.toUpperCase()))return e.Id}}catch(e){throw new Error(`Could not find the provider: '${n}'. ${e}`)}throw new Error(`Could not find the provider: '${n}'`)},_loginUrl:(e,t)=>`https://${e}/RSTS/Login?response_type=token&redirect_uri=${encodeURIComponent(t)}`,_goToLogin:(e,t)=>{window.location=g._loginUrl(e,t)},_tradeForUserToken:(e,t)=>{t=`https://${t}/service/core/v3/Token/LoginResponse`;body={StsAccessToken:e},g._executePromise(t,g.HttpMethods.POST,body,"json",null,g._saveUserToken)},_connectInternal:(e,t,r)=>{if(null==e||""===e)throw new Error("hostName may not be null or empty");if(null==r)throw new Error("getAccessToken may not be null or undefined");var n=g.Storage.getHostName();n&&e!==n&&g.Storage.clearStorage(),g.Storage.setHostName(e);var o=g.Storage.getUserToken(),n=g.Storage.getAccessToken();if(o){o=new g.SafeguardConnection(e);return t&&t(o),o}if(n){g._tradeForUserToken(n,e);e=new g.SafeguardConnection(e);return t&&t(e),e}r()},addCA:e=>{g.CAs.push(e)},addCAFromFile:t=>{try{var e=h.readFileSync(t);g.addCA(e),g.CAFiles.push(t)}catch(e){throw new Error(`Failed to add certificate authority: '${t}'`)}},clearCAs:()=>{g.CAs=[],g.CAFiles=[]},connectRsts:async(e,t,r,n)=>(g.Storage=n||new i.SessionStorage,g._connectInternal(e,r,()=>g._goToLogin(e,t))),connectPassword:async(e,t,r,n,o,i)=>{if(null==e||""===e)throw new Error("hostName may not be null or empty");if(null==t||""===t)throw new Error("userName may not be null or empty");if(null==r||""===r)throw new Error("password may not be null or empty");n=await g._getProviderId(e,"local",n);g.Storage=i||new d.LocalStorage,g.Storage.clearStorage(),g.Storage.setHostName(e);try{var s={grant_type:"password",username:t,password:r,scope:`rsts:sts:primaryproviderid:${n}`},a=await g._executePromise(`https://${e}/RSTS/oauth2/token`,g.HttpMethods.POST,s,"json",null,null,null);g.Storage.setAccessToken(JSON.parse(a).access_token);var s={StsAccessToken:g.Storage.getAccessToken()},c=await g._executePromise(`https://${e}/service/core/v3/Token/LoginResponse`,g.HttpMethods.POST,s,"json",null,null,null);g.Storage.setUserToken(JSON.parse(c).UserToken);var u=new g.SafeguardConnection(e);return o&&o(u),u}catch(e){throw new Error(e.message)}},connectCertificate:async(e,t,r,n,o,i,s,a)=>{if(null==e||""===e)throw new Error("hostName may not be null or empty");if(!(null!=t&&""!==t||null!=r&&""!==r||null!=n&&""!==n))throw new Error("Either a cert and key or pfx are required.");if(null==o||""===o)throw new Error("passphrase may not be null or empty");i=await g._getProviderId(e,"certificate",i);g.Storage=a||new d.LocalStorage,g.Storage.clearStorage(),g.Storage.setHostName(e);try{var c={grant_type:"client_credentials",scope:`rsts:sts:primaryproviderid:${i}`},u=new p.Agent({cert:t,key:r,pfx:n,ca:g.CAs,passphrase:o}),l=await g._executePromise(`https://${e}/RSTS/oauth2/token`,g.HttpMethods.POST,c,"json",null,null,null,u);g.Storage.setAccessToken(JSON.parse(l).access_token);var c={StsAccessToken:g.Storage.getAccessToken()},h=await g._executePromise(`https://${e}/service/core/v3/Token/LoginResponse`,g.HttpMethods.POST,c,"json");g.Storage.setUserToken(JSON.parse(h).UserToken);var f=new g.SafeguardConnection(e);return s&&s(f),f}catch(e){throw new Error(e.message)}},connectCertificateFromFiles:async(e,t,r,n,o,i,s,a)=>{let c=null,u=null,l=null;return t&&(c=h.readFileSync(t)),r&&(u=h.readFileSync(r)),n&&(l=h.readFileSync(n)),await g.connectCertificate(e,c,u,l,o,i,s,a)},connectAnonymous:(e,t,r)=>{if(null==e||""===e)throw new Error("hostName may not be null or empty");g.Storage=r||new i.SessionStorage,g.Storage.clearStorage(),g.Storage.setHostName(e);e=new g.SafeguardConnection(e);return t&&t(e),e},a2aGetCredential:async(t,r,n,o,i,s,a,c)=>{if(null==t||""===t)throw new Error("hostName may not be null or empty");if(null==r||""===r)throw new Error("apiKey may not be null or empty");if(null==i||""===i||null==s||""===s||null==a||""===a)throw new Error("A cert and key must be specified.");o=o||g.SshKeyFormats.OPENSSH;try{var u=new p.Agent({cert:i,key:s,ca:g.CAs,passphrase:a}),l={authorization:`A2A ${r}`};let e=await g._executePromise(`https://${t}/service/a2a/v3/Credentials?type=${n}&keyFormat=${o}`,g.HttpMethods.GET,null,"json",l,null,null,u);return'"'===e.slice(0,1)&&(e=e.slice(1)),'"'===e.slice(-1)&&(e=e.slice(0,-1)),c&&c(e),e}catch(e){throw new Error(`Failed to retrieve credentials: ${e}`)}},a2aGetCredentialFromFiles:async(e,t,r,n,o,i,s,a)=>{let c=null,u=null;return o&&(c=h.readFileSync(o)),i&&(u=h.readFileSync(i)),await g.a2aGetCredential(e,t,r,n,c,u,s,a)},Storage:new i.SessionStorage,SafeguardConnection:class{constructor(e){if(null==e||""===e)throw new Error("hostName may not be null or empty");this.hostName=e}_constructUrl(t,r,e){var n,o=`https://${this.hostName}/service/`;try{e&&(r=`${r}?${n=e,Object.entries(n).map(e=>e.map(encodeURIComponent).join("=")).join("&")}`)}catch(e){throw new Error(`Could not process parameters for call to the ${t} service at endpoint ${r}.`)}switch(t){case g.Services.CORE:return`${o}core/${r}`;case g.Services.APPLIANCE:return`${o}appliance/${r}`;case g.Services.NOTIFICATION:return`${o}notification/${r}`;case g.Services.A2A:return`${o}a2a/${r}`;default:throw new Error(`Unsupported service requested: '${t}'.`)}}_getBearerToken(){var e=g.Storage.getUserToken();if(null==e||""===e)throw new Error("Access token is missing. Please log in again.");return`Bearer ${e}`}async getAccessTokenLifetimeRemaining(e){var t=this._getBearerToken(),r=this._constructUrl(g.Services.CORE,"v3/LoginMessage",null),t={authorization:t,"X-TokenLifetimeRemaining":""},t=await g._executePromise(r,g.HttpMethods.GET,null,"json",t,null,null,null,!0),t=JSON.parse(t);return e&&e(t["x-tokenlifetimeremaining"]),t["x-tokenlifetimeremaining"]}async logout(e){var t=this._getBearerToken(),r=this._constructUrl(g.Services.CORE,"v3/Token/Logout",null),t={authorization:t};return g.Storage.clearStorage(),await g._executePromise(r,g.HttpMethods.POST,null,"json",t,e,null)}async invoke(e,t,r,n,o,i,s,a){if(null==e||""===e)throw new Error("service may not be null or empty");if(null==t||""===t)throw new Error("httpMethod may not be null or empty");if(null==r||""===r)throw new Error("relativeUrl may not be null or empty");var c;g.Storage.getUserToken()&&(c=this._getBearerToken(),i?i.authorization=c:i={authorization:c});o=this._constructUrl(e,r,o);try{return await g._executePromise(o,t,n,"json",i,s,a)}catch(e){throw new Error(e.message)}}async registerSignalR(t){var e=g.Storage.getUserToken();if(null==e||""===e||null==this.hostName||""===this.hostName)throw new Error("You must log in before you can register for SignalR events.");if(!t)throw new Error("A callback must be specified to register for SignalR events.");if(0!=g.CAFiles.length){let e=n("ssl-root-cas").create();for(const r of g.CAFiles)e.addFile(r);n("https").globalAgent.options.ca.concat(e)}e={accessTokenFactory:()=>g.Storage.getUserToken()};g.hubConnection=(new o.HubConnectionBuilder).withUrl(`https://${this.hostName}/service/event/signalr`,e).build(),g.hubConnection.on("NotifyEventAsync",function(e){t&&t(e)}),g.hubConnection.start().then(()=>console.log("SignalR Started!")).catch(e=>console.log(e))}}};e.exports=g},{"./LocalStorage":90,"./SessionStorage":91,"@microsoft/signalr":23,axios:24,fs:53,https:58,"ssl-root-cas":52}]},{},[92])(92)});