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igB,gBAAkB,SAAUvQ,GAGvD,OAFAhL,EAAIC,WAAW+K,EAAU,YACzB5P,KAAK4P,SAAWA,EACT5P,IACX,EACA2f,EAAqBzf,UAAUkgB,uBAAyB,SAAUC,GAC9D,GAAIrgB,KAAK6P,gBACL,MAAM,IAAIlP,MAAM,2CAWpB,OATK0f,EAGI3gB,MAAM4gB,QAAQD,GACnBrgB,KAAK6P,gBAAkB,IAAIsH,EAAuBkJ,GAGlDrgB,KAAK6P,gBAAkBwQ,EANvBrgB,KAAK6P,gBAAkB,IAAIsH,EAQxBnX,IACX,EAKA2f,EAAqBzf,UAAUqgB,MAAQ,WAGnC,IAAIL,EAAwBlgB,KAAKkgB,uBAAyB,CAAC,EAO3D,QALqCrT,IAAjCqT,EAAsBtZ,SAEtBsZ,EAAsBtZ,OAAS5G,KAAK4G,SAGnC5G,KAAK2B,IACN,MAAM,IAAIhB,MAAM,4FAEpB,IAAIgP,EAAa,IAAIsK,GAAeja,KAAK2B,IAAKue,GAC9C,OAAOxQ,EAAcvP,OAAOwP,EAAY3P,KAAK4G,QAAU1E,EAAWI,SAAUtC,KAAK4P,UAAY,IAAIgP,GAAmB5e,KAAK6P,gBAC7H,EACO8P,CACX,CA5EyC,E","sources":["webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/Errors.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/ILogger.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/HttpClient.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/Loggers.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/Utils.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/Subject.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/HubConnection.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/ITransport.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/AbortController.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/HttpConnection.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js","webpack://northern-tuna-portal/./node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js"],"sourcesContent":["// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\n/** Error thrown when an HTTP request fails. */\r\nvar HttpError = /** @class */ (function (_super) {\r\n __extends(HttpError, _super);\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n function HttpError(errorMessage, statusCode) {\r\n var _newTarget = this.constructor;\r\n var _this = this;\r\n var trueProto = _newTarget.prototype;\r\n _this = _super.call(this, errorMessage) || this;\r\n _this.statusCode = statusCode;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n _this.__proto__ = trueProto;\r\n return _this;\r\n }\r\n return HttpError;\r\n}(Error));\r\nexport { HttpError };\r\n/** Error thrown when a timeout elapses. */\r\nvar TimeoutError = /** @class */ (function (_super) {\r\n __extends(TimeoutError, _super);\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n function TimeoutError(errorMessage) {\r\n var _newTarget = this.constructor;\r\n if (errorMessage === void 0) { errorMessage = \"A timeout occurred.\"; }\r\n var _this = this;\r\n var trueProto = _newTarget.prototype;\r\n _this = _super.call(this, errorMessage) || this;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n _this.__proto__ = trueProto;\r\n return _this;\r\n }\r\n return TimeoutError;\r\n}(Error));\r\nexport { TimeoutError };\r\n/** Error thrown when an action is aborted. */\r\nvar AbortError = /** @class */ (function (_super) {\r\n __extends(AbortError, _super);\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n function AbortError(errorMessage) {\r\n var _newTarget = this.constructor;\r\n if (errorMessage === void 0) { errorMessage = \"An abort occurred.\"; }\r\n var _this = this;\r\n var trueProto = _newTarget.prototype;\r\n _this = _super.call(this, errorMessage) || this;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n _this.__proto__ = trueProto;\r\n return _this;\r\n }\r\n return AbortError;\r\n}(Error));\r\nexport { AbortError };\r\n//# sourceMappingURL=Errors.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n /** Log level for very low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\r\n /** Log level for low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\r\n /** Log level for informational diagnostic messages. */\r\n LogLevel[LogLevel[\"Information\"] = 2] = \"Information\";\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n LogLevel[LogLevel[\"Warning\"] = 3] = \"Warning\";\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n LogLevel[LogLevel[\"Critical\"] = 5] = \"Critical\";\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n LogLevel[LogLevel[\"None\"] = 6] = \"None\";\r\n})(LogLevel || (LogLevel = {}));\r\n//# sourceMappingURL=ILogger.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\n/** Represents an HTTP response. */\r\nvar HttpResponse = /** @class */ (function () {\r\n function HttpResponse(statusCode, statusText, content) {\r\n this.statusCode = statusCode;\r\n this.statusText = statusText;\r\n this.content = content;\r\n }\r\n return HttpResponse;\r\n}());\r\nexport { HttpResponse };\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nvar HttpClient = /** @class */ (function () {\r\n function HttpClient() {\r\n }\r\n HttpClient.prototype.get = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"GET\", url: url }));\r\n };\r\n HttpClient.prototype.post = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"POST\", url: url }));\r\n };\r\n HttpClient.prototype.delete = function (url, options) {\r\n return this.send(__assign({}, options, { method: \"DELETE\", url: url }));\r\n };\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n HttpClient.prototype.getCookieString = function (url) {\r\n return \"\";\r\n };\r\n return HttpClient;\r\n}());\r\nexport { HttpClient };\r\n//# sourceMappingURL=HttpClient.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n/** A logger that does nothing when log messages are sent to it. */\r\nvar NullLogger = /** @class */ (function () {\r\n function NullLogger() {\r\n }\r\n /** @inheritDoc */\r\n // tslint:disable-next-line\r\n NullLogger.prototype.log = function (_logLevel, _message) {\r\n };\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n NullLogger.instance = new NullLogger();\r\n return NullLogger;\r\n}());\r\nexport { NullLogger };\r\n//# sourceMappingURL=Loggers.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\nexport var VERSION = \"5.0.5\";\r\n/** @private */\r\nvar Arg = /** @class */ (function () {\r\n function Arg() {\r\n }\r\n Arg.isRequired = function (val, name) {\r\n if (val === null || val === undefined) {\r\n throw new Error(\"The '\" + name + \"' argument is required.\");\r\n }\r\n };\r\n Arg.isNotEmpty = function (val, name) {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(\"The '\" + name + \"' argument should not be empty.\");\r\n }\r\n };\r\n Arg.isIn = function (val, values, name) {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(\"Unknown \" + name + \" value: \" + val + \".\");\r\n }\r\n };\r\n return Arg;\r\n}());\r\nexport { Arg };\r\n/** @private */\r\nvar Platform = /** @class */ (function () {\r\n function Platform() {\r\n }\r\n Object.defineProperty(Platform, \"isBrowser\", {\r\n get: function () {\r\n return typeof window === \"object\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Platform, \"isWebWorker\", {\r\n get: function () {\r\n return typeof self === \"object\" && \"importScripts\" in self;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Platform, \"isNode\", {\r\n get: function () {\r\n return !this.isBrowser && !this.isWebWorker;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Platform;\r\n}());\r\nexport { Platform };\r\n/** @private */\r\nexport function getDataDetail(data, includeContent) {\r\n var detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = \"Binary data of length \" + data.byteLength;\r\n if (includeContent) {\r\n detail += \". Content: '\" + formatArrayBuffer(data) + \"'\";\r\n }\r\n }\r\n else if (typeof data === \"string\") {\r\n detail = \"String data of length \" + data.length;\r\n if (includeContent) {\r\n detail += \". Content: '\" + data + \"'\";\r\n }\r\n }\r\n return detail;\r\n}\r\n/** @private */\r\nexport function formatArrayBuffer(data) {\r\n var view = new Uint8Array(data);\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n var str = \"\";\r\n view.forEach(function (num) {\r\n var pad = num < 16 ? \"0\" : \"\";\r\n str += \"0x\" + pad + num.toString(16) + \" \";\r\n });\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val) {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n/** @private */\r\nexport function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, logMessageContent, withCredentials, defaultHeaders) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, headers, token, _b, name, value, responseType, response;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n headers = {};\r\n if (!accessTokenFactory) return [3 /*break*/, 2];\r\n return [4 /*yield*/, accessTokenFactory()];\r\n case 1:\r\n token = _c.sent();\r\n if (token) {\r\n headers = (_a = {},\r\n _a[\"Authorization\"] = \"Bearer \" + token,\r\n _a);\r\n }\r\n _c.label = 2;\r\n case 2:\r\n _b = getUserAgentHeader(), name = _b[0], value = _b[1];\r\n headers[name] = value;\r\n logger.log(LogLevel.Trace, \"(\" + transportName + \" transport) sending data. \" + getDataDetail(content, logMessageContent) + \".\");\r\n responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n return [4 /*yield*/, httpClient.post(url, {\r\n content: content,\r\n headers: __assign({}, headers, defaultHeaders),\r\n responseType: responseType,\r\n withCredentials: withCredentials,\r\n })];\r\n case 3:\r\n response = _c.sent();\r\n logger.log(LogLevel.Trace, \"(\" + transportName + \" transport) request complete. Response status: \" + response.statusCode + \".\");\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/** @private */\r\nexport function createLogger(logger) {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n if (logger.log) {\r\n return logger;\r\n }\r\n return new ConsoleLogger(logger);\r\n}\r\n/** @private */\r\nvar SubjectSubscription = /** @class */ (function () {\r\n function SubjectSubscription(subject, observer) {\r\n this.subject = subject;\r\n this.observer = observer;\r\n }\r\n SubjectSubscription.prototype.dispose = function () {\r\n var index = this.subject.observers.indexOf(this.observer);\r\n if (index > -1) {\r\n this.subject.observers.splice(index, 1);\r\n }\r\n if (this.subject.observers.length === 0 && this.subject.cancelCallback) {\r\n this.subject.cancelCallback().catch(function (_) { });\r\n }\r\n };\r\n return SubjectSubscription;\r\n}());\r\nexport { SubjectSubscription };\r\n/** @private */\r\nvar ConsoleLogger = /** @class */ (function () {\r\n function ConsoleLogger(minimumLogLevel) {\r\n this.minimumLogLevel = minimumLogLevel;\r\n this.outputConsole = console;\r\n }\r\n ConsoleLogger.prototype.log = function (logLevel, message) {\r\n if (logLevel >= this.minimumLogLevel) {\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.outputConsole.error(\"[\" + new Date().toISOString() + \"] \" + LogLevel[logLevel] + \": \" + message);\r\n break;\r\n case LogLevel.Warning:\r\n this.outputConsole.warn(\"[\" + new Date().toISOString() + \"] \" + LogLevel[logLevel] + \": \" + message);\r\n break;\r\n case LogLevel.Information:\r\n this.outputConsole.info(\"[\" + new Date().toISOString() + \"] \" + LogLevel[logLevel] + \": \" + message);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.outputConsole.log(\"[\" + new Date().toISOString() + \"] \" + LogLevel[logLevel] + \": \" + message);\r\n break;\r\n }\r\n }\r\n };\r\n return ConsoleLogger;\r\n}());\r\nexport { ConsoleLogger };\r\n/** @private */\r\nexport function getUserAgentHeader() {\r\n var userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion())];\r\n}\r\n/** @private */\r\nexport function constructUserAgent(version, os, runtime, runtimeVersion) {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n var userAgent = \"Microsoft SignalR/\";\r\n var majorAndMinor = version.split(\".\");\r\n userAgent += majorAndMinor[0] + \".\" + majorAndMinor[1];\r\n userAgent += \" (\" + version + \"; \";\r\n if (os && os !== \"\") {\r\n userAgent += os + \"; \";\r\n }\r\n else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n userAgent += \"\" + runtime;\r\n if (runtimeVersion) {\r\n userAgent += \"; \" + runtimeVersion;\r\n }\r\n else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\nfunction getOsName() {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n }\r\n else {\r\n return \"\";\r\n }\r\n}\r\nfunction getRuntimeVersion() {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\nfunction getRuntime() {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n }\r\n else {\r\n return \"Browser\";\r\n }\r\n}\r\n//# sourceMappingURL=Utils.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Platform } from \"./Utils\";\r\nvar FetchHttpClient = /** @class */ (function (_super) {\r\n __extends(FetchHttpClient, _super);\r\n function FetchHttpClient(logger) {\r\n var _this = _super.call(this) || this;\r\n _this.logger = logger;\r\n if (typeof fetch === \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n var requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r\n _this.jar = new (requireFunc(\"tough-cookie\")).CookieJar();\r\n _this.fetchType = requireFunc(\"node-fetch\");\r\n // node-fetch doesn't have a nice API for getting and setting cookies\r\n // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r\n _this.fetchType = requireFunc(\"fetch-cookie\")(_this.fetchType, _this.jar);\r\n // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r\n _this.abortControllerType = requireFunc(\"abort-controller\");\r\n }\r\n else {\r\n _this.fetchType = fetch.bind(self);\r\n _this.abortControllerType = AbortController;\r\n }\r\n return _this;\r\n }\r\n /** @inheritDoc */\r\n FetchHttpClient.prototype.send = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var abortController, error, timeoutId, msTimeout, response, e_1, content, payload;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n abortController = new this.abortControllerType();\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = function () {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n timeoutId = null;\r\n if (request.timeout) {\r\n msTimeout = request.timeout;\r\n timeoutId = setTimeout(function () {\r\n abortController.abort();\r\n _this.logger.log(LogLevel.Warning, \"Timeout from HTTP request.\");\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, 4, 5]);\r\n return [4 /*yield*/, this.fetchType(request.url, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: __assign({ \"Content-Type\": \"text/plain;charset=UTF-8\", \"X-Requested-With\": \"XMLHttpRequest\" }, request.headers),\r\n method: request.method,\r\n mode: \"cors\",\r\n redirect: \"manual\",\r\n signal: abortController.signal,\r\n })];\r\n case 2:\r\n response = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 3:\r\n e_1 = _a.sent();\r\n if (error) {\r\n throw error;\r\n }\r\n this.logger.log(LogLevel.Warning, \"Error from HTTP request. \" + e_1 + \".\");\r\n throw e_1;\r\n case 4:\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n return [7 /*endfinally*/];\r\n case 5:\r\n if (!response.ok) {\r\n throw new HttpError(response.statusText, response.status);\r\n }\r\n content = deserializeContent(response, request.responseType);\r\n return [4 /*yield*/, content];\r\n case 6:\r\n payload = _a.sent();\r\n return [2 /*return*/, new HttpResponse(response.status, response.statusText, payload)];\r\n }\r\n });\r\n });\r\n };\r\n FetchHttpClient.prototype.getCookieString = function (url) {\r\n var cookies = \"\";\r\n if (Platform.isNode && this.jar) {\r\n // @ts-ignore: unused variable\r\n this.jar.getCookies(url, function (e, c) { return cookies = c.join(\"; \"); });\r\n }\r\n return cookies;\r\n };\r\n return FetchHttpClient;\r\n}(HttpClient));\r\nexport { FetchHttpClient };\r\nfunction deserializeContent(response, responseType) {\r\n var content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(responseType + \" is not supported.\");\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n return content;\r\n}\r\n//# sourceMappingURL=FetchHttpClient.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nvar XhrHttpClient = /** @class */ (function (_super) {\r\n __extends(XhrHttpClient, _super);\r\n function XhrHttpClient(logger) {\r\n var _this = _super.call(this) || this;\r\n _this.logger = logger;\r\n return _this;\r\n }\r\n /** @inheritDoc */\r\n XhrHttpClient.prototype.send = function (request) {\r\n var _this = this;\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(request.method, request.url, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n var headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach(function (header) {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = function () {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n xhr.onload = function () {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n }\r\n else {\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n }\r\n };\r\n xhr.onerror = function () {\r\n _this.logger.log(LogLevel.Warning, \"Error from HTTP request. \" + xhr.status + \": \" + xhr.statusText + \".\");\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n xhr.ontimeout = function () {\r\n _this.logger.log(LogLevel.Warning, \"Timeout from HTTP request.\");\r\n reject(new TimeoutError());\r\n };\r\n xhr.send(request.content || \"\");\r\n });\r\n };\r\n return XhrHttpClient;\r\n}(HttpClient));\r\nexport { XhrHttpClient };\r\n//# sourceMappingURL=XhrHttpClient.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n/** Defines the type of a Hub Message. */\r\nexport var MessageType;\r\n(function (MessageType) {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n MessageType[MessageType[\"Invocation\"] = 1] = \"Invocation\";\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n MessageType[MessageType[\"StreamItem\"] = 2] = \"StreamItem\";\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n MessageType[MessageType[\"Completion\"] = 3] = \"Completion\";\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n MessageType[MessageType[\"StreamInvocation\"] = 4] = \"StreamInvocation\";\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n MessageType[MessageType[\"CancelInvocation\"] = 5] = \"CancelInvocation\";\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n MessageType[MessageType[\"Ping\"] = 6] = \"Ping\";\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n MessageType[MessageType[\"Close\"] = 7] = \"Close\";\r\n})(MessageType || (MessageType = {}));\r\n//# sourceMappingURL=IHubProtocol.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nvar DefaultHttpClient = /** @class */ (function (_super) {\r\n __extends(DefaultHttpClient, _super);\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n function DefaultHttpClient(logger) {\r\n var _this = _super.call(this) || this;\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n _this.httpClient = new FetchHttpClient(logger);\r\n }\r\n else if (typeof XMLHttpRequest !== \"undefined\") {\r\n _this.httpClient = new XhrHttpClient(logger);\r\n }\r\n else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n return _this;\r\n }\r\n /** @inheritDoc */\r\n DefaultHttpClient.prototype.send = function (request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return this.httpClient.send(request);\r\n };\r\n DefaultHttpClient.prototype.getCookieString = function (url) {\r\n return this.httpClient.getCookieString(url);\r\n };\r\n return DefaultHttpClient;\r\n}(HttpClient));\r\nexport { DefaultHttpClient };\r\n//# sourceMappingURL=DefaultHttpClient.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// Not exported from index\r\n/** @private */\r\nvar TextMessageFormat = /** @class */ (function () {\r\n function TextMessageFormat() {\r\n }\r\n TextMessageFormat.write = function (output) {\r\n return \"\" + output + TextMessageFormat.RecordSeparator;\r\n };\r\n TextMessageFormat.parse = function (input) {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n var messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n };\r\n TextMessageFormat.RecordSeparatorCode = 0x1e;\r\n TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n return TextMessageFormat;\r\n}());\r\nexport { TextMessageFormat };\r\n//# sourceMappingURL=TextMessageFormat.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n/** @private */\r\nvar HandshakeProtocol = /** @class */ (function () {\r\n function HandshakeProtocol() {\r\n }\r\n // Handshake request is always JSON\r\n HandshakeProtocol.prototype.writeHandshakeRequest = function (handshakeRequest) {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n };\r\n HandshakeProtocol.prototype.parseHandshakeResponse = function (data) {\r\n var responseMessage;\r\n var messageData;\r\n var remainingData;\r\n if (isArrayBuffer(data) || (typeof Buffer !== \"undefined\" && data instanceof Buffer)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n var binaryData = new Uint8Array(data);\r\n var separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n var responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n }\r\n else {\r\n var textData = data;\r\n var separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n var responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n // At this point we should have just the single handshake message\r\n var messages = TextMessageFormat.parse(messageData);\r\n var response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n responseMessage = response;\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n };\r\n return HandshakeProtocol;\r\n}());\r\nexport { HandshakeProtocol };\r\n//# sourceMappingURL=HandshakeProtocol.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { SubjectSubscription } from \"./Utils\";\r\n/** Stream implementation to stream items to the server. */\r\nvar Subject = /** @class */ (function () {\r\n function Subject() {\r\n this.observers = [];\r\n }\r\n Subject.prototype.next = function (item) {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n observer.next(item);\r\n }\r\n };\r\n Subject.prototype.error = function (err) {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n };\r\n Subject.prototype.complete = function () {\r\n for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {\r\n var observer = _a[_i];\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n };\r\n Subject.prototype.subscribe = function (observer) {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n };\r\n return Subject;\r\n}());\r\nexport { Subject };\r\n//# sourceMappingURL=Subject.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { HandshakeProtocol } from \"./HandshakeProtocol\";\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg } from \"./Utils\";\r\nvar DEFAULT_TIMEOUT_IN_MS = 30 * 1000;\r\nvar DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000;\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport var HubConnectionState;\r\n(function (HubConnectionState) {\r\n /** The hub connection is disconnected. */\r\n HubConnectionState[\"Disconnected\"] = \"Disconnected\";\r\n /** The hub connection is connecting. */\r\n HubConnectionState[\"Connecting\"] = \"Connecting\";\r\n /** The hub connection is connected. */\r\n HubConnectionState[\"Connected\"] = \"Connected\";\r\n /** The hub connection is disconnecting. */\r\n HubConnectionState[\"Disconnecting\"] = \"Disconnecting\";\r\n /** The hub connection is reconnecting. */\r\n HubConnectionState[\"Reconnecting\"] = \"Reconnecting\";\r\n})(HubConnectionState || (HubConnectionState = {}));\r\n/** Represents a connection to a SignalR Hub. */\r\nvar HubConnection = /** @class */ (function () {\r\n function HubConnection(connection, logger, protocol, reconnectPolicy) {\r\n var _this = this;\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS;\r\n this.logger = logger;\r\n this.protocol = protocol;\r\n this.connection = connection;\r\n this.reconnectPolicy = reconnectPolicy;\r\n this.handshakeProtocol = new HandshakeProtocol();\r\n this.connection.onreceive = function (data) { return _this.processIncomingData(data); };\r\n this.connection.onclose = function (error) { return _this.connectionClosed(error); };\r\n this.callbacks = {};\r\n this.methods = {};\r\n this.closedCallbacks = [];\r\n this.reconnectingCallbacks = [];\r\n this.reconnectedCallbacks = [];\r\n this.invocationId = 0;\r\n this.receivedHandshakeResponse = false;\r\n this.connectionState = HubConnectionState.Disconnected;\r\n this.connectionStarted = false;\r\n this.cachedPingMessage = this.protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n HubConnection.create = function (connection, logger, protocol, reconnectPolicy) {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy);\r\n };\r\n Object.defineProperty(HubConnection.prototype, \"state\", {\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get: function () {\r\n return this.connectionState;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HubConnection.prototype, \"connectionId\", {\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get: function () {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HubConnection.prototype, \"baseUrl\", {\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get: function () {\r\n return this.connection.baseUrl || \"\";\r\n },\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set: function (url) {\r\n if (this.connectionState !== HubConnectionState.Disconnected && this.connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n this.connection.baseUrl = url;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n HubConnection.prototype.start = function () {\r\n this.startPromise = this.startWithStateTransitions();\r\n return this.startPromise;\r\n };\r\n HubConnection.prototype.startWithStateTransitions = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (this.connectionState !== HubConnectionState.Disconnected) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"))];\r\n }\r\n this.connectionState = HubConnectionState.Connecting;\r\n this.logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.startInternal()];\r\n case 2:\r\n _a.sent();\r\n this.connectionState = HubConnectionState.Connected;\r\n this.connectionStarted = true;\r\n this.logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n this.connectionState = HubConnectionState.Disconnected;\r\n this.logger.log(LogLevel.Debug, \"HubConnection failed to start successfully because of error '\" + e_1 + \"'.\");\r\n return [2 /*return*/, Promise.reject(e_1)];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HubConnection.prototype.startInternal = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var handshakePromise, handshakeRequest, e_2;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.stopDuringStartError = undefined;\r\n this.receivedHandshakeResponse = false;\r\n handshakePromise = new Promise(function (resolve, reject) {\r\n _this.handshakeResolver = resolve;\r\n _this.handshakeRejecter = reject;\r\n });\r\n return [4 /*yield*/, this.connection.start(this.protocol.transferFormat)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 7]);\r\n handshakeRequest = {\r\n protocol: this.protocol.name,\r\n version: this.protocol.version,\r\n };\r\n this.logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n return [4 /*yield*/, this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))];\r\n case 3:\r\n _a.sent();\r\n this.logger.log(LogLevel.Information, \"Using HubProtocol '\" + this.protocol.name + \"'.\");\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this.cleanupTimeout();\r\n this.resetTimeoutPeriod();\r\n this.resetKeepAliveInterval();\r\n return [4 /*yield*/, handshakePromise];\r\n case 4:\r\n _a.sent();\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this.stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n throw this.stopDuringStartError;\r\n }\r\n return [3 /*break*/, 7];\r\n case 5:\r\n e_2 = _a.sent();\r\n this.logger.log(LogLevel.Debug, \"Hub handshake failed with error '\" + e_2 + \"' during start(). Stopping HubConnection.\");\r\n this.cleanupTimeout();\r\n this.cleanupPingTimer();\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n return [4 /*yield*/, this.connection.stop(e_2)];\r\n case 6:\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n _a.sent();\r\n throw e_2;\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n HubConnection.prototype.stop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var startPromise, e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n startPromise = this.startPromise;\r\n this.stopPromise = this.stopInternal();\r\n return [4 /*yield*/, this.stopPromise];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n // Awaiting undefined continues immediately\r\n return [4 /*yield*/, startPromise];\r\n case 3:\r\n // Awaiting undefined continues immediately\r\n _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_3 = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HubConnection.prototype.stopInternal = function (error) {\r\n if (this.connectionState === HubConnectionState.Disconnected) {\r\n this.logger.log(LogLevel.Debug, \"Call to HubConnection.stop(\" + error + \") ignored because it is already in the disconnected state.\");\r\n return Promise.resolve();\r\n }\r\n if (this.connectionState === HubConnectionState.Disconnecting) {\r\n this.logger.log(LogLevel.Debug, \"Call to HttpConnection.stop(\" + error + \") ignored because the connection is already in the disconnecting state.\");\r\n return this.stopPromise;\r\n }\r\n this.connectionState = HubConnectionState.Disconnecting;\r\n this.logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n if (this.reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this.logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n clearTimeout(this.reconnectDelayHandle);\r\n this.reconnectDelayHandle = undefined;\r\n this.completeClose();\r\n return Promise.resolve();\r\n }\r\n this.cleanupTimeout();\r\n this.cleanupPingTimer();\r\n this.stopDuringStartError = error || new Error(\"The connection was stopped before the hub handshake could complete.\");\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n };\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult} An object that yields results from the server as they are received.\r\n */\r\n HubConnection.prototype.stream = function (methodName) {\r\n var _this = this;\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1];\r\n var invocationDescriptor = this.createStreamInvocation(methodName, args, streamIds);\r\n var promiseQueue;\r\n var subject = new Subject();\r\n subject.cancelCallback = function () {\r\n var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId);\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n return promiseQueue.then(function () {\r\n return _this.sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n }\r\n else {\r\n subject.complete();\r\n }\r\n }\r\n else {\r\n subject.next((invocationEvent.item));\r\n }\r\n }\r\n };\r\n promiseQueue = this.sendWithProtocol(invocationDescriptor)\r\n .catch(function (e) {\r\n subject.error(e);\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n });\r\n this.launchStreams(streams, promiseQueue);\r\n return subject;\r\n };\r\n HubConnection.prototype.sendMessage = function (message) {\r\n this.resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n };\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n HubConnection.prototype.sendWithProtocol = function (message) {\r\n return this.sendMessage(this.protocol.writeMessage(message));\r\n };\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n HubConnection.prototype.send = function (methodName) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1];\r\n var sendPromise = this.sendWithProtocol(this.createInvocation(methodName, args, true, streamIds));\r\n this.launchStreams(streams, sendPromise);\r\n return sendPromise;\r\n };\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n HubConnection.prototype.invoke = function (methodName) {\r\n var _this = this;\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1];\r\n var invocationDescriptor = this.createInvocation(methodName, args, false, streamIds);\r\n var p = new Promise(function (resolve, reject) {\r\n // invocationId will always have a value for a non-blocking invocation\r\n _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) {\r\n if (error) {\r\n reject(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n }\r\n else {\r\n resolve(invocationEvent.result);\r\n }\r\n }\r\n else {\r\n reject(new Error(\"Unexpected message type: \" + invocationEvent.type));\r\n }\r\n }\r\n };\r\n var promiseQueue = _this.sendWithProtocol(invocationDescriptor)\r\n .catch(function (e) {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete _this.callbacks[invocationDescriptor.invocationId];\r\n });\r\n _this.launchStreams(streams, promiseQueue);\r\n });\r\n return p;\r\n };\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n HubConnection.prototype.on = function (methodName, newMethod) {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n if (!this.methods[methodName]) {\r\n this.methods[methodName] = [];\r\n }\r\n // Preventing adding the same handler multiple times.\r\n if (this.methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n this.methods[methodName].push(newMethod);\r\n };\r\n HubConnection.prototype.off = function (methodName, method) {\r\n if (!methodName) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n var handlers = this.methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n var removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this.methods[methodName];\r\n }\r\n }\r\n }\r\n else {\r\n delete this.methods[methodName];\r\n }\r\n };\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n HubConnection.prototype.onclose = function (callback) {\r\n if (callback) {\r\n this.closedCallbacks.push(callback);\r\n }\r\n };\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n HubConnection.prototype.onreconnecting = function (callback) {\r\n if (callback) {\r\n this.reconnectingCallbacks.push(callback);\r\n }\r\n };\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n HubConnection.prototype.onreconnected = function (callback) {\r\n if (callback) {\r\n this.reconnectedCallbacks.push(callback);\r\n }\r\n };\r\n HubConnection.prototype.processIncomingData = function (data) {\r\n this.cleanupTimeout();\r\n if (!this.receivedHandshakeResponse) {\r\n data = this.processHandshakeResponse(data);\r\n this.receivedHandshakeResponse = true;\r\n }\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n var messages = this.protocol.parseMessages(data, this.logger);\r\n for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) {\r\n var message = messages_1[_i];\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n this.invokeClientMethod(message);\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n var callback = this.callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this.callbacks[message.invocationId];\r\n }\r\n callback(message);\r\n }\r\n break;\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close:\r\n this.logger.log(LogLevel.Information, \"Close message received from server.\");\r\n var error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(error);\r\n }\r\n else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this.stopPromise = this.stopInternal(error);\r\n }\r\n break;\r\n default:\r\n this.logger.log(LogLevel.Warning, \"Invalid message type: \" + message.type + \".\");\r\n break;\r\n }\r\n }\r\n }\r\n this.resetTimeoutPeriod();\r\n };\r\n HubConnection.prototype.processHandshakeResponse = function (data) {\r\n var _a;\r\n var responseMessage;\r\n var remainingData;\r\n try {\r\n _a = this.handshakeProtocol.parseHandshakeResponse(data), remainingData = _a[0], responseMessage = _a[1];\r\n }\r\n catch (e) {\r\n var message = \"Error parsing handshake response: \" + e;\r\n this.logger.log(LogLevel.Error, message);\r\n var error = new Error(message);\r\n this.handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n var message = \"Server returned handshake error: \" + responseMessage.error;\r\n this.logger.log(LogLevel.Error, message);\r\n var error = new Error(message);\r\n this.handshakeRejecter(error);\r\n throw error;\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n this.handshakeResolver();\r\n return remainingData;\r\n };\r\n HubConnection.prototype.resetKeepAliveInterval = function () {\r\n var _this = this;\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n this.cleanupPingTimer();\r\n this.pingServerHandle = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (!(this.connectionState === HubConnectionState.Connected)) return [3 /*break*/, 4];\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.sendMessage(this.cachedPingMessage)];\r\n case 2:\r\n _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n _a = _b.sent();\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this.cleanupPingTimer();\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); }, this.keepAliveIntervalInMilliseconds);\r\n };\r\n HubConnection.prototype.resetTimeoutPeriod = function () {\r\n var _this = this;\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this.timeoutHandle = setTimeout(function () { return _this.serverTimeout(); }, this.serverTimeoutInMilliseconds);\r\n }\r\n };\r\n HubConnection.prototype.serverTimeout = function () {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // tslint:disable-next-line:no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n };\r\n HubConnection.prototype.invokeClientMethod = function (invocationMessage) {\r\n var _this = this;\r\n var methods = this.methods[invocationMessage.target.toLowerCase()];\r\n if (methods) {\r\n try {\r\n methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); });\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"A callback for the method \" + invocationMessage.target.toLowerCase() + \" threw error '\" + e + \"'.\");\r\n }\r\n if (invocationMessage.invocationId) {\r\n // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response.\r\n var message = \"Server requested a response, which is not supported in this version of the client.\";\r\n this.logger.log(LogLevel.Error, message);\r\n // We don't want to wait on the stop itself.\r\n this.stopPromise = this.stopInternal(new Error(message));\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Warning, \"No client method with the name '\" + invocationMessage.target + \"' found.\");\r\n }\r\n };\r\n HubConnection.prototype.connectionClosed = function (error) {\r\n this.logger.log(LogLevel.Debug, \"HubConnection.connectionClosed(\" + error + \") called while in state \" + this.connectionState + \".\");\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this.stopDuringStartError = this.stopDuringStartError || error || new Error(\"The underlying connection was closed before the hub handshake could complete.\");\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this.handshakeResolver) {\r\n this.handshakeResolver();\r\n }\r\n this.cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n this.cleanupTimeout();\r\n this.cleanupPingTimer();\r\n if (this.connectionState === HubConnectionState.Disconnecting) {\r\n this.completeClose(error);\r\n }\r\n else if (this.connectionState === HubConnectionState.Connected && this.reconnectPolicy) {\r\n // tslint:disable-next-line:no-floating-promises\r\n this.reconnect(error);\r\n }\r\n else if (this.connectionState === HubConnectionState.Connected) {\r\n this.completeClose(error);\r\n }\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n };\r\n HubConnection.prototype.completeClose = function (error) {\r\n var _this = this;\r\n if (this.connectionStarted) {\r\n this.connectionState = HubConnectionState.Disconnected;\r\n this.connectionStarted = false;\r\n try {\r\n this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); });\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"An onclose callback called with error '\" + error + \"' threw error '\" + e + \"'.\");\r\n }\r\n }\r\n };\r\n HubConnection.prototype.reconnect = function (error) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var reconnectStartTime, previousReconnectAttempts, retryError, nextRetryDelay, e_4;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n reconnectStartTime = Date.now();\r\n previousReconnectAttempts = 0;\r\n retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n if (nextRetryDelay === null) {\r\n this.logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this.completeClose(error);\r\n return [2 /*return*/];\r\n }\r\n this.connectionState = HubConnectionState.Reconnecting;\r\n if (error) {\r\n this.logger.log(LogLevel.Information, \"Connection reconnecting because of error '\" + error + \"'.\");\r\n }\r\n else {\r\n this.logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n if (this.onreconnecting) {\r\n try {\r\n this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]); });\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"An onreconnecting callback called with error '\" + error + \"' threw error '\" + e + \"'.\");\r\n }\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this.connectionState !== HubConnectionState.Reconnecting) {\r\n this.logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return [2 /*return*/];\r\n }\r\n }\r\n _a.label = 1;\r\n case 1:\r\n if (!(nextRetryDelay !== null)) return [3 /*break*/, 7];\r\n this.logger.log(LogLevel.Information, \"Reconnect attempt number \" + previousReconnectAttempts + \" will start in \" + nextRetryDelay + \" ms.\");\r\n return [4 /*yield*/, new Promise(function (resolve) {\r\n _this.reconnectDelayHandle = setTimeout(resolve, nextRetryDelay);\r\n })];\r\n case 2:\r\n _a.sent();\r\n this.reconnectDelayHandle = undefined;\r\n if (this.connectionState !== HubConnectionState.Reconnecting) {\r\n this.logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return [2 /*return*/];\r\n }\r\n _a.label = 3;\r\n case 3:\r\n _a.trys.push([3, 5, , 6]);\r\n return [4 /*yield*/, this.startInternal()];\r\n case 4:\r\n _a.sent();\r\n this.connectionState = HubConnectionState.Connected;\r\n this.logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n if (this.onreconnected) {\r\n try {\r\n this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]); });\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"An onreconnected callback called with connectionId '\" + this.connection.connectionId + \"; threw error '\" + e + \"'.\");\r\n }\r\n }\r\n return [2 /*return*/];\r\n case 5:\r\n e_4 = _a.sent();\r\n this.logger.log(LogLevel.Information, \"Reconnect attempt failed because of error '\" + e_4 + \"'.\");\r\n if (this.connectionState !== HubConnectionState.Reconnecting) {\r\n this.logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect attempt. Done reconnecting.\");\r\n return [2 /*return*/];\r\n }\r\n retryError = e_4 instanceof Error ? e_4 : new Error(e_4.toString());\r\n nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n return [3 /*break*/, 6];\r\n case 6: return [3 /*break*/, 1];\r\n case 7:\r\n this.logger.log(LogLevel.Information, \"Reconnect retries have been exhausted after \" + (Date.now() - reconnectStartTime) + \" ms and \" + previousReconnectAttempts + \" failed attempts. Connection disconnecting.\");\r\n this.completeClose();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HubConnection.prototype.getNextRetryDelay = function (previousRetryCount, elapsedMilliseconds, retryReason) {\r\n try {\r\n return this.reconnectPolicy.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds: elapsedMilliseconds,\r\n previousRetryCount: previousRetryCount,\r\n retryReason: retryReason,\r\n });\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"IRetryPolicy.nextRetryDelayInMilliseconds(\" + previousRetryCount + \", \" + elapsedMilliseconds + \") threw error '\" + e + \"'.\");\r\n return null;\r\n }\r\n };\r\n HubConnection.prototype.cancelCallbacksWithError = function (error) {\r\n var callbacks = this.callbacks;\r\n this.callbacks = {};\r\n Object.keys(callbacks)\r\n .forEach(function (key) {\r\n var callback = callbacks[key];\r\n callback(null, error);\r\n });\r\n };\r\n HubConnection.prototype.cleanupPingTimer = function () {\r\n if (this.pingServerHandle) {\r\n clearTimeout(this.pingServerHandle);\r\n }\r\n };\r\n HubConnection.prototype.cleanupTimeout = function () {\r\n if (this.timeoutHandle) {\r\n clearTimeout(this.timeoutHandle);\r\n }\r\n };\r\n HubConnection.prototype.createInvocation = function (methodName, args, nonblocking, streamIds) {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds: streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n else {\r\n var invocationId = this.invocationId;\r\n this.invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds: streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n };\r\n HubConnection.prototype.launchStreams = function (streams, promiseQueue) {\r\n var _this = this;\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n var _loop_1 = function (streamId) {\r\n streams[streamId].subscribe({\r\n complete: function () {\r\n promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId)); });\r\n },\r\n error: function (err) {\r\n var message;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n }\r\n else if (err && err.toString) {\r\n message = err.toString();\r\n }\r\n else {\r\n message = \"Unknown error\";\r\n }\r\n promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId, message)); });\r\n },\r\n next: function (item) {\r\n promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createStreamItemMessage(streamId, item)); });\r\n },\r\n });\r\n };\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // tslint:disable-next-line:forin\r\n for (var streamId in streams) {\r\n _loop_1(streamId);\r\n }\r\n };\r\n HubConnection.prototype.replaceStreamingParams = function (args) {\r\n var streams = [];\r\n var streamIds = [];\r\n for (var i = 0; i < args.length; i++) {\r\n var argument = args[i];\r\n if (this.isObservable(argument)) {\r\n var streamId = this.invocationId;\r\n this.invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n return [streams, streamIds];\r\n };\r\n HubConnection.prototype.isObservable = function (arg) {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n };\r\n HubConnection.prototype.createStreamInvocation = function (methodName, args, streamIds) {\r\n var invocationId = this.invocationId;\r\n this.invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds: streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n };\r\n HubConnection.prototype.createCancelInvocation = function (id) {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n };\r\n HubConnection.prototype.createStreamItemMessage = function (id, item) {\r\n return {\r\n invocationId: id,\r\n item: item,\r\n type: MessageType.StreamItem,\r\n };\r\n };\r\n HubConnection.prototype.createCompletionMessage = function (id, error, result) {\r\n if (error) {\r\n return {\r\n error: error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n return {\r\n invocationId: id,\r\n result: result,\r\n type: MessageType.Completion,\r\n };\r\n };\r\n return HubConnection;\r\n}());\r\nexport { HubConnection };\r\n//# sourceMappingURL=HubConnection.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport var HttpTransportType;\r\n(function (HttpTransportType) {\r\n /** Specifies no transport preference. */\r\n HttpTransportType[HttpTransportType[\"None\"] = 0] = \"None\";\r\n /** Specifies the WebSockets transport. */\r\n HttpTransportType[HttpTransportType[\"WebSockets\"] = 1] = \"WebSockets\";\r\n /** Specifies the Server-Sent Events transport. */\r\n HttpTransportType[HttpTransportType[\"ServerSentEvents\"] = 2] = \"ServerSentEvents\";\r\n /** Specifies the Long Polling transport. */\r\n HttpTransportType[HttpTransportType[\"LongPolling\"] = 4] = \"LongPolling\";\r\n})(HttpTransportType || (HttpTransportType = {}));\r\n/** Specifies the transfer format for a connection. */\r\nexport var TransferFormat;\r\n(function (TransferFormat) {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Text\"] = 1] = \"Text\";\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Binary\"] = 2] = \"Binary\";\r\n})(TransferFormat || (TransferFormat = {}));\r\n//# sourceMappingURL=ITransport.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nvar DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n/** @private */\r\nvar DefaultReconnectPolicy = /** @class */ (function () {\r\n function DefaultReconnectPolicy(retryDelays) {\r\n this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (retryContext) {\r\n return this.retryDelays[retryContext.previousRetryCount];\r\n };\r\n return DefaultReconnectPolicy;\r\n}());\r\nexport { DefaultReconnectPolicy };\r\n//# sourceMappingURL=DefaultReconnectPolicy.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n// Not exported from index.\r\n/** @private */\r\nvar AbortController = /** @class */ (function () {\r\n function AbortController() {\r\n this.isAborted = false;\r\n this.onabort = null;\r\n }\r\n AbortController.prototype.abort = function () {\r\n if (!this.isAborted) {\r\n this.isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AbortController.prototype, \"signal\", {\r\n get: function () {\r\n return this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AbortController.prototype, \"aborted\", {\r\n get: function () {\r\n return this.isAborted;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AbortController;\r\n}());\r\nexport { AbortController };\r\n//# sourceMappingURL=AbortController.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nvar LongPollingTransport = /** @class */ (function () {\r\n function LongPollingTransport(httpClient, accessTokenFactory, logger, logMessageContent, withCredentials, headers) {\r\n this.httpClient = httpClient;\r\n this.accessTokenFactory = accessTokenFactory;\r\n this.logger = logger;\r\n this.pollAbort = new AbortController();\r\n this.logMessageContent = logMessageContent;\r\n this.withCredentials = withCredentials;\r\n this.headers = headers;\r\n this.running = false;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n Object.defineProperty(LongPollingTransport.prototype, \"pollAborted\", {\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n get: function () {\r\n return this.pollAbort.aborted;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LongPollingTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a, _b, name, value, headers, pollOptions, token, pollUrl, response;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.url = url;\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n _b = getUserAgentHeader(), name = _b[0], value = _b[1];\r\n headers = __assign((_a = {}, _a[name] = value, _a), this.headers);\r\n pollOptions = {\r\n abortSignal: this.pollAbort.signal,\r\n headers: headers,\r\n timeout: 100000,\r\n withCredentials: this.withCredentials,\r\n };\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n return [4 /*yield*/, this.getAccessToken()];\r\n case 1:\r\n token = _c.sent();\r\n this.updateHeaderToken(pollOptions, token);\r\n pollUrl = url + \"&_=\" + Date.now();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) polling: \" + pollUrl + \".\");\r\n return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)];\r\n case 2:\r\n response = _c.sent();\r\n if (response.statusCode !== 200) {\r\n this.logger.log(LogLevel.Error, \"(LongPolling transport) Unexpected response code: \" + response.statusCode + \".\");\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this.closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this.running = false;\r\n }\r\n else {\r\n this.running = true;\r\n }\r\n this.receiving = this.poll(this.url, pollOptions);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.getAccessToken = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.accessTokenFactory) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2: return [2 /*return*/, null];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.updateHeaderToken = function (request, token) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (token) {\r\n // tslint:disable-next-line:no-string-literal\r\n request.headers[\"Authorization\"] = \"Bearer \" + token;\r\n return;\r\n }\r\n // tslint:disable-next-line:no-string-literal\r\n if (request.headers[\"Authorization\"]) {\r\n // tslint:disable-next-line:no-string-literal\r\n delete request.headers[\"Authorization\"];\r\n }\r\n };\r\n LongPollingTransport.prototype.poll = function (url, pollOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token, pollUrl, response, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, , 8, 9]);\r\n _a.label = 1;\r\n case 1:\r\n if (!this.running) return [3 /*break*/, 7];\r\n return [4 /*yield*/, this.getAccessToken()];\r\n case 2:\r\n token = _a.sent();\r\n this.updateHeaderToken(pollOptions, token);\r\n _a.label = 3;\r\n case 3:\r\n _a.trys.push([3, 5, , 6]);\r\n pollUrl = url + \"&_=\" + Date.now();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) polling: \" + pollUrl + \".\");\r\n return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)];\r\n case 4:\r\n response = _a.sent();\r\n if (response.statusCode === 204) {\r\n this.logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n this.running = false;\r\n }\r\n else if (response.statusCode !== 200) {\r\n this.logger.log(LogLevel.Error, \"(LongPolling transport) Unexpected response code: \" + response.statusCode + \".\");\r\n // Unexpected status code\r\n this.closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this.running = false;\r\n }\r\n else {\r\n // Process the response\r\n if (response.content) {\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) data received. \" + getDataDetail(response.content, this.logMessageContent) + \".\");\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n }\r\n else {\r\n // This is another way timeout manifest.\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n return [3 /*break*/, 6];\r\n case 5:\r\n e_1 = _a.sent();\r\n if (!this.running) {\r\n // Log but disregard errors that occur after stopping\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll errored after shutdown: \" + e_1.message);\r\n }\r\n else {\r\n if (e_1 instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n else {\r\n // Close the connection with the error as the result.\r\n this.closeError = e_1;\r\n this.running = false;\r\n }\r\n }\r\n return [3 /*break*/, 6];\r\n case 6: return [3 /*break*/, 1];\r\n case 7: return [3 /*break*/, 9];\r\n case 8:\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this.raiseOnClose();\r\n }\r\n return [7 /*endfinally*/];\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.send = function (data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.running) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot send until the transport is connected\"))];\r\n }\r\n return [2 /*return*/, sendMessage(this.logger, \"LongPolling\", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent, this.withCredentials, this.headers)];\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.stop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, _a, name_1, value, deleteOptions, token;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this.running = false;\r\n this.pollAbort.abort();\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, , 5, 6]);\r\n return [4 /*yield*/, this.receiving];\r\n case 2:\r\n _b.sent();\r\n // Send DELETE to clean up long polling on the server\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) sending DELETE request to \" + this.url + \".\");\r\n headers = {};\r\n _a = getUserAgentHeader(), name_1 = _a[0], value = _a[1];\r\n headers[name_1] = value;\r\n deleteOptions = {\r\n headers: __assign({}, headers, this.headers),\r\n withCredentials: this.withCredentials,\r\n };\r\n return [4 /*yield*/, this.getAccessToken()];\r\n case 3:\r\n token = _b.sent();\r\n this.updateHeaderToken(deleteOptions, token);\r\n return [4 /*yield*/, this.httpClient.delete(this.url, deleteOptions)];\r\n case 4:\r\n _b.sent();\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request sent.\");\r\n return [3 /*break*/, 6];\r\n case 5:\r\n this.logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this.raiseOnClose();\r\n return [7 /*endfinally*/];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n LongPollingTransport.prototype.raiseOnClose = function () {\r\n if (this.onclose) {\r\n var logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this.closeError) {\r\n logMessage += \" Error: \" + this.closeError;\r\n }\r\n this.logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this.closeError);\r\n }\r\n };\r\n return LongPollingTransport;\r\n}());\r\nexport { LongPollingTransport };\r\n//# sourceMappingURL=LongPollingTransport.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\n/** @private */\r\nvar ServerSentEventsTransport = /** @class */ (function () {\r\n function ServerSentEventsTransport(httpClient, accessTokenFactory, logger, logMessageContent, eventSourceConstructor, withCredentials, headers) {\r\n this.httpClient = httpClient;\r\n this.accessTokenFactory = accessTokenFactory;\r\n this.logger = logger;\r\n this.logMessageContent = logMessageContent;\r\n this.withCredentials = withCredentials;\r\n this.eventSourceConstructor = eventSourceConstructor;\r\n this.headers = headers;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n ServerSentEventsTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n // set url before accessTokenFactory because this.url is only for send and we set the auth header instead of the query string for send\r\n this.url = url;\r\n if (!this.accessTokenFactory) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + (\"access_token=\" + encodeURIComponent(token));\r\n }\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n var eventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials });\r\n }\r\n else {\r\n // Non-browser passes cookies via the dictionary\r\n var cookies = _this.httpClient.getCookieString(url);\r\n var headers = {};\r\n headers.Cookie = cookies;\r\n var _a = getUserAgentHeader(), name_1 = _a[0], value = _a[1];\r\n headers[name_1] = value;\r\n eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials, headers: __assign({}, headers, _this.headers) });\r\n }\r\n try {\r\n eventSource.onmessage = function (e) {\r\n if (_this.onreceive) {\r\n try {\r\n _this.logger.log(LogLevel.Trace, \"(SSE transport) data received. \" + getDataDetail(e.data, _this.logMessageContent) + \".\");\r\n _this.onreceive(e.data);\r\n }\r\n catch (error) {\r\n _this.close(error);\r\n return;\r\n }\r\n }\r\n };\r\n eventSource.onerror = function (e) {\r\n var error = new Error(e.data || \"Error occurred\");\r\n if (opened) {\r\n _this.close(error);\r\n }\r\n else {\r\n reject(error);\r\n }\r\n };\r\n eventSource.onopen = function () {\r\n _this.logger.log(LogLevel.Information, \"SSE connected to \" + _this.url);\r\n _this.eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n ServerSentEventsTransport.prototype.send = function (data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (!this.eventSource) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot send until the transport is connected\"))];\r\n }\r\n return [2 /*return*/, sendMessage(this.logger, \"SSE\", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent, this.withCredentials, this.headers)];\r\n });\r\n });\r\n };\r\n ServerSentEventsTransport.prototype.stop = function () {\r\n this.close();\r\n return Promise.resolve();\r\n };\r\n ServerSentEventsTransport.prototype.close = function (e) {\r\n if (this.eventSource) {\r\n this.eventSource.close();\r\n this.eventSource = undefined;\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n };\r\n return ServerSentEventsTransport;\r\n}());\r\nexport { ServerSentEventsTransport };\r\n//# sourceMappingURL=ServerSentEventsTransport.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n/** @private */\r\nvar WebSocketTransport = /** @class */ (function () {\r\n function WebSocketTransport(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor, headers) {\r\n this.logger = logger;\r\n this.accessTokenFactory = accessTokenFactory;\r\n this.logMessageContent = logMessageContent;\r\n this.webSocketConstructor = webSocketConstructor;\r\n this.httpClient = httpClient;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this.headers = headers;\r\n }\r\n WebSocketTransport.prototype.connect = function (url, transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var token;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n if (!this.accessTokenFactory) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _a.sent();\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + (\"access_token=\" + encodeURIComponent(token));\r\n }\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, new Promise(function (resolve, reject) {\r\n url = url.replace(/^http/, \"ws\");\r\n var webSocket;\r\n var cookies = _this.httpClient.getCookieString(url);\r\n var opened = false;\r\n if (Platform.isNode) {\r\n var headers = {};\r\n var _a = getUserAgentHeader(), name_1 = _a[0], value = _a[1];\r\n headers[name_1] = value;\r\n if (cookies) {\r\n headers[\"Cookie\"] = \"\" + cookies;\r\n }\r\n // Only pass headers when in non-browser environments\r\n webSocket = new _this.webSocketConstructor(url, undefined, {\r\n headers: __assign({}, headers, _this.headers),\r\n });\r\n }\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new _this.webSocketConstructor(url);\r\n }\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n // tslint:disable-next-line:variable-name\r\n webSocket.onopen = function (_event) {\r\n _this.logger.log(LogLevel.Information, \"WebSocket connected to \" + url + \".\");\r\n _this.webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n webSocket.onerror = function (event) {\r\n var error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = new Error(\"There was an error with the transport.\");\r\n }\r\n reject(error);\r\n };\r\n webSocket.onmessage = function (message) {\r\n _this.logger.log(LogLevel.Trace, \"(WebSockets transport) data received. \" + getDataDetail(message.data, _this.logMessageContent) + \".\");\r\n if (_this.onreceive) {\r\n try {\r\n _this.onreceive(message.data);\r\n }\r\n catch (error) {\r\n _this.close(error);\r\n return;\r\n }\r\n }\r\n };\r\n webSocket.onclose = function (event) {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n _this.close(event);\r\n }\r\n else {\r\n var error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = new Error(\"There was an error with the transport.\");\r\n }\r\n reject(error);\r\n }\r\n };\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n WebSocketTransport.prototype.send = function (data) {\r\n if (this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN) {\r\n this.logger.log(LogLevel.Trace, \"(WebSockets transport) sending data. \" + getDataDetail(data, this.logMessageContent) + \".\");\r\n this.webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n };\r\n WebSocketTransport.prototype.stop = function () {\r\n if (this.webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this.close(undefined);\r\n }\r\n return Promise.resolve();\r\n };\r\n WebSocketTransport.prototype.close = function (event) {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this.webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this.webSocket.onclose = function () { };\r\n this.webSocket.onmessage = function () { };\r\n this.webSocket.onerror = function () { };\r\n this.webSocket.close();\r\n this.webSocket = undefined;\r\n }\r\n this.logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n if (this.onclose) {\r\n if (this.isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(\"WebSocket closed with status code: \" + event.code + \" (\" + event.reason + \").\"));\r\n }\r\n else if (event instanceof Error) {\r\n this.onclose(event);\r\n }\r\n else {\r\n this.onclose();\r\n }\r\n }\r\n };\r\n WebSocketTransport.prototype.isCloseEvent = function (event) {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n };\r\n return WebSocketTransport;\r\n}());\r\nexport { WebSocketTransport };\r\n//# sourceMappingURL=WebSocketTransport.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\nvar MAX_REDIRECTS = 100;\r\n/** @private */\r\nvar HttpConnection = /** @class */ (function () {\r\n function HttpConnection(url, options) {\r\n if (options === void 0) { options = {}; }\r\n this.features = {};\r\n this.negotiateVersion = 1;\r\n Arg.isRequired(url, \"url\");\r\n this.logger = createLogger(options.logger);\r\n this.baseUrl = this.resolveUrl(url);\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n }\r\n else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n var webSocketModule = null;\r\n var eventSourceModule = null;\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n var requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n webSocketModule = requireFunc(\"ws\");\r\n eventSourceModule = requireFunc(\"eventsource\");\r\n }\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n }\r\n else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n }\r\n else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n this.httpClient = options.httpClient || new DefaultHttpClient(this.logger);\r\n this.connectionState = \"Disconnected\" /* Disconnected */;\r\n this.connectionStarted = false;\r\n this.options = options;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n HttpConnection.prototype.start = function (transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var message, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this.logger.log(LogLevel.Debug, \"Starting connection with transfer format '\" + TransferFormat[transferFormat] + \"'.\");\r\n if (this.connectionState !== \"Disconnected\" /* Disconnected */) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"))];\r\n }\r\n this.connectionState = \"Connecting\" /* Connecting */;\r\n this.startInternalPromise = this.startInternal(transferFormat);\r\n return [4 /*yield*/, this.startInternalPromise];\r\n case 1:\r\n _a.sent();\r\n if (!(this.connectionState === \"Disconnecting\" /* Disconnecting */)) return [3 /*break*/, 3];\r\n message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this.logger.log(LogLevel.Error, message);\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n return [4 /*yield*/, this.stopPromise];\r\n case 2:\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n _a.sent();\r\n return [2 /*return*/, Promise.reject(new Error(message))];\r\n case 3:\r\n if (this.connectionState !== \"Connected\" /* Connected */) {\r\n message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this.logger.log(LogLevel.Error, message);\r\n return [2 /*return*/, Promise.reject(new Error(message))];\r\n }\r\n _a.label = 4;\r\n case 4:\r\n this.connectionStarted = true;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.send = function (data) {\r\n if (this.connectionState !== \"Connected\" /* Connected */) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n if (!this.sendQueue) {\r\n this.sendQueue = new TransportSendQueue(this.transport);\r\n }\r\n // Transport will not be null if state is connected\r\n return this.sendQueue.send(data);\r\n };\r\n HttpConnection.prototype.stop = function (error) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (this.connectionState === \"Disconnected\" /* Disconnected */) {\r\n this.logger.log(LogLevel.Debug, \"Call to HttpConnection.stop(\" + error + \") ignored because the connection is already in the disconnected state.\");\r\n return [2 /*return*/, Promise.resolve()];\r\n }\r\n if (this.connectionState === \"Disconnecting\" /* Disconnecting */) {\r\n this.logger.log(LogLevel.Debug, \"Call to HttpConnection.stop(\" + error + \") ignored because the connection is already in the disconnecting state.\");\r\n return [2 /*return*/, this.stopPromise];\r\n }\r\n this.connectionState = \"Disconnecting\" /* Disconnecting */;\r\n this.stopPromise = new Promise(function (resolve) {\r\n // Don't complete stop() until stopConnection() completes.\r\n _this.stopPromiseResolver = resolve;\r\n });\r\n // stopInternal should never throw so just observe it.\r\n return [4 /*yield*/, this.stopInternal(error)];\r\n case 1:\r\n // stopInternal should never throw so just observe it.\r\n _a.sent();\r\n return [4 /*yield*/, this.stopPromise];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.stopInternal = function (error) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this.stopError = error;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.startInternalPromise];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 4:\r\n if (!this.transport) return [3 /*break*/, 9];\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, this.transport.stop()];\r\n case 6:\r\n _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n e_2 = _a.sent();\r\n this.logger.log(LogLevel.Error, \"HttpConnection.transport.stop() threw error '\" + e_2 + \"'.\");\r\n this.stopConnection();\r\n return [3 /*break*/, 8];\r\n case 8:\r\n this.transport = undefined;\r\n return [3 /*break*/, 10];\r\n case 9:\r\n this.logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n this.stopConnection();\r\n _a.label = 10;\r\n case 10: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.startInternal = function (transferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var url, negotiateResponse, redirects, _loop_1, this_1, e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n url = this.baseUrl;\r\n this.accessTokenFactory = this.options.accessTokenFactory;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 12, , 13]);\r\n if (!this.options.skipNegotiation) return [3 /*break*/, 5];\r\n if (!(this.options.transport === HttpTransportType.WebSockets)) return [3 /*break*/, 3];\r\n // No need to add a connection ID in this case\r\n this.transport = this.constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n return [4 /*yield*/, this.startTransport(url, transferFormat)];\r\n case 2:\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3: throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n case 4: return [3 /*break*/, 11];\r\n case 5:\r\n negotiateResponse = null;\r\n redirects = 0;\r\n _loop_1 = function () {\r\n var accessToken_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this_1.getNegotiationResponse(url)];\r\n case 1:\r\n negotiateResponse = _a.sent();\r\n // the user tries to stop the connection when it is being started\r\n if (this_1.connectionState === \"Disconnecting\" /* Disconnecting */ || this_1.connectionState === \"Disconnected\" /* Disconnected */) {\r\n throw new Error(\"The connection was stopped during negotiation.\");\r\n }\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n if (negotiateResponse.ProtocolVersion) {\r\n 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.\");\r\n }\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n if (negotiateResponse.accessToken) {\r\n accessToken_1 = negotiateResponse.accessToken;\r\n this_1.accessTokenFactory = function () { return accessToken_1; };\r\n }\r\n redirects++;\r\n return [2 /*return*/];\r\n }\r\n });\r\n };\r\n this_1 = this;\r\n _a.label = 6;\r\n case 6: return [5 /*yield**/, _loop_1()];\r\n case 7:\r\n _a.sent();\r\n _a.label = 8;\r\n case 8:\r\n if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3 /*break*/, 6];\r\n _a.label = 9;\r\n case 9:\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n return [4 /*yield*/, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)];\r\n case 10:\r\n _a.sent();\r\n _a.label = 11;\r\n case 11:\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n if (this.connectionState === \"Connecting\" /* Connecting */) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this.logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this.connectionState = \"Connected\" /* Connected */;\r\n }\r\n return [3 /*break*/, 13];\r\n case 12:\r\n e_3 = _a.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to start the connection: \" + e_3);\r\n this.connectionState = \"Disconnected\" /* Disconnected */;\r\n this.transport = undefined;\r\n return [2 /*return*/, Promise.reject(e_3)];\r\n case 13: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.getNegotiationResponse = function (url) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var headers, token, _a, name, value, negotiateUrl, response, negotiateResponse, e_4;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n headers = {};\r\n if (!this.accessTokenFactory) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.accessTokenFactory()];\r\n case 1:\r\n token = _b.sent();\r\n if (token) {\r\n headers[\"Authorization\"] = \"Bearer \" + token;\r\n }\r\n _b.label = 2;\r\n case 2:\r\n _a = getUserAgentHeader(), name = _a[0], value = _a[1];\r\n headers[name] = value;\r\n negotiateUrl = this.resolveNegotiateUrl(url);\r\n this.logger.log(LogLevel.Debug, \"Sending negotiation request: \" + negotiateUrl + \".\");\r\n _b.label = 3;\r\n case 3:\r\n _b.trys.push([3, 5, , 6]);\r\n return [4 /*yield*/, this.httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: __assign({}, headers, this.options.headers),\r\n withCredentials: this.options.withCredentials,\r\n })];\r\n case 4:\r\n response = _b.sent();\r\n if (response.statusCode !== 200) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Unexpected status code returned from negotiate '\" + response.statusCode + \"'\"))];\r\n }\r\n negotiateResponse = JSON.parse(response.content);\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n return [2 /*return*/, negotiateResponse];\r\n case 5:\r\n e_4 = _b.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to complete negotiation with the server: \" + e_4);\r\n return [2 /*return*/, Promise.reject(e_4)];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.createConnectUrl = function (url, connectionToken) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + (\"id=\" + connectionToken);\r\n };\r\n HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var connectUrl, transportExceptions, transports, negotiate, _i, transports_1, endpoint, transportOrError, ex_1, ex_2, message;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n connectUrl = this.createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (!this.isITransport(requestedTransport)) return [3 /*break*/, 2];\r\n this.logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)];\r\n case 1:\r\n _a.sent();\r\n this.connectionId = negotiateResponse.connectionId;\r\n return [2 /*return*/];\r\n case 2:\r\n transportExceptions = [];\r\n transports = negotiateResponse.availableTransports || [];\r\n negotiate = negotiateResponse;\r\n _i = 0, transports_1 = transports;\r\n _a.label = 3;\r\n case 3:\r\n if (!(_i < transports_1.length)) return [3 /*break*/, 13];\r\n endpoint = transports_1[_i];\r\n transportOrError = this.resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat);\r\n if (!(transportOrError instanceof Error)) return [3 /*break*/, 4];\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(endpoint.transport + \" failed: \" + transportOrError);\r\n return [3 /*break*/, 12];\r\n case 4:\r\n if (!this.isITransport(transportOrError)) return [3 /*break*/, 12];\r\n this.transport = transportOrError;\r\n if (!!negotiate) return [3 /*break*/, 9];\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, this.getNegotiationResponse(url)];\r\n case 6:\r\n negotiate = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n ex_1 = _a.sent();\r\n return [2 /*return*/, Promise.reject(ex_1)];\r\n case 8:\r\n connectUrl = this.createConnectUrl(url, negotiate.connectionToken);\r\n _a.label = 9;\r\n case 9:\r\n _a.trys.push([9, 11, , 12]);\r\n return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)];\r\n case 10:\r\n _a.sent();\r\n this.connectionId = negotiate.connectionId;\r\n return [2 /*return*/];\r\n case 11:\r\n ex_2 = _a.sent();\r\n this.logger.log(LogLevel.Error, \"Failed to start the transport '\" + endpoint.transport + \"': \" + ex_2);\r\n negotiate = undefined;\r\n transportExceptions.push(endpoint.transport + \" failed: \" + ex_2);\r\n if (this.connectionState !== \"Connecting\" /* Connecting */) {\r\n message = \"Failed to select transport before stop() was called.\";\r\n this.logger.log(LogLevel.Debug, message);\r\n return [2 /*return*/, Promise.reject(new Error(message))];\r\n }\r\n return [3 /*break*/, 12];\r\n case 12:\r\n _i++;\r\n return [3 /*break*/, 3];\r\n case 13:\r\n if (transportExceptions.length > 0) {\r\n return [2 /*return*/, Promise.reject(new Error(\"Unable to connect to the server with any of the available transports. \" + transportExceptions.join(\" \")))];\r\n }\r\n return [2 /*return*/, Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"))];\r\n }\r\n });\r\n });\r\n };\r\n HttpConnection.prototype.constructTransport = function (transport) {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this.options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.WebSocket, this.options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this.options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.EventSource, this.options.withCredentials, this.options.headers || {});\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.withCredentials, this.options.headers || {});\r\n default:\r\n throw new Error(\"Unknown transport: \" + transport + \".\");\r\n }\r\n };\r\n HttpConnection.prototype.startTransport = function (url, transferFormat) {\r\n var _this = this;\r\n this.transport.onreceive = this.onreceive;\r\n this.transport.onclose = function (e) { return _this.stopConnection(e); };\r\n return this.transport.connect(url, transferFormat);\r\n };\r\n HttpConnection.prototype.resolveTransportOrError = function (endpoint, requestedTransport, requestedTransferFormat) {\r\n var transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + endpoint.transport + \"' because it is not supported by this client.\");\r\n return new Error(\"Skipping transport '\" + endpoint.transport + \"' because it is not supported by this client.\");\r\n }\r\n else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n var transferFormats = endpoint.transferFormats.map(function (s) { return TransferFormat[s]; });\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this.options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this.options.EventSource)) {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it is not supported in your environment.'\");\r\n return new Error(\"'\" + HttpTransportType[transport] + \"' is not supported in your environment.\");\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Selecting transport '\" + HttpTransportType[transport] + \"'.\");\r\n try {\r\n return this.constructTransport(transport);\r\n }\r\n catch (ex) {\r\n return ex;\r\n }\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it does not support the requested transfer format '\" + TransferFormat[requestedTransferFormat] + \"'.\");\r\n return new Error(\"'\" + HttpTransportType[transport] + \"' does not support \" + TransferFormat[requestedTransferFormat] + \".\");\r\n }\r\n }\r\n else {\r\n this.logger.log(LogLevel.Debug, \"Skipping transport '\" + HttpTransportType[transport] + \"' because it was disabled by the client.\");\r\n return new Error(\"'\" + HttpTransportType[transport] + \"' is disabled by the client.\");\r\n }\r\n }\r\n };\r\n HttpConnection.prototype.isITransport = function (transport) {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n };\r\n HttpConnection.prototype.stopConnection = function (error) {\r\n var _this = this;\r\n this.logger.log(LogLevel.Debug, \"HttpConnection.stopConnection(\" + error + \") called while in state \" + this.connectionState + \".\");\r\n this.transport = undefined;\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this.stopError || error;\r\n this.stopError = undefined;\r\n if (this.connectionState === \"Disconnected\" /* Disconnected */) {\r\n this.logger.log(LogLevel.Debug, \"Call to HttpConnection.stopConnection(\" + error + \") was ignored because the connection is already in the disconnected state.\");\r\n return;\r\n }\r\n if (this.connectionState === \"Connecting\" /* Connecting */) {\r\n this.logger.log(LogLevel.Warning, \"Call to HttpConnection.stopConnection(\" + error + \") was ignored because the connection is still in the connecting state.\");\r\n throw new Error(\"HttpConnection.stopConnection(\" + error + \") was called while the connection is still in the connecting state.\");\r\n }\r\n if (this.connectionState === \"Disconnecting\" /* Disconnecting */) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this.stopPromiseResolver();\r\n }\r\n if (error) {\r\n this.logger.log(LogLevel.Error, \"Connection disconnected with error '\" + error + \"'.\");\r\n }\r\n else {\r\n this.logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n if (this.sendQueue) {\r\n this.sendQueue.stop().catch(function (e) {\r\n _this.logger.log(LogLevel.Error, \"TransportSendQueue.stop() threw error '\" + e + \"'.\");\r\n });\r\n this.sendQueue = undefined;\r\n }\r\n this.connectionId = undefined;\r\n this.connectionState = \"Disconnected\" /* Disconnected */;\r\n if (this.connectionStarted) {\r\n this.connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n }\r\n catch (e) {\r\n this.logger.log(LogLevel.Error, \"HttpConnection.onclose(\" + error + \") threw error '\" + e + \"'.\");\r\n }\r\n }\r\n };\r\n HttpConnection.prototype.resolveUrl = function (url) {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n if (!Platform.isBrowser || !window.document) {\r\n throw new Error(\"Cannot resolve '\" + url + \"'.\");\r\n }\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n var aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n this.logger.log(LogLevel.Information, \"Normalizing '\" + url + \"' to '\" + aTag.href + \"'.\");\r\n return aTag.href;\r\n };\r\n HttpConnection.prototype.resolveNegotiateUrl = function (url) {\r\n var index = url.indexOf(\"?\");\r\n var negotiateUrl = url.substring(0, index === -1 ? url.length : index);\r\n if (negotiateUrl[negotiateUrl.length - 1] !== \"/\") {\r\n negotiateUrl += \"/\";\r\n }\r\n negotiateUrl += \"negotiate\";\r\n negotiateUrl += index === -1 ? \"\" : url.substring(index);\r\n if (negotiateUrl.indexOf(\"negotiateVersion\") === -1) {\r\n negotiateUrl += index === -1 ? \"?\" : \"&\";\r\n negotiateUrl += \"negotiateVersion=\" + this.negotiateVersion;\r\n }\r\n return negotiateUrl;\r\n };\r\n return HttpConnection;\r\n}());\r\nexport { HttpConnection };\r\nfunction transportMatches(requestedTransport, actualTransport) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n/** @private */\r\nvar TransportSendQueue = /** @class */ (function () {\r\n function TransportSendQueue(transport) {\r\n this.transport = transport;\r\n this.buffer = [];\r\n this.executing = true;\r\n this.sendBufferedData = new PromiseSource();\r\n this.transportResult = new PromiseSource();\r\n this.sendLoopPromise = this.sendLoop();\r\n }\r\n TransportSendQueue.prototype.send = function (data) {\r\n this.bufferData(data);\r\n if (!this.transportResult) {\r\n this.transportResult = new PromiseSource();\r\n }\r\n return this.transportResult.promise;\r\n };\r\n TransportSendQueue.prototype.stop = function () {\r\n this.executing = false;\r\n this.sendBufferedData.resolve();\r\n return this.sendLoopPromise;\r\n };\r\n TransportSendQueue.prototype.bufferData = function (data) {\r\n if (this.buffer.length && typeof (this.buffer[0]) !== typeof (data)) {\r\n throw new Error(\"Expected data to be of type \" + typeof (this.buffer) + \" but was of type \" + typeof (data));\r\n }\r\n this.buffer.push(data);\r\n this.sendBufferedData.resolve();\r\n };\r\n TransportSendQueue.prototype.sendLoop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var transportResult, data, error_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!true) return [3 /*break*/, 6];\r\n return [4 /*yield*/, this.sendBufferedData.promise];\r\n case 1:\r\n _a.sent();\r\n if (!this.executing) {\r\n if (this.transportResult) {\r\n this.transportResult.reject(\"Connection stopped.\");\r\n }\r\n return [3 /*break*/, 6];\r\n }\r\n this.sendBufferedData = new PromiseSource();\r\n transportResult = this.transportResult;\r\n this.transportResult = undefined;\r\n data = typeof (this.buffer[0]) === \"string\" ?\r\n this.buffer.join(\"\") :\r\n TransportSendQueue.concatBuffers(this.buffer);\r\n this.buffer.length = 0;\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.transport.send(data)];\r\n case 3:\r\n _a.sent();\r\n transportResult.resolve();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n error_1 = _a.sent();\r\n transportResult.reject(error_1);\r\n return [3 /*break*/, 5];\r\n case 5: return [3 /*break*/, 0];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n TransportSendQueue.concatBuffers = function (arrayBuffers) {\r\n var totalLength = arrayBuffers.map(function (b) { return b.byteLength; }).reduce(function (a, b) { return a + b; });\r\n var result = new Uint8Array(totalLength);\r\n var offset = 0;\r\n for (var _i = 0, arrayBuffers_1 = arrayBuffers; _i < arrayBuffers_1.length; _i++) {\r\n var item = arrayBuffers_1[_i];\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n return result.buffer;\r\n };\r\n return TransportSendQueue;\r\n}());\r\nexport { TransportSendQueue };\r\nvar PromiseSource = /** @class */ (function () {\r\n function PromiseSource() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve, reject) {\r\n var _a;\r\n return _a = [resolve, reject], _this.resolver = _a[0], _this.rejecter = _a[1], _a;\r\n });\r\n }\r\n PromiseSource.prototype.resolve = function () {\r\n this.resolver();\r\n };\r\n PromiseSource.prototype.reject = function (reason) {\r\n this.rejecter(reason);\r\n };\r\n return PromiseSource;\r\n}());\r\n//# sourceMappingURL=HttpConnection.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nvar JSON_HUB_PROTOCOL_NAME = \"json\";\r\n/** Implements the JSON Hub Protocol. */\r\nvar JsonHubProtocol = /** @class */ (function () {\r\n function JsonHubProtocol() {\r\n /** @inheritDoc */\r\n this.name = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n this.version = 1;\r\n /** @inheritDoc */\r\n this.transferFormat = TransferFormat.Text;\r\n }\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n JsonHubProtocol.prototype.parseMessages = function (input, logger) {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n if (!input) {\r\n return [];\r\n }\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n // Parse the messages\r\n var messages = TextMessageFormat.parse(input);\r\n var hubMessages = [];\r\n for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) {\r\n var message = messages_1[_i];\r\n var parsedMessage = JSON.parse(message);\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this.isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this.isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this.isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n return hubMessages;\r\n };\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n JsonHubProtocol.prototype.writeMessage = function (message) {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n };\r\n JsonHubProtocol.prototype.isInvocationMessage = function (message) {\r\n this.assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n if (message.invocationId !== undefined) {\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n };\r\n JsonHubProtocol.prototype.isStreamItemMessage = function (message) {\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n };\r\n JsonHubProtocol.prototype.isCompletionMessage = function (message) {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n if (!message.result && message.error) {\r\n this.assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n this.assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n };\r\n JsonHubProtocol.prototype.assertNotEmptyString = function (value, errorMessage) {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n };\r\n return JsonHubProtocol;\r\n}());\r\nexport { JsonHubProtocol };\r\n//# sourceMappingURL=JsonHubProtocol.js.map","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n};\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\n// tslint:disable:object-literal-sort-keys\r\nvar LogLevelNameMapping = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\nfunction parseLogLevel(name) {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n var mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n }\r\n else {\r\n throw new Error(\"Unknown log level: \" + name);\r\n }\r\n}\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nvar HubConnectionBuilder = /** @class */ (function () {\r\n function HubConnectionBuilder() {\r\n }\r\n HubConnectionBuilder.prototype.configureLogging = function (logging) {\r\n Arg.isRequired(logging, \"logging\");\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n }\r\n else if (typeof logging === \"string\") {\r\n var logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n }\r\n else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n return this;\r\n };\r\n HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n this.url = url;\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions);\r\n }\r\n else {\r\n this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions });\r\n }\r\n return this;\r\n };\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n HubConnectionBuilder.prototype.withHubProtocol = function (protocol) {\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.protocol = protocol;\r\n return this;\r\n };\r\n HubConnectionBuilder.prototype.withAutomaticReconnect = function (retryDelaysOrReconnectPolicy) {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n }\r\n else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n }\r\n else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n return this;\r\n };\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n HubConnectionBuilder.prototype.build = function () {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n var httpConnectionOptions = this.httpConnectionOptions || {};\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n var connection = new HttpConnection(this.url, httpConnectionOptions);\r\n return HubConnection.create(connection, this.logger || NullLogger.instance, this.protocol || new JsonHubProtocol(), this.reconnectPolicy);\r\n };\r\n return HubConnectionBuilder;\r\n}());\r\nexport { HubConnectionBuilder };\r\nfunction isLogger(logger) {\r\n return logger.log !== undefined;\r\n}\r\n//# sourceMappingURL=HubConnectionBuilder.js.map"],"names":["extendStatics","LogLevel","__extends","Object","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__","this","constructor","prototype","create","HttpError","_super","errorMessage","statusCode","_this","trueProto","call","Error","TimeoutError","AbortError","__assign","assign","t","s","i","n","arguments","length","HttpResponse","statusText","content","HttpClient","get","url","options","send","method","post","delete","getCookieString","NullLogger","log","_logLevel","_message","instance","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","g","_","label","sent","trys","ops","verb","Symbol","iterator","v","op","TypeError","pop","push","VERSION","Arg","isRequired","val","name","isNotEmpty","match","isIn","values","Platform","defineProperty","window","enumerable","configurable","self","isBrowser","isWebWorker","getDataDetail","data","includeContent","detail","isArrayBuffer","byteLength","view","Uint8Array","str","forEach","num","toString","substr","formatArrayBuffer","ArrayBuffer","sendMessage","logger","transportName","httpClient","accessTokenFactory","logMessageContent","withCredentials","defaultHeaders","_a","headers","token","_b","responseType","response","_c","getUserAgentHeader","Trace","SubjectSubscription","subject","observer","dispose","index","observers","indexOf","splice","cancelCallback","catch","ConsoleLogger","minimumLogLevel","outputConsole","console","logLevel","message","Critical","error","Date","toISOString","Warning","warn","Information","info","userAgentHeaderName","isNode","constructUserAgent","getOsName","getRuntime","getRuntimeVersion","version","os","runtime","runtimeVersion","userAgent","majorAndMinor","split","platform","versions","node","FetchHttpClient","fetch","requireFunc","jar","CookieJar","fetchType","abortControllerType","bind","AbortController","request","abortController","timeoutId","msTimeout","e_1","payload","abortSignal","aborted","onabort","abort","timeout","setTimeout","cache","credentials","mode","redirect","signal","clearTimeout","ok","status","arrayBuffer","text","deserializeContent","cookies","getCookies","c","join","MessageType","XhrHttpClient","xhr","XMLHttpRequest","open","undefined","setRequestHeader","keys","header","onload","responseText","onerror","ontimeout","DefaultHttpClient","TextMessageFormat","write","output","RecordSeparator","parse","input","messages","RecordSeparatorCode","String","fromCharCode","HandshakeProtocol","writeHandshakeRequest","handshakeRequest","JSON","stringify","parseHandshakeResponse","messageData","remainingData","Buffer","binaryData","separatorIndex","responseLength","slice","buffer","textData","substring","type","HubConnectionState","Subject","item","_i","err","complete","subscribe","HttpTransportType","TransferFormat","HubConnection","connection","protocol","reconnectPolicy","serverTimeoutInMilliseconds","keepAliveIntervalInMilliseconds","handshakeProtocol","onreceive","processIncomingData","onclose","connectionClosed","callbacks","methods","closedCallbacks","reconnectingCallbacks","reconnectedCallbacks","invocationId","receivedHandshakeResponse","connectionState","Disconnected","connectionStarted","cachedPingMessage","writeMessage","Ping","connectionId","baseUrl","set","Reconnecting","start","startPromise","startWithStateTransitions","Connecting","Debug","startInternal","Connected","handshakePromise","e_2","stopDuringStartError","handshakeResolver","handshakeRejecter","transferFormat","cleanupTimeout","resetTimeoutPeriod","resetKeepAliveInterval","cleanupPingTimer","stop","stopPromise","stopInternal","Disconnecting","reconnectDelayHandle","completeClose","stream","methodName","args","promiseQueue","replaceStreamingParams","streams","streamIds","invocationDescriptor","createStreamInvocation","cancelInvocation","createCancelInvocation","sendWithProtocol","invocationEvent","Completion","launchStreams","sendPromise","createInvocation","invoke","on","newMethod","toLowerCase","off","handlers","removeIdx","callback","onreconnecting","onreconnected","processHandshakeResponse","messages_1","parseMessages","Invocation","invokeClientMethod","StreamItem","Close","allowReconnect","responseMessage","features","inherentKeepAlive","pingServerHandle","timeoutHandle","serverTimeout","invocationMessage","target","m","cancelCallbacksWithError","reconnect","reconnectStartTime","previousReconnectAttempts","retryError","nextRetryDelay","e_4","now","getNextRetryDelay","previousRetryCount","elapsedMilliseconds","retryReason","nextRetryDelayInMilliseconds","key","nonblocking","_loop_1","streamId","createCompletionMessage","createStreamItemMessage","argument","isObservable","arg","StreamInvocation","id","CancelInvocation","DEFAULT_RETRY_DELAYS_IN_MILLISECONDS","DefaultReconnectPolicy","retryDelays","concat","retryContext","isAborted","LongPollingTransport","pollAbort","running","connect","pollOptions","pollUrl","Binary","getAccessToken","updateHeaderToken","closeError","receiving","poll","pollAborted","raiseOnClose","name_1","deleteOptions","logMessage","ServerSentEventsTransport","eventSourceConstructor","encodeURIComponent","opened","Text","eventSource","Cookie","onmessage","close","onopen","WebSocketTransport","webSocketConstructor","webSocket","replace","binaryType","_event","event","ErrorEvent","readyState","OPEN","isCloseEvent","wasClean","code","reason","HttpConnection","negotiateVersion","resolveUrl","webSocketModule","eventSourceModule","WebSocket","EventSource","startInternalPromise","sendQueue","TransportSendQueue","transport","stopPromiseResolver","stopError","stopConnection","negotiateResponse","redirects","this_1","e_3","skipNegotiation","WebSockets","constructTransport","startTransport","accessToken_1","getNegotiationResponse","ProtocolVersion","accessToken","createTransport","negotiateUrl","resolveNegotiateUrl","connectionToken","createConnectUrl","requestedTransport","requestedTransferFormat","connectUrl","transportExceptions","transports","negotiate","transports_1","endpoint","transportOrError","ex_1","ex_2","isITransport","availableTransports","resolveTransportOrError","ServerSentEvents","LongPolling","actualTransport","transportMatches","transferFormats","map","ex","lastIndexOf","document","aTag","createElement","href","executing","sendBufferedData","PromiseSource","transportResult","sendLoopPromise","sendLoop","bufferData","promise","error_1","concatBuffers","arrayBuffers","totalLength","reduce","a","offset","arrayBuffers_1","resolver","rejecter","JsonHubProtocol","hubMessages","parsedMessage","isInvocationMessage","isStreamItemMessage","isCompletionMessage","assertNotEmptyString","LogLevelNameMapping","trace","debug","information","warning","critical","none","None","HubConnectionBuilder","configureLogging","logging","mapping","parseLogLevel","withUrl","transportTypeOrOptions","httpConnectionOptions","withHubProtocol","withAutomaticReconnect","retryDelaysOrReconnectPolicy","isArray","build"],"sourceRoot":""}