{"version":3,"file":"pusher.bfa75b24.js","sources":["../../../node_modules/pusher-js/dist/web/pusher.js"],"sourcesContent":["/*!\n * Pusher JavaScript Library v7.0.6\n * https://pusher.com/\n *\n * Copyright 2020, Pusher\n * Released under the MIT licence.\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pusher\"] = factory();\n\telse\n\t\troot[\"Pusher\"] = factory();\n})(window, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Package base64 implements Base64 encoding and decoding.\n */\n// Invalid character used in decoding to indicate\n// that the character to decode is out of range of\n// alphabet and cannot be decoded.\nvar INVALID_BYTE = 256;\n/**\n * Implements standard Base64 encoding.\n *\n * Operates in constant time.\n */\nvar Coder = /** @class */ (function () {\n // TODO(dchest): methods to encode chunk-by-chunk.\n function Coder(_paddingCharacter) {\n if (_paddingCharacter === void 0) { _paddingCharacter = \"=\"; }\n this._paddingCharacter = _paddingCharacter;\n }\n Coder.prototype.encodedLength = function (length) {\n if (!this._paddingCharacter) {\n return (length * 8 + 5) / 6 | 0;\n }\n return (length + 2) / 3 * 4 | 0;\n };\n Coder.prototype.encode = function (data) {\n var out = \"\";\n var i = 0;\n for (; i < data.length - 2; i += 3) {\n var c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);\n out += this._encodeByte((c >>> 3 * 6) & 63);\n out += this._encodeByte((c >>> 2 * 6) & 63);\n out += this._encodeByte((c >>> 1 * 6) & 63);\n out += this._encodeByte((c >>> 0 * 6) & 63);\n }\n var left = data.length - i;\n if (left > 0) {\n var c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0);\n out += this._encodeByte((c >>> 3 * 6) & 63);\n out += this._encodeByte((c >>> 2 * 6) & 63);\n if (left === 2) {\n out += this._encodeByte((c >>> 1 * 6) & 63);\n }\n else {\n out += this._paddingCharacter || \"\";\n }\n out += this._paddingCharacter || \"\";\n }\n return out;\n };\n Coder.prototype.maxDecodedLength = function (length) {\n if (!this._paddingCharacter) {\n return (length * 6 + 7) / 8 | 0;\n }\n return length / 4 * 3 | 0;\n };\n Coder.prototype.decodedLength = function (s) {\n return this.maxDecodedLength(s.length - this._getPaddingLength(s));\n };\n Coder.prototype.decode = function (s) {\n if (s.length === 0) {\n return new Uint8Array(0);\n }\n var paddingLength = this._getPaddingLength(s);\n var length = s.length - paddingLength;\n var out = new Uint8Array(this.maxDecodedLength(length));\n var op = 0;\n var i = 0;\n var haveBad = 0;\n var v0 = 0, v1 = 0, v2 = 0, v3 = 0;\n for (; i < length - 4; i += 4) {\n v0 = this._decodeChar(s.charCodeAt(i + 0));\n v1 = this._decodeChar(s.charCodeAt(i + 1));\n v2 = this._decodeChar(s.charCodeAt(i + 2));\n v3 = this._decodeChar(s.charCodeAt(i + 3));\n out[op++] = (v0 << 2) | (v1 >>> 4);\n out[op++] = (v1 << 4) | (v2 >>> 2);\n out[op++] = (v2 << 6) | v3;\n haveBad |= v0 & INVALID_BYTE;\n haveBad |= v1 & INVALID_BYTE;\n haveBad |= v2 & INVALID_BYTE;\n haveBad |= v3 & INVALID_BYTE;\n }\n if (i < length - 1) {\n v0 = this._decodeChar(s.charCodeAt(i));\n v1 = this._decodeChar(s.charCodeAt(i + 1));\n out[op++] = (v0 << 2) | (v1 >>> 4);\n haveBad |= v0 & INVALID_BYTE;\n haveBad |= v1 & INVALID_BYTE;\n }\n if (i < length - 2) {\n v2 = this._decodeChar(s.charCodeAt(i + 2));\n out[op++] = (v1 << 4) | (v2 >>> 2);\n haveBad |= v2 & INVALID_BYTE;\n }\n if (i < length - 3) {\n v3 = this._decodeChar(s.charCodeAt(i + 3));\n out[op++] = (v2 << 6) | v3;\n haveBad |= v3 & INVALID_BYTE;\n }\n if (haveBad !== 0) {\n throw new Error(\"Base64Coder: incorrect characters for decoding\");\n }\n return out;\n };\n // Standard encoding have the following encoded/decoded ranges,\n // which we need to convert between.\n //\n // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 + /\n // Index: 0 - 25 26 - 51 52 - 61 62 63\n // ASCII: 65 - 90 97 - 122 48 - 57 43 47\n //\n // Encode 6 bits in b into a new character.\n Coder.prototype._encodeByte = function (b) {\n // Encoding uses constant time operations as follows:\n //\n // 1. Define comparison of A with B using (A - B) >>> 8:\n // if A > B, then result is positive integer\n // if A <= B, then result is 0\n //\n // 2. Define selection of C or 0 using bitwise AND: X & C:\n // if X == 0, then result is 0\n // if X != 0, then result is C\n //\n // 3. Start with the smallest comparison (b >= 0), which is always\n // true, so set the result to the starting ASCII value (65).\n //\n // 4. Continue comparing b to higher ASCII values, and selecting\n // zero if comparison isn't true, otherwise selecting a value\n // to add to result, which:\n //\n // a) undoes the previous addition\n // b) provides new value to add\n //\n var result = b;\n // b >= 0\n result += 65;\n // b > 25\n result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n // b > 51\n result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n // b > 61\n result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43);\n // b > 62\n result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47);\n return String.fromCharCode(result);\n };\n // Decode a character code into a byte.\n // Must return 256 if character is out of alphabet range.\n Coder.prototype._decodeChar = function (c) {\n // Decoding works similar to encoding: using the same comparison\n // function, but now it works on ranges: result is always incremented\n // by value, but this value becomes zero if the range is not\n // satisfied.\n //\n // Decoding starts with invalid value, 256, which is then\n // subtracted when the range is satisfied. If none of the ranges\n // apply, the function returns 256, which is then checked by\n // the caller to throw error.\n var result = INVALID_BYTE; // start with invalid character\n // c == 43 (c > 42 and c < 44)\n result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62);\n // c == 47 (c > 46 and c < 48)\n result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63);\n // c > 47 and c < 58\n result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n // c > 64 and c < 91\n result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n // c > 96 and c < 123\n result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n return result;\n };\n Coder.prototype._getPaddingLength = function (s) {\n var paddingLength = 0;\n if (this._paddingCharacter) {\n for (var i = s.length - 1; i >= 0; i--) {\n if (s[i] !== this._paddingCharacter) {\n break;\n }\n paddingLength++;\n }\n if (s.length < 4 || paddingLength > 2) {\n throw new Error(\"Base64Coder: incorrect padding\");\n }\n }\n return paddingLength;\n };\n return Coder;\n}());\nexports.Coder = Coder;\nvar stdCoder = new Coder();\nfunction encode(data) {\n return stdCoder.encode(data);\n}\nexports.encode = encode;\nfunction decode(s) {\n return stdCoder.decode(s);\n}\nexports.decode = decode;\n/**\n * Implements URL-safe Base64 encoding.\n * (Same as Base64, but '+' is replaced with '-', and '/' with '_').\n *\n * Operates in constant time.\n */\nvar URLSafeCoder = /** @class */ (function (_super) {\n __extends(URLSafeCoder, _super);\n function URLSafeCoder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // URL-safe encoding have the following encoded/decoded ranges:\n //\n // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 - _\n // Index: 0 - 25 26 - 51 52 - 61 62 63\n // ASCII: 65 - 90 97 - 122 48 - 57 45 95\n //\n URLSafeCoder.prototype._encodeByte = function (b) {\n var result = b;\n // b >= 0\n result += 65;\n // b > 25\n result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n // b > 51\n result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n // b > 61\n result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45);\n // b > 62\n result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95);\n return String.fromCharCode(result);\n };\n URLSafeCoder.prototype._decodeChar = function (c) {\n var result = INVALID_BYTE;\n // c == 45 (c > 44 and c < 46)\n result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62);\n // c == 95 (c > 94 and c < 96)\n result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63);\n // c > 47 and c < 58\n result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n // c > 64 and c < 91\n result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n // c > 96 and c < 123\n result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n return result;\n };\n return URLSafeCoder;\n}(Coder));\nexports.URLSafeCoder = URLSafeCoder;\nvar urlSafeCoder = new URLSafeCoder();\nfunction encodeURLSafe(data) {\n return urlSafeCoder.encode(data);\n}\nexports.encodeURLSafe = encodeURLSafe;\nfunction decodeURLSafe(s) {\n return urlSafeCoder.decode(s);\n}\nexports.decodeURLSafe = decodeURLSafe;\nexports.encodedLength = function (length) {\n return stdCoder.encodedLength(length);\n};\nexports.maxDecodedLength = function (length) {\n return stdCoder.maxDecodedLength(length);\n};\nexports.decodedLength = function (s) {\n return stdCoder.decodedLength(s);\n};\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Package utf8 implements UTF-8 encoding and decoding.\n */\nvar INVALID_UTF16 = \"utf8: invalid string\";\nvar INVALID_UTF8 = \"utf8: invalid source encoding\";\n/**\n * Encodes the given string into UTF-8 byte array.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nfunction encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}\nexports.encode = encode;\n/**\n * Returns the number of bytes required to encode the given string into UTF-8.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nfunction encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}\nexports.encodedLength = encodedLength;\n/**\n * Decodes the given byte array from UTF-8 into a string.\n * Throws if encoding is invalid.\n */\nfunction decode(arr) {\n var chars = [];\n for (var i = 0; i < arr.length; i++) {\n var b = arr[i];\n if (b & 0x80) {\n var min = void 0;\n if (b < 0xe0) {\n // Need 1 more byte.\n if (i >= arr.length) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n if ((n1 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x1f) << 6 | (n1 & 0x3f);\n min = 0x80;\n }\n else if (b < 0xf0) {\n // Need 2 more bytes.\n if (i >= arr.length - 1) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);\n min = 0x800;\n }\n else if (b < 0xf8) {\n // Need 3 more bytes.\n if (i >= arr.length - 2) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n var n3 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);\n min = 0x10000;\n }\n else {\n throw new Error(INVALID_UTF8);\n }\n if (b < min || (b >= 0xd800 && b <= 0xdfff)) {\n throw new Error(INVALID_UTF8);\n }\n if (b >= 0x10000) {\n // Surrogate pair.\n if (b > 0x10ffff) {\n throw new Error(INVALID_UTF8);\n }\n b -= 0x10000;\n chars.push(String.fromCharCode(0xd800 | (b >> 10)));\n b = 0xdc00 | (b & 0x3ff);\n }\n }\n chars.push(String.fromCharCode(b));\n }\n return chars.join(\"\");\n}\nexports.decode = decode;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// required so we don't have to do require('pusher').default etc.\nmodule.exports = __webpack_require__(3).default;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts\nvar ScriptReceiverFactory = (function () {\n function ScriptReceiverFactory(prefix, name) {\n this.lastId = 0;\n this.prefix = prefix;\n this.name = name;\n }\n ScriptReceiverFactory.prototype.create = function (callback) {\n this.lastId++;\n var number = this.lastId;\n var id = this.prefix + number;\n var name = this.name + '[' + number + ']';\n var called = false;\n var callbackWrapper = function () {\n if (!called) {\n callback.apply(null, arguments);\n called = true;\n }\n };\n this[number] = callbackWrapper;\n return { number: number, id: id, name: name, callback: callbackWrapper };\n };\n ScriptReceiverFactory.prototype.remove = function (receiver) {\n delete this[receiver.number];\n };\n return ScriptReceiverFactory;\n}());\n\nvar ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.ScriptReceivers');\n\n// CONCATENATED MODULE: ./src/core/defaults.ts\nvar Defaults = {\n VERSION: \"7.0.6\",\n PROTOCOL: 7,\n wsPort: 80,\n wssPort: 443,\n wsPath: '',\n httpHost: 'sockjs.pusher.com',\n httpPort: 80,\n httpsPort: 443,\n httpPath: '/pusher',\n stats_host: 'stats.pusher.com',\n authEndpoint: '/pusher/auth',\n authTransport: 'ajax',\n activityTimeout: 120000,\n pongTimeout: 30000,\n unavailableTimeout: 10000,\n cluster: 'mt1',\n cdn_http: \"http://js.pusher.com\",\n cdn_https: \"https://js.pusher.com\",\n dependency_suffix: \"\"\n};\n/* harmony default export */ var defaults = (Defaults);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts\n\n\nvar dependency_loader_DependencyLoader = (function () {\n function DependencyLoader(options) {\n this.options = options;\n this.receivers = options.receivers || ScriptReceivers;\n this.loading = {};\n }\n DependencyLoader.prototype.load = function (name, options, callback) {\n var self = this;\n if (self.loading[name] && self.loading[name].length > 0) {\n self.loading[name].push(callback);\n }\n else {\n self.loading[name] = [callback];\n var request = runtime.createScriptRequest(self.getPath(name, options));\n var receiver = self.receivers.create(function (error) {\n self.receivers.remove(receiver);\n if (self.loading[name]) {\n var callbacks = self.loading[name];\n delete self.loading[name];\n var successCallback = function (wasSuccessful) {\n if (!wasSuccessful) {\n request.cleanup();\n }\n };\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](error, successCallback);\n }\n }\n });\n request.send(receiver);\n }\n };\n DependencyLoader.prototype.getRoot = function (options) {\n var cdn;\n var protocol = runtime.getDocument().location.protocol;\n if ((options && options.useTLS) || protocol === 'https:') {\n cdn = this.options.cdn_https;\n }\n else {\n cdn = this.options.cdn_http;\n }\n return cdn.replace(/\\/*$/, '') + '/' + this.options.version;\n };\n DependencyLoader.prototype.getPath = function (name, options) {\n return this.getRoot(options) + '/' + name + this.options.suffix + '.js';\n };\n return DependencyLoader;\n}());\n/* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts\n\n\n\nvar DependenciesReceivers = new ScriptReceiverFactory('_pusher_dependencies', 'Pusher.DependenciesReceivers');\nvar Dependencies = new dependency_loader({\n cdn_http: defaults.cdn_http,\n cdn_https: defaults.cdn_https,\n version: defaults.VERSION,\n suffix: defaults.dependency_suffix,\n receivers: DependenciesReceivers\n});\n\n// CONCATENATED MODULE: ./src/core/utils/url_store.ts\nvar urlStore = {\n baseUrl: 'https://pusher.com',\n urls: {\n authenticationEndpoint: {\n path: '/docs/authenticating_users'\n },\n javascriptQuickStart: {\n path: '/docs/javascript_quick_start'\n },\n triggeringClientEvents: {\n path: '/docs/client_api_guide/client_events#trigger-events'\n },\n encryptedChannelSupport: {\n fullUrl: 'https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support'\n }\n }\n};\nvar buildLogSuffix = function (key) {\n var urlPrefix = 'See:';\n var urlObj = urlStore.urls[key];\n if (!urlObj)\n return '';\n var url;\n if (urlObj.fullUrl) {\n url = urlObj.fullUrl;\n }\n else if (urlObj.path) {\n url = urlStore.baseUrl + urlObj.path;\n }\n if (!url)\n return '';\n return urlPrefix + \" \" + url;\n};\n/* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix });\n\n// CONCATENATED MODULE: ./src/core/errors.ts\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar BadEventName = (function (_super) {\n __extends(BadEventName, _super);\n function BadEventName(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return BadEventName;\n}(Error));\n\nvar RequestTimedOut = (function (_super) {\n __extends(RequestTimedOut, _super);\n function RequestTimedOut(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return RequestTimedOut;\n}(Error));\n\nvar TransportPriorityTooLow = (function (_super) {\n __extends(TransportPriorityTooLow, _super);\n function TransportPriorityTooLow(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return TransportPriorityTooLow;\n}(Error));\n\nvar TransportClosed = (function (_super) {\n __extends(TransportClosed, _super);\n function TransportClosed(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return TransportClosed;\n}(Error));\n\nvar UnsupportedFeature = (function (_super) {\n __extends(UnsupportedFeature, _super);\n function UnsupportedFeature(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedFeature;\n}(Error));\n\nvar UnsupportedTransport = (function (_super) {\n __extends(UnsupportedTransport, _super);\n function UnsupportedTransport(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedTransport;\n}(Error));\n\nvar UnsupportedStrategy = (function (_super) {\n __extends(UnsupportedStrategy, _super);\n function UnsupportedStrategy(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedStrategy;\n}(Error));\n\nvar HTTPAuthError = (function (_super) {\n __extends(HTTPAuthError, _super);\n function HTTPAuthError(status, msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n _this.status = status;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return HTTPAuthError;\n}(Error));\n\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts\n\n\n\nvar ajax = function (context, socketId, callback) {\n var self = this, xhr;\n xhr = runtime.createXHR();\n xhr.open('POST', self.options.authEndpoint, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n for (var headerName in this.authOptions.headers) {\n xhr.setRequestHeader(headerName, this.authOptions.headers[headerName]);\n }\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var data = void 0;\n var parsed = false;\n try {\n data = JSON.parse(xhr.responseText);\n parsed = true;\n }\n catch (e) {\n callback(new HTTPAuthError(200, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' +\n xhr.responseText), { auth: '' });\n }\n if (parsed) {\n callback(null, data);\n }\n }\n else {\n var suffix = url_store.buildLogSuffix('authenticationEndpoint');\n callback(new HTTPAuthError(xhr.status, 'Unable to retrieve auth string from auth endpoint - ' +\n (\"received status: \" + xhr.status + \" from \" + self.options.authEndpoint + \". \") +\n (\"Clients must be authenticated to join private or presence channels. \" + suffix)), { auth: '' });\n }\n }\n };\n xhr.send(this.composeQuery(socketId));\n return xhr;\n};\n/* harmony default export */ var xhr_auth = (ajax);\n\n// CONCATENATED MODULE: ./src/core/base64.ts\nfunction encode(s) {\n return btoa(utob(s));\n}\nvar fromCharCode = String.fromCharCode;\nvar b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nvar b64tab = {};\nfor (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) {\n b64tab[b64chars.charAt(base64_i)] = base64_i;\n}\nvar cb_utob = function (c) {\n var cc = c.charCodeAt(0);\n return cc < 0x80\n ? c\n : cc < 0x800\n ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))\n : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) +\n fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) +\n fromCharCode(0x80 | (cc & 0x3f));\n};\nvar utob = function (u) {\n return u.replace(/[^\\x00-\\x7F]/g, cb_utob);\n};\nvar cb_encode = function (ccc) {\n var padlen = [0, 2, 1][ccc.length % 3];\n var ord = (ccc.charCodeAt(0) << 16) |\n ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) |\n (ccc.length > 2 ? ccc.charCodeAt(2) : 0);\n var chars = [\n b64chars.charAt(ord >>> 18),\n b64chars.charAt((ord >>> 12) & 63),\n padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),\n padlen >= 1 ? '=' : b64chars.charAt(ord & 63)\n ];\n return chars.join('');\n};\nvar btoa = window.btoa ||\n function (b) {\n return b.replace(/[\\s\\S]{1,3}/g, cb_encode);\n };\n\n// CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts\nvar Timer = (function () {\n function Timer(set, clear, delay, callback) {\n var _this = this;\n this.clear = clear;\n this.timer = set(function () {\n if (_this.timer) {\n _this.timer = callback(_this.timer);\n }\n }, delay);\n }\n Timer.prototype.isRunning = function () {\n return this.timer !== null;\n };\n Timer.prototype.ensureAborted = function () {\n if (this.timer) {\n this.clear(this.timer);\n this.timer = null;\n }\n };\n return Timer;\n}());\n/* harmony default export */ var abstract_timer = (Timer);\n\n// CONCATENATED MODULE: ./src/core/utils/timers/index.ts\nvar timers_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nfunction timers_clearTimeout(timer) {\n window.clearTimeout(timer);\n}\nfunction timers_clearInterval(timer) {\n window.clearInterval(timer);\n}\nvar OneOffTimer = (function (_super) {\n timers_extends(OneOffTimer, _super);\n function OneOffTimer(delay, callback) {\n return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) {\n callback();\n return null;\n }) || this;\n }\n return OneOffTimer;\n}(abstract_timer));\n\nvar PeriodicTimer = (function (_super) {\n timers_extends(PeriodicTimer, _super);\n function PeriodicTimer(delay, callback) {\n return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) {\n callback();\n return timer;\n }) || this;\n }\n return PeriodicTimer;\n}(abstract_timer));\n\n\n// CONCATENATED MODULE: ./src/core/util.ts\n\nvar Util = {\n now: function () {\n if (Date.now) {\n return Date.now();\n }\n else {\n return new Date().valueOf();\n }\n },\n defer: function (callback) {\n return new OneOffTimer(0, callback);\n },\n method: function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var boundArguments = Array.prototype.slice.call(arguments, 1);\n return function (object) {\n return object[name].apply(object, boundArguments.concat(arguments));\n };\n }\n};\n/* harmony default export */ var util = (Util);\n\n// CONCATENATED MODULE: ./src/core/utils/collections.ts\n\n\nfunction extend(target) {\n var sources = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n sources[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < sources.length; i++) {\n var extensions = sources[i];\n for (var property in extensions) {\n if (extensions[property] &&\n extensions[property].constructor &&\n extensions[property].constructor === Object) {\n target[property] = extend(target[property] || {}, extensions[property]);\n }\n else {\n target[property] = extensions[property];\n }\n }\n }\n return target;\n}\nfunction stringify() {\n var m = ['Pusher'];\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === 'string') {\n m.push(arguments[i]);\n }\n else {\n m.push(safeJSONStringify(arguments[i]));\n }\n }\n return m.join(' : ');\n}\nfunction arrayIndexOf(array, item) {\n var nativeIndexOf = Array.prototype.indexOf;\n if (array === null) {\n return -1;\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) {\n return array.indexOf(item);\n }\n for (var i = 0, l = array.length; i < l; i++) {\n if (array[i] === item) {\n return i;\n }\n }\n return -1;\n}\nfunction objectApply(object, f) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n f(object[key], key, object);\n }\n }\n}\nfunction keys(object) {\n var keys = [];\n objectApply(object, function (_, key) {\n keys.push(key);\n });\n return keys;\n}\nfunction values(object) {\n var values = [];\n objectApply(object, function (value) {\n values.push(value);\n });\n return values;\n}\nfunction apply(array, f, context) {\n for (var i = 0; i < array.length; i++) {\n f.call(context || window, array[i], i, array);\n }\n}\nfunction map(array, f) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n result.push(f(array[i], i, array, result));\n }\n return result;\n}\nfunction mapObject(object, f) {\n var result = {};\n objectApply(object, function (value, key) {\n result[key] = f(value);\n });\n return result;\n}\nfunction filter(array, test) {\n test =\n test ||\n function (value) {\n return !!value;\n };\n var result = [];\n for (var i = 0; i < array.length; i++) {\n if (test(array[i], i, array, result)) {\n result.push(array[i]);\n }\n }\n return result;\n}\nfunction filterObject(object, test) {\n var result = {};\n objectApply(object, function (value, key) {\n if ((test && test(value, key, object, result)) || Boolean(value)) {\n result[key] = value;\n }\n });\n return result;\n}\nfunction flatten(object) {\n var result = [];\n objectApply(object, function (value, key) {\n result.push([key, value]);\n });\n return result;\n}\nfunction any(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (test(array[i], i, array)) {\n return true;\n }\n }\n return false;\n}\nfunction collections_all(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (!test(array[i], i, array)) {\n return false;\n }\n }\n return true;\n}\nfunction encodeParamsObject(data) {\n return mapObject(data, function (value) {\n if (typeof value === 'object') {\n value = safeJSONStringify(value);\n }\n return encodeURIComponent(encode(value.toString()));\n });\n}\nfunction buildQueryString(data) {\n var params = filterObject(data, function (value) {\n return value !== undefined;\n });\n var query = map(flatten(encodeParamsObject(params)), util.method('join', '=')).join('&');\n return query;\n}\nfunction decycleObject(object) {\n var objects = [], paths = [];\n return (function derez(value, path) {\n var i, name, nu;\n switch (typeof value) {\n case 'object':\n if (!value) {\n return null;\n }\n for (i = 0; i < objects.length; i += 1) {\n if (objects[i] === value) {\n return { $ref: paths[i] };\n }\n }\n objects.push(value);\n paths.push(path);\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n nu = [];\n for (i = 0; i < value.length; i += 1) {\n nu[i] = derez(value[i], path + '[' + i + ']');\n }\n }\n else {\n nu = {};\n for (name in value) {\n if (Object.prototype.hasOwnProperty.call(value, name)) {\n nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');\n }\n }\n }\n return nu;\n case 'number':\n case 'string':\n case 'boolean':\n return value;\n }\n })(object, '$');\n}\nfunction safeJSONStringify(source) {\n try {\n return JSON.stringify(source);\n }\n catch (e) {\n return JSON.stringify(decycleObject(source));\n }\n}\n\n// CONCATENATED MODULE: ./src/core/logger.ts\n\n\nvar logger_Logger = (function () {\n function Logger() {\n this.globalLog = function (message) {\n if (window.console && window.console.log) {\n window.console.log(message);\n }\n };\n }\n Logger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLog, args);\n };\n Logger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLogWarn, args);\n };\n Logger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLogError, args);\n };\n Logger.prototype.globalLogWarn = function (message) {\n if (window.console && window.console.warn) {\n window.console.warn(message);\n }\n else {\n this.globalLog(message);\n }\n };\n Logger.prototype.globalLogError = function (message) {\n if (window.console && window.console.error) {\n window.console.error(message);\n }\n else {\n this.globalLogWarn(message);\n }\n };\n Logger.prototype.log = function (defaultLoggingFunction) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var message = stringify.apply(this, arguments);\n if (core_pusher.log) {\n core_pusher.log(message);\n }\n else if (core_pusher.logToConsole) {\n var log = defaultLoggingFunction.bind(this);\n log(message);\n }\n };\n return Logger;\n}());\n/* harmony default export */ var logger = (new logger_Logger());\n\n// CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts\n\nvar jsonp = function (context, socketId, callback) {\n if (this.authOptions.headers !== undefined) {\n logger.warn('To send headers with the auth request, you must use AJAX, rather than JSONP.');\n }\n var callbackName = context.nextAuthCallbackID.toString();\n context.nextAuthCallbackID++;\n var document = context.getDocument();\n var script = document.createElement('script');\n context.auth_callbacks[callbackName] = function (data) {\n callback(null, data);\n };\n var callback_name = \"Pusher.auth_callbacks['\" + callbackName + \"']\";\n script.src =\n this.options.authEndpoint +\n '?callback=' +\n encodeURIComponent(callback_name) +\n '&' +\n this.composeQuery(socketId);\n var head = document.getElementsByTagName('head')[0] || document.documentElement;\n head.insertBefore(script, head.firstChild);\n};\n/* harmony default export */ var jsonp_auth = (jsonp);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts\nvar ScriptRequest = (function () {\n function ScriptRequest(src) {\n this.src = src;\n }\n ScriptRequest.prototype.send = function (receiver) {\n var self = this;\n var errorString = 'Error loading ' + self.src;\n self.script = document.createElement('script');\n self.script.id = receiver.id;\n self.script.src = self.src;\n self.script.type = 'text/javascript';\n self.script.charset = 'UTF-8';\n if (self.script.addEventListener) {\n self.script.onerror = function () {\n receiver.callback(errorString);\n };\n self.script.onload = function () {\n receiver.callback(null);\n };\n }\n else {\n self.script.onreadystatechange = function () {\n if (self.script.readyState === 'loaded' ||\n self.script.readyState === 'complete') {\n receiver.callback(null);\n }\n };\n }\n if (self.script.async === undefined &&\n document.attachEvent &&\n /opera/i.test(navigator.userAgent)) {\n self.errorScript = document.createElement('script');\n self.errorScript.id = receiver.id + '_error';\n self.errorScript.text = receiver.name + \"('\" + errorString + \"');\";\n self.script.async = self.errorScript.async = false;\n }\n else {\n self.script.async = true;\n }\n var head = document.getElementsByTagName('head')[0];\n head.insertBefore(self.script, head.firstChild);\n if (self.errorScript) {\n head.insertBefore(self.errorScript, self.script.nextSibling);\n }\n };\n ScriptRequest.prototype.cleanup = function () {\n if (this.script) {\n this.script.onload = this.script.onerror = null;\n this.script.onreadystatechange = null;\n }\n if (this.script && this.script.parentNode) {\n this.script.parentNode.removeChild(this.script);\n }\n if (this.errorScript && this.errorScript.parentNode) {\n this.errorScript.parentNode.removeChild(this.errorScript);\n }\n this.script = null;\n this.errorScript = null;\n };\n return ScriptRequest;\n}());\n/* harmony default export */ var script_request = (ScriptRequest);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts\n\n\nvar jsonp_request_JSONPRequest = (function () {\n function JSONPRequest(url, data) {\n this.url = url;\n this.data = data;\n }\n JSONPRequest.prototype.send = function (receiver) {\n if (this.request) {\n return;\n }\n var query = buildQueryString(this.data);\n var url = this.url + '/' + receiver.number + '?' + query;\n this.request = runtime.createScriptRequest(url);\n this.request.send(receiver);\n };\n JSONPRequest.prototype.cleanup = function () {\n if (this.request) {\n this.request.cleanup();\n }\n };\n return JSONPRequest;\n}());\n/* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest);\n\n// CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts\n\n\nvar getAgent = function (sender, useTLS) {\n return function (data, callback) {\n var scheme = 'http' + (useTLS ? 's' : '') + '://';\n var url = scheme + (sender.host || sender.options.host) + sender.options.path;\n var request = runtime.createJSONPRequest(url, data);\n var receiver = runtime.ScriptReceivers.create(function (error, result) {\n ScriptReceivers.remove(receiver);\n request.cleanup();\n if (result && result.host) {\n sender.host = result.host;\n }\n if (callback) {\n callback(error, result);\n }\n });\n request.send(receiver);\n };\n};\nvar jsonp_timeline_jsonp = {\n name: 'jsonp',\n getAgent: getAgent\n};\n/* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp);\n\n// CONCATENATED MODULE: ./src/core/transports/url_schemes.ts\n\nfunction getGenericURL(baseScheme, params, path) {\n var scheme = baseScheme + (params.useTLS ? 's' : '');\n var host = params.useTLS ? params.hostTLS : params.hostNonTLS;\n return scheme + '://' + host + path;\n}\nfunction getGenericPath(key, queryString) {\n var path = '/app/' + key;\n var query = '?protocol=' +\n defaults.PROTOCOL +\n '&client=js' +\n '&version=' +\n defaults.VERSION +\n (queryString ? '&' + queryString : '');\n return path + query;\n}\nvar ws = {\n getInitial: function (key, params) {\n var path = (params.httpPath || '') + getGenericPath(key, 'flash=false');\n return getGenericURL('ws', params, path);\n }\n};\nvar http = {\n getInitial: function (key, params) {\n var path = (params.httpPath || '/pusher') + getGenericPath(key);\n return getGenericURL('http', params, path);\n }\n};\nvar sockjs = {\n getInitial: function (key, params) {\n return getGenericURL('http', params, params.httpPath || '/pusher');\n },\n getPath: function (key, params) {\n return getGenericPath(key);\n }\n};\n\n// CONCATENATED MODULE: ./src/core/events/callback_registry.ts\n\nvar callback_registry_CallbackRegistry = (function () {\n function CallbackRegistry() {\n this._callbacks = {};\n }\n CallbackRegistry.prototype.get = function (name) {\n return this._callbacks[prefix(name)];\n };\n CallbackRegistry.prototype.add = function (name, callback, context) {\n var prefixedEventName = prefix(name);\n this._callbacks[prefixedEventName] =\n this._callbacks[prefixedEventName] || [];\n this._callbacks[prefixedEventName].push({\n fn: callback,\n context: context\n });\n };\n CallbackRegistry.prototype.remove = function (name, callback, context) {\n if (!name && !callback && !context) {\n this._callbacks = {};\n return;\n }\n var names = name ? [prefix(name)] : keys(this._callbacks);\n if (callback || context) {\n this.removeCallback(names, callback, context);\n }\n else {\n this.removeAllCallbacks(names);\n }\n };\n CallbackRegistry.prototype.removeCallback = function (names, callback, context) {\n apply(names, function (name) {\n this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) {\n return ((callback && callback !== binding.fn) ||\n (context && context !== binding.context));\n });\n if (this._callbacks[name].length === 0) {\n delete this._callbacks[name];\n }\n }, this);\n };\n CallbackRegistry.prototype.removeAllCallbacks = function (names) {\n apply(names, function (name) {\n delete this._callbacks[name];\n }, this);\n };\n return CallbackRegistry;\n}());\n/* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry);\nfunction prefix(name) {\n return '_' + name;\n}\n\n// CONCATENATED MODULE: ./src/core/events/dispatcher.ts\n\n\nvar dispatcher_Dispatcher = (function () {\n function Dispatcher(failThrough) {\n this.callbacks = new callback_registry();\n this.global_callbacks = [];\n this.failThrough = failThrough;\n }\n Dispatcher.prototype.bind = function (eventName, callback, context) {\n this.callbacks.add(eventName, callback, context);\n return this;\n };\n Dispatcher.prototype.bind_global = function (callback) {\n this.global_callbacks.push(callback);\n return this;\n };\n Dispatcher.prototype.unbind = function (eventName, callback, context) {\n this.callbacks.remove(eventName, callback, context);\n return this;\n };\n Dispatcher.prototype.unbind_global = function (callback) {\n if (!callback) {\n this.global_callbacks = [];\n return this;\n }\n this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; });\n return this;\n };\n Dispatcher.prototype.unbind_all = function () {\n this.unbind();\n this.unbind_global();\n return this;\n };\n Dispatcher.prototype.emit = function (eventName, data, metadata) {\n for (var i = 0; i < this.global_callbacks.length; i++) {\n this.global_callbacks[i](eventName, data);\n }\n var callbacks = this.callbacks.get(eventName);\n var args = [];\n if (metadata) {\n args.push(data, metadata);\n }\n else if (data) {\n args.push(data);\n }\n if (callbacks && callbacks.length > 0) {\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i].fn.apply(callbacks[i].context || window, args);\n }\n }\n else if (this.failThrough) {\n this.failThrough(eventName, data);\n }\n return this;\n };\n return Dispatcher;\n}());\n/* harmony default export */ var dispatcher = (dispatcher_Dispatcher);\n\n// CONCATENATED MODULE: ./src/core/transports/transport_connection.ts\nvar transport_connection_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar transport_connection_TransportConnection = (function (_super) {\n transport_connection_extends(TransportConnection, _super);\n function TransportConnection(hooks, name, priority, key, options) {\n var _this = _super.call(this) || this;\n _this.initialize = runtime.transportConnectionInitializer;\n _this.hooks = hooks;\n _this.name = name;\n _this.priority = priority;\n _this.key = key;\n _this.options = options;\n _this.state = 'new';\n _this.timeline = options.timeline;\n _this.activityTimeout = options.activityTimeout;\n _this.id = _this.timeline.generateUniqueID();\n return _this;\n }\n TransportConnection.prototype.handlesActivityChecks = function () {\n return Boolean(this.hooks.handlesActivityChecks);\n };\n TransportConnection.prototype.supportsPing = function () {\n return Boolean(this.hooks.supportsPing);\n };\n TransportConnection.prototype.connect = function () {\n var _this = this;\n if (this.socket || this.state !== 'initialized') {\n return false;\n }\n var url = this.hooks.urls.getInitial(this.key, this.options);\n try {\n this.socket = this.hooks.getSocket(url, this.options);\n }\n catch (e) {\n util.defer(function () {\n _this.onError(e);\n _this.changeState('closed');\n });\n return false;\n }\n this.bindListeners();\n logger.debug('Connecting', { transport: this.name, url: url });\n this.changeState('connecting');\n return true;\n };\n TransportConnection.prototype.close = function () {\n if (this.socket) {\n this.socket.close();\n return true;\n }\n else {\n return false;\n }\n };\n TransportConnection.prototype.send = function (data) {\n var _this = this;\n if (this.state === 'open') {\n util.defer(function () {\n if (_this.socket) {\n _this.socket.send(data);\n }\n });\n return true;\n }\n else {\n return false;\n }\n };\n TransportConnection.prototype.ping = function () {\n if (this.state === 'open' && this.supportsPing()) {\n this.socket.ping();\n }\n };\n TransportConnection.prototype.onOpen = function () {\n if (this.hooks.beforeOpen) {\n this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options));\n }\n this.changeState('open');\n this.socket.onopen = undefined;\n };\n TransportConnection.prototype.onError = function (error) {\n this.emit('error', { type: 'WebSocketError', error: error });\n this.timeline.error(this.buildTimelineMessage({ error: error.toString() }));\n };\n TransportConnection.prototype.onClose = function (closeEvent) {\n if (closeEvent) {\n this.changeState('closed', {\n code: closeEvent.code,\n reason: closeEvent.reason,\n wasClean: closeEvent.wasClean\n });\n }\n else {\n this.changeState('closed');\n }\n this.unbindListeners();\n this.socket = undefined;\n };\n TransportConnection.prototype.onMessage = function (message) {\n this.emit('message', message);\n };\n TransportConnection.prototype.onActivity = function () {\n this.emit('activity');\n };\n TransportConnection.prototype.bindListeners = function () {\n var _this = this;\n this.socket.onopen = function () {\n _this.onOpen();\n };\n this.socket.onerror = function (error) {\n _this.onError(error);\n };\n this.socket.onclose = function (closeEvent) {\n _this.onClose(closeEvent);\n };\n this.socket.onmessage = function (message) {\n _this.onMessage(message);\n };\n if (this.supportsPing()) {\n this.socket.onactivity = function () {\n _this.onActivity();\n };\n }\n };\n TransportConnection.prototype.unbindListeners = function () {\n if (this.socket) {\n this.socket.onopen = undefined;\n this.socket.onerror = undefined;\n this.socket.onclose = undefined;\n this.socket.onmessage = undefined;\n if (this.supportsPing()) {\n this.socket.onactivity = undefined;\n }\n }\n };\n TransportConnection.prototype.changeState = function (state, params) {\n this.state = state;\n this.timeline.info(this.buildTimelineMessage({\n state: state,\n params: params\n }));\n this.emit(state, params);\n };\n TransportConnection.prototype.buildTimelineMessage = function (message) {\n return extend({ cid: this.id }, message);\n };\n return TransportConnection;\n}(dispatcher));\n/* harmony default export */ var transport_connection = (transport_connection_TransportConnection);\n\n// CONCATENATED MODULE: ./src/core/transports/transport.ts\n\nvar transport_Transport = (function () {\n function Transport(hooks) {\n this.hooks = hooks;\n }\n Transport.prototype.isSupported = function (environment) {\n return this.hooks.isSupported(environment);\n };\n Transport.prototype.createConnection = function (name, priority, key, options) {\n return new transport_connection(this.hooks, name, priority, key, options);\n };\n return Transport;\n}());\n/* harmony default export */ var transports_transport = (transport_Transport);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts\n\n\n\n\nvar WSTransport = new transports_transport({\n urls: ws,\n handlesActivityChecks: false,\n supportsPing: false,\n isInitialized: function () {\n return Boolean(runtime.getWebSocketAPI());\n },\n isSupported: function () {\n return Boolean(runtime.getWebSocketAPI());\n },\n getSocket: function (url) {\n return runtime.createWebSocket(url);\n }\n});\nvar httpConfiguration = {\n urls: http,\n handlesActivityChecks: false,\n supportsPing: true,\n isInitialized: function () {\n return true;\n }\n};\nvar streamingConfiguration = extend({\n getSocket: function (url) {\n return runtime.HTTPFactory.createStreamingSocket(url);\n }\n}, httpConfiguration);\nvar pollingConfiguration = extend({\n getSocket: function (url) {\n return runtime.HTTPFactory.createPollingSocket(url);\n }\n}, httpConfiguration);\nvar xhrConfiguration = {\n isSupported: function () {\n return runtime.isXHRSupported();\n }\n};\nvar XHRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xhrConfiguration)));\nvar XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration));\nvar Transports = {\n ws: WSTransport,\n xhr_streaming: XHRStreamingTransport,\n xhr_polling: XHRPollingTransport\n};\n/* harmony default export */ var transports = (Transports);\n\n// CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts\n\n\n\n\n\n\nvar SockJSTransport = new transports_transport({\n file: 'sockjs',\n urls: sockjs,\n handlesActivityChecks: true,\n supportsPing: false,\n isSupported: function () {\n return true;\n },\n isInitialized: function () {\n return window.SockJS !== undefined;\n },\n getSocket: function (url, options) {\n return new window.SockJS(url, null, {\n js_path: Dependencies.getPath('sockjs', {\n useTLS: options.useTLS\n }),\n ignore_null_origin: options.ignoreNullOrigin\n });\n },\n beforeOpen: function (socket, path) {\n socket.send(JSON.stringify({\n path: path\n }));\n }\n});\nvar xdrConfiguration = {\n isSupported: function (environment) {\n var yes = runtime.isXDRSupported(environment.useTLS);\n return yes;\n }\n};\nvar XDRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xdrConfiguration)));\nvar XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration));\ntransports.xdr_streaming = XDRStreamingTransport;\ntransports.xdr_polling = XDRPollingTransport;\ntransports.sockjs = SockJSTransport;\n/* harmony default export */ var transports_transports = (transports);\n\n// CONCATENATED MODULE: ./src/runtimes/web/net_info.ts\nvar net_info_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar NetInfo = (function (_super) {\n net_info_extends(NetInfo, _super);\n function NetInfo() {\n var _this = _super.call(this) || this;\n var self = _this;\n if (window.addEventListener !== undefined) {\n window.addEventListener('online', function () {\n self.emit('online');\n }, false);\n window.addEventListener('offline', function () {\n self.emit('offline');\n }, false);\n }\n return _this;\n }\n NetInfo.prototype.isOnline = function () {\n if (window.navigator.onLine === undefined) {\n return true;\n }\n else {\n return window.navigator.onLine;\n }\n };\n return NetInfo;\n}(dispatcher));\n\nvar net_info_Network = new NetInfo();\n\n// CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts\n\n\nvar assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () {\n function AssistantToTheTransportManager(manager, transport, options) {\n this.manager = manager;\n this.transport = transport;\n this.minPingDelay = options.minPingDelay;\n this.maxPingDelay = options.maxPingDelay;\n this.pingDelay = undefined;\n }\n AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) {\n var _this = this;\n options = extend({}, options, {\n activityTimeout: this.pingDelay\n });\n var connection = this.transport.createConnection(name, priority, key, options);\n var openTimestamp = null;\n var onOpen = function () {\n connection.unbind('open', onOpen);\n connection.bind('closed', onClosed);\n openTimestamp = util.now();\n };\n var onClosed = function (closeEvent) {\n connection.unbind('closed', onClosed);\n if (closeEvent.code === 1002 || closeEvent.code === 1003) {\n _this.manager.reportDeath();\n }\n else if (!closeEvent.wasClean && openTimestamp) {\n var lifespan = util.now() - openTimestamp;\n if (lifespan < 2 * _this.maxPingDelay) {\n _this.manager.reportDeath();\n _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay);\n }\n }\n };\n connection.bind('open', onOpen);\n return connection;\n };\n AssistantToTheTransportManager.prototype.isSupported = function (environment) {\n return this.manager.isAlive() && this.transport.isSupported(environment);\n };\n return AssistantToTheTransportManager;\n}());\n/* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager);\n\n// CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts\nvar Protocol = {\n decodeMessage: function (messageEvent) {\n try {\n var messageData = JSON.parse(messageEvent.data);\n var pusherEventData = messageData.data;\n if (typeof pusherEventData === 'string') {\n try {\n pusherEventData = JSON.parse(messageData.data);\n }\n catch (e) { }\n }\n var pusherEvent = {\n event: messageData.event,\n channel: messageData.channel,\n data: pusherEventData\n };\n if (messageData.user_id) {\n pusherEvent.user_id = messageData.user_id;\n }\n return pusherEvent;\n }\n catch (e) {\n throw { type: 'MessageParseError', error: e, data: messageEvent.data };\n }\n },\n encodeMessage: function (event) {\n return JSON.stringify(event);\n },\n processHandshake: function (messageEvent) {\n var message = Protocol.decodeMessage(messageEvent);\n if (message.event === 'pusher:connection_established') {\n if (!message.data.activity_timeout) {\n throw 'No activity timeout specified in handshake';\n }\n return {\n action: 'connected',\n id: message.data.socket_id,\n activityTimeout: message.data.activity_timeout * 1000\n };\n }\n else if (message.event === 'pusher:error') {\n return {\n action: this.getCloseAction(message.data),\n error: this.getCloseError(message.data)\n };\n }\n else {\n throw 'Invalid handshake';\n }\n },\n getCloseAction: function (closeEvent) {\n if (closeEvent.code < 4000) {\n if (closeEvent.code >= 1002 && closeEvent.code <= 1004) {\n return 'backoff';\n }\n else {\n return null;\n }\n }\n else if (closeEvent.code === 4000) {\n return 'tls_only';\n }\n else if (closeEvent.code < 4100) {\n return 'refused';\n }\n else if (closeEvent.code < 4200) {\n return 'backoff';\n }\n else if (closeEvent.code < 4300) {\n return 'retry';\n }\n else {\n return 'refused';\n }\n },\n getCloseError: function (closeEvent) {\n if (closeEvent.code !== 1000 && closeEvent.code !== 1001) {\n return {\n type: 'PusherError',\n data: {\n code: closeEvent.code,\n message: closeEvent.reason || closeEvent.message\n }\n };\n }\n else {\n return null;\n }\n }\n};\n/* harmony default export */ var protocol_protocol = (Protocol);\n\n// CONCATENATED MODULE: ./src/core/connection/connection.ts\nvar connection_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\nvar connection_Connection = (function (_super) {\n connection_extends(Connection, _super);\n function Connection(id, transport) {\n var _this = _super.call(this) || this;\n _this.id = id;\n _this.transport = transport;\n _this.activityTimeout = transport.activityTimeout;\n _this.bindListeners();\n return _this;\n }\n Connection.prototype.handlesActivityChecks = function () {\n return this.transport.handlesActivityChecks();\n };\n Connection.prototype.send = function (data) {\n return this.transport.send(data);\n };\n Connection.prototype.send_event = function (name, data, channel) {\n var event = { event: name, data: data };\n if (channel) {\n event.channel = channel;\n }\n logger.debug('Event sent', event);\n return this.send(protocol_protocol.encodeMessage(event));\n };\n Connection.prototype.ping = function () {\n if (this.transport.supportsPing()) {\n this.transport.ping();\n }\n else {\n this.send_event('pusher:ping', {});\n }\n };\n Connection.prototype.close = function () {\n this.transport.close();\n };\n Connection.prototype.bindListeners = function () {\n var _this = this;\n var listeners = {\n message: function (messageEvent) {\n var pusherEvent;\n try {\n pusherEvent = protocol_protocol.decodeMessage(messageEvent);\n }\n catch (e) {\n _this.emit('error', {\n type: 'MessageParseError',\n error: e,\n data: messageEvent.data\n });\n }\n if (pusherEvent !== undefined) {\n logger.debug('Event recd', pusherEvent);\n switch (pusherEvent.event) {\n case 'pusher:error':\n _this.emit('error', {\n type: 'PusherError',\n data: pusherEvent.data\n });\n break;\n case 'pusher:ping':\n _this.emit('ping');\n break;\n case 'pusher:pong':\n _this.emit('pong');\n break;\n }\n _this.emit('message', pusherEvent);\n }\n },\n activity: function () {\n _this.emit('activity');\n },\n error: function (error) {\n _this.emit('error', error);\n },\n closed: function (closeEvent) {\n unbindListeners();\n if (closeEvent && closeEvent.code) {\n _this.handleCloseEvent(closeEvent);\n }\n _this.transport = null;\n _this.emit('closed');\n }\n };\n var unbindListeners = function () {\n objectApply(listeners, function (listener, event) {\n _this.transport.unbind(event, listener);\n });\n };\n objectApply(listeners, function (listener, event) {\n _this.transport.bind(event, listener);\n });\n };\n Connection.prototype.handleCloseEvent = function (closeEvent) {\n var action = protocol_protocol.getCloseAction(closeEvent);\n var error = protocol_protocol.getCloseError(closeEvent);\n if (error) {\n this.emit('error', error);\n }\n if (action) {\n this.emit(action, { action: action, error: error });\n }\n };\n return Connection;\n}(dispatcher));\n/* harmony default export */ var connection_connection = (connection_Connection);\n\n// CONCATENATED MODULE: ./src/core/connection/handshake/index.ts\n\n\n\nvar handshake_Handshake = (function () {\n function Handshake(transport, callback) {\n this.transport = transport;\n this.callback = callback;\n this.bindListeners();\n }\n Handshake.prototype.close = function () {\n this.unbindListeners();\n this.transport.close();\n };\n Handshake.prototype.bindListeners = function () {\n var _this = this;\n this.onMessage = function (m) {\n _this.unbindListeners();\n var result;\n try {\n result = protocol_protocol.processHandshake(m);\n }\n catch (e) {\n _this.finish('error', { error: e });\n _this.transport.close();\n return;\n }\n if (result.action === 'connected') {\n _this.finish('connected', {\n connection: new connection_connection(result.id, _this.transport),\n activityTimeout: result.activityTimeout\n });\n }\n else {\n _this.finish(result.action, { error: result.error });\n _this.transport.close();\n }\n };\n this.onClosed = function (closeEvent) {\n _this.unbindListeners();\n var action = protocol_protocol.getCloseAction(closeEvent) || 'backoff';\n var error = protocol_protocol.getCloseError(closeEvent);\n _this.finish(action, { error: error });\n };\n this.transport.bind('message', this.onMessage);\n this.transport.bind('closed', this.onClosed);\n };\n Handshake.prototype.unbindListeners = function () {\n this.transport.unbind('message', this.onMessage);\n this.transport.unbind('closed', this.onClosed);\n };\n Handshake.prototype.finish = function (action, params) {\n this.callback(extend({ transport: this.transport, action: action }, params));\n };\n return Handshake;\n}());\n/* harmony default export */ var connection_handshake = (handshake_Handshake);\n\n// CONCATENATED MODULE: ./src/core/auth/pusher_authorizer.ts\n\nvar pusher_authorizer_PusherAuthorizer = (function () {\n function PusherAuthorizer(channel, options) {\n this.channel = channel;\n var authTransport = options.authTransport;\n if (typeof runtime.getAuthorizers()[authTransport] === 'undefined') {\n throw \"'\" + authTransport + \"' is not a recognized auth transport\";\n }\n this.type = authTransport;\n this.options = options;\n this.authOptions = options.auth || {};\n }\n PusherAuthorizer.prototype.composeQuery = function (socketId) {\n var query = 'socket_id=' +\n encodeURIComponent(socketId) +\n '&channel_name=' +\n encodeURIComponent(this.channel.name);\n for (var i in this.authOptions.params) {\n query +=\n '&' +\n encodeURIComponent(i) +\n '=' +\n encodeURIComponent(this.authOptions.params[i]);\n }\n return query;\n };\n PusherAuthorizer.prototype.authorize = function (socketId, callback) {\n PusherAuthorizer.authorizers =\n PusherAuthorizer.authorizers || runtime.getAuthorizers();\n PusherAuthorizer.authorizers[this.type].call(this, runtime, socketId, callback);\n };\n return PusherAuthorizer;\n}());\n/* harmony default export */ var pusher_authorizer = (pusher_authorizer_PusherAuthorizer);\n\n// CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts\n\nvar timeline_sender_TimelineSender = (function () {\n function TimelineSender(timeline, options) {\n this.timeline = timeline;\n this.options = options || {};\n }\n TimelineSender.prototype.send = function (useTLS, callback) {\n if (this.timeline.isEmpty()) {\n return;\n }\n this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback);\n };\n return TimelineSender;\n}());\n/* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender);\n\n// CONCATENATED MODULE: ./src/core/channels/channel.ts\nvar channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar channel_Channel = (function (_super) {\n channel_extends(Channel, _super);\n function Channel(name, pusher) {\n var _this = _super.call(this, function (event, data) {\n logger.debug('No callbacks on ' + name + ' for ' + event);\n }) || this;\n _this.name = name;\n _this.pusher = pusher;\n _this.subscribed = false;\n _this.subscriptionPending = false;\n _this.subscriptionCancelled = false;\n return _this;\n }\n Channel.prototype.authorize = function (socketId, callback) {\n return callback(null, { auth: '' });\n };\n Channel.prototype.trigger = function (event, data) {\n if (event.indexOf('client-') !== 0) {\n throw new BadEventName(\"Event '\" + event + \"' does not start with 'client-'\");\n }\n if (!this.subscribed) {\n var suffix = url_store.buildLogSuffix('triggeringClientEvents');\n logger.warn(\"Client event triggered before channel 'subscription_succeeded' event . \" + suffix);\n }\n return this.pusher.send_event(event, data, this.name);\n };\n Channel.prototype.disconnect = function () {\n this.subscribed = false;\n this.subscriptionPending = false;\n };\n Channel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n if (eventName === 'pusher_internal:subscription_succeeded') {\n this.handleSubscriptionSucceededEvent(event);\n }\n else if (eventName.indexOf('pusher_internal:') !== 0) {\n var metadata = {};\n this.emit(eventName, data, metadata);\n }\n };\n Channel.prototype.handleSubscriptionSucceededEvent = function (event) {\n this.subscriptionPending = false;\n this.subscribed = true;\n if (this.subscriptionCancelled) {\n this.pusher.unsubscribe(this.name);\n }\n else {\n this.emit('pusher:subscription_succeeded', event.data);\n }\n };\n Channel.prototype.subscribe = function () {\n var _this = this;\n if (this.subscribed) {\n return;\n }\n this.subscriptionPending = true;\n this.subscriptionCancelled = false;\n this.authorize(this.pusher.connection.socket_id, function (error, data) {\n if (error) {\n _this.subscriptionPending = false;\n logger.error(error.toString());\n _this.emit('pusher:subscription_error', Object.assign({}, {\n type: 'AuthError',\n error: error.message\n }, error instanceof HTTPAuthError ? { status: error.status } : {}));\n }\n else {\n _this.pusher.send_event('pusher:subscribe', {\n auth: data.auth,\n channel_data: data.channel_data,\n channel: _this.name\n });\n }\n });\n };\n Channel.prototype.unsubscribe = function () {\n this.subscribed = false;\n this.pusher.send_event('pusher:unsubscribe', {\n channel: this.name\n });\n };\n Channel.prototype.cancelSubscription = function () {\n this.subscriptionCancelled = true;\n };\n Channel.prototype.reinstateSubscription = function () {\n this.subscriptionCancelled = false;\n };\n return Channel;\n}(dispatcher));\n/* harmony default export */ var channels_channel = (channel_Channel);\n\n// CONCATENATED MODULE: ./src/core/channels/private_channel.ts\nvar private_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar private_channel_PrivateChannel = (function (_super) {\n private_channel_extends(PrivateChannel, _super);\n function PrivateChannel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PrivateChannel.prototype.authorize = function (socketId, callback) {\n var authorizer = factory.createAuthorizer(this, this.pusher.config);\n return authorizer.authorize(socketId, callback);\n };\n return PrivateChannel;\n}(channels_channel));\n/* harmony default export */ var private_channel = (private_channel_PrivateChannel);\n\n// CONCATENATED MODULE: ./src/core/channels/members.ts\n\nvar members_Members = (function () {\n function Members() {\n this.reset();\n }\n Members.prototype.get = function (id) {\n if (Object.prototype.hasOwnProperty.call(this.members, id)) {\n return {\n id: id,\n info: this.members[id]\n };\n }\n else {\n return null;\n }\n };\n Members.prototype.each = function (callback) {\n var _this = this;\n objectApply(this.members, function (member, id) {\n callback(_this.get(id));\n });\n };\n Members.prototype.setMyID = function (id) {\n this.myID = id;\n };\n Members.prototype.onSubscription = function (subscriptionData) {\n this.members = subscriptionData.presence.hash;\n this.count = subscriptionData.presence.count;\n this.me = this.get(this.myID);\n };\n Members.prototype.addMember = function (memberData) {\n if (this.get(memberData.user_id) === null) {\n this.count++;\n }\n this.members[memberData.user_id] = memberData.user_info;\n return this.get(memberData.user_id);\n };\n Members.prototype.removeMember = function (memberData) {\n var member = this.get(memberData.user_id);\n if (member) {\n delete this.members[memberData.user_id];\n this.count--;\n }\n return member;\n };\n Members.prototype.reset = function () {\n this.members = {};\n this.count = 0;\n this.myID = null;\n this.me = null;\n };\n return Members;\n}());\n/* harmony default export */ var members = (members_Members);\n\n// CONCATENATED MODULE: ./src/core/channels/presence_channel.ts\nvar presence_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\nvar presence_channel_PresenceChannel = (function (_super) {\n presence_channel_extends(PresenceChannel, _super);\n function PresenceChannel(name, pusher) {\n var _this = _super.call(this, name, pusher) || this;\n _this.members = new members();\n return _this;\n }\n PresenceChannel.prototype.authorize = function (socketId, callback) {\n var _this = this;\n _super.prototype.authorize.call(this, socketId, function (error, authData) {\n if (!error) {\n authData = authData;\n if (authData.channel_data === undefined) {\n var suffix = url_store.buildLogSuffix('authenticationEndpoint');\n logger.error(\"Invalid auth response for channel '\" + _this.name + \"',\" +\n (\"expected 'channel_data' field. \" + suffix));\n callback('Invalid auth response');\n return;\n }\n var channelData = JSON.parse(authData.channel_data);\n _this.members.setMyID(channelData.user_id);\n }\n callback(error, authData);\n });\n };\n PresenceChannel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n if (eventName.indexOf('pusher_internal:') === 0) {\n this.handleInternalEvent(event);\n }\n else {\n var data = event.data;\n var metadata = {};\n if (event.user_id) {\n metadata.user_id = event.user_id;\n }\n this.emit(eventName, data, metadata);\n }\n };\n PresenceChannel.prototype.handleInternalEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n switch (eventName) {\n case 'pusher_internal:subscription_succeeded':\n this.handleSubscriptionSucceededEvent(event);\n break;\n case 'pusher_internal:member_added':\n var addedMember = this.members.addMember(data);\n this.emit('pusher:member_added', addedMember);\n break;\n case 'pusher_internal:member_removed':\n var removedMember = this.members.removeMember(data);\n if (removedMember) {\n this.emit('pusher:member_removed', removedMember);\n }\n break;\n }\n };\n PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) {\n this.subscriptionPending = false;\n this.subscribed = true;\n if (this.subscriptionCancelled) {\n this.pusher.unsubscribe(this.name);\n }\n else {\n this.members.onSubscription(event.data);\n this.emit('pusher:subscription_succeeded', this.members);\n }\n };\n PresenceChannel.prototype.disconnect = function () {\n this.members.reset();\n _super.prototype.disconnect.call(this);\n };\n return PresenceChannel;\n}(private_channel));\n/* harmony default export */ var presence_channel = (presence_channel_PresenceChannel);\n\n// EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js\nvar utf8 = __webpack_require__(1);\n\n// EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js\nvar base64 = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts\nvar encrypted_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar encrypted_channel_EncryptedChannel = (function (_super) {\n encrypted_channel_extends(EncryptedChannel, _super);\n function EncryptedChannel(name, pusher, nacl) {\n var _this = _super.call(this, name, pusher) || this;\n _this.key = null;\n _this.nacl = nacl;\n return _this;\n }\n EncryptedChannel.prototype.authorize = function (socketId, callback) {\n var _this = this;\n _super.prototype.authorize.call(this, socketId, function (error, authData) {\n if (error) {\n callback(error, authData);\n return;\n }\n var sharedSecret = authData['shared_secret'];\n if (!sharedSecret) {\n callback(new Error(\"No shared_secret key in auth payload for encrypted channel: \" + _this.name), null);\n return;\n }\n _this.key = Object(base64[\"decode\"])(sharedSecret);\n delete authData['shared_secret'];\n callback(null, authData);\n });\n };\n EncryptedChannel.prototype.trigger = function (event, data) {\n throw new UnsupportedFeature('Client events are not currently supported for encrypted channels');\n };\n EncryptedChannel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n if (eventName.indexOf('pusher_internal:') === 0 ||\n eventName.indexOf('pusher:') === 0) {\n _super.prototype.handleEvent.call(this, event);\n return;\n }\n this.handleEncryptedEvent(eventName, data);\n };\n EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) {\n var _this = this;\n if (!this.key) {\n logger.debug('Received encrypted event before key has been retrieved from the authEndpoint');\n return;\n }\n if (!data.ciphertext || !data.nonce) {\n logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' +\n data);\n return;\n }\n var cipherText = Object(base64[\"decode\"])(data.ciphertext);\n if (cipherText.length < this.nacl.secretbox.overheadLength) {\n logger.error(\"Expected encrypted event ciphertext length to be \" + this.nacl.secretbox.overheadLength + \", got: \" + cipherText.length);\n return;\n }\n var nonce = Object(base64[\"decode\"])(data.nonce);\n if (nonce.length < this.nacl.secretbox.nonceLength) {\n logger.error(\"Expected encrypted event nonce length to be \" + this.nacl.secretbox.nonceLength + \", got: \" + nonce.length);\n return;\n }\n var bytes = this.nacl.secretbox.open(cipherText, nonce, this.key);\n if (bytes === null) {\n logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...');\n this.authorize(this.pusher.connection.socket_id, function (error, authData) {\n if (error) {\n logger.error(\"Failed to make a request to the authEndpoint: \" + authData + \". Unable to fetch new key, so dropping encrypted event\");\n return;\n }\n bytes = _this.nacl.secretbox.open(cipherText, nonce, _this.key);\n if (bytes === null) {\n logger.error(\"Failed to decrypt event with new key. Dropping encrypted event\");\n return;\n }\n _this.emit(event, _this.getDataToEmit(bytes));\n return;\n });\n return;\n }\n this.emit(event, this.getDataToEmit(bytes));\n };\n EncryptedChannel.prototype.getDataToEmit = function (bytes) {\n var raw = Object(utf8[\"decode\"])(bytes);\n try {\n return JSON.parse(raw);\n }\n catch (_a) {\n return raw;\n }\n };\n return EncryptedChannel;\n}(private_channel));\n/* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel);\n\n// CONCATENATED MODULE: ./src/core/connection/connection_manager.ts\nvar connection_manager_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar connection_manager_ConnectionManager = (function (_super) {\n connection_manager_extends(ConnectionManager, _super);\n function ConnectionManager(key, options) {\n var _this = _super.call(this) || this;\n _this.state = 'initialized';\n _this.connection = null;\n _this.key = key;\n _this.options = options;\n _this.timeline = _this.options.timeline;\n _this.usingTLS = _this.options.useTLS;\n _this.errorCallbacks = _this.buildErrorCallbacks();\n _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks);\n _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks);\n var Network = runtime.getNetwork();\n Network.bind('online', function () {\n _this.timeline.info({ netinfo: 'online' });\n if (_this.state === 'connecting' || _this.state === 'unavailable') {\n _this.retryIn(0);\n }\n });\n Network.bind('offline', function () {\n _this.timeline.info({ netinfo: 'offline' });\n if (_this.connection) {\n _this.sendActivityCheck();\n }\n });\n _this.updateStrategy();\n return _this;\n }\n ConnectionManager.prototype.connect = function () {\n if (this.connection || this.runner) {\n return;\n }\n if (!this.strategy.isSupported()) {\n this.updateState('failed');\n return;\n }\n this.updateState('connecting');\n this.startConnecting();\n this.setUnavailableTimer();\n };\n ConnectionManager.prototype.send = function (data) {\n if (this.connection) {\n return this.connection.send(data);\n }\n else {\n return false;\n }\n };\n ConnectionManager.prototype.send_event = function (name, data, channel) {\n if (this.connection) {\n return this.connection.send_event(name, data, channel);\n }\n else {\n return false;\n }\n };\n ConnectionManager.prototype.disconnect = function () {\n this.disconnectInternally();\n this.updateState('disconnected');\n };\n ConnectionManager.prototype.isUsingTLS = function () {\n return this.usingTLS;\n };\n ConnectionManager.prototype.startConnecting = function () {\n var _this = this;\n var callback = function (error, handshake) {\n if (error) {\n _this.runner = _this.strategy.connect(0, callback);\n }\n else {\n if (handshake.action === 'error') {\n _this.emit('error', {\n type: 'HandshakeError',\n error: handshake.error\n });\n _this.timeline.error({ handshakeError: handshake.error });\n }\n else {\n _this.abortConnecting();\n _this.handshakeCallbacks[handshake.action](handshake);\n }\n }\n };\n this.runner = this.strategy.connect(0, callback);\n };\n ConnectionManager.prototype.abortConnecting = function () {\n if (this.runner) {\n this.runner.abort();\n this.runner = null;\n }\n };\n ConnectionManager.prototype.disconnectInternally = function () {\n this.abortConnecting();\n this.clearRetryTimer();\n this.clearUnavailableTimer();\n if (this.connection) {\n var connection = this.abandonConnection();\n connection.close();\n }\n };\n ConnectionManager.prototype.updateStrategy = function () {\n this.strategy = this.options.getStrategy({\n key: this.key,\n timeline: this.timeline,\n useTLS: this.usingTLS\n });\n };\n ConnectionManager.prototype.retryIn = function (delay) {\n var _this = this;\n this.timeline.info({ action: 'retry', delay: delay });\n if (delay > 0) {\n this.emit('connecting_in', Math.round(delay / 1000));\n }\n this.retryTimer = new OneOffTimer(delay || 0, function () {\n _this.disconnectInternally();\n _this.connect();\n });\n };\n ConnectionManager.prototype.clearRetryTimer = function () {\n if (this.retryTimer) {\n this.retryTimer.ensureAborted();\n this.retryTimer = null;\n }\n };\n ConnectionManager.prototype.setUnavailableTimer = function () {\n var _this = this;\n this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () {\n _this.updateState('unavailable');\n });\n };\n ConnectionManager.prototype.clearUnavailableTimer = function () {\n if (this.unavailableTimer) {\n this.unavailableTimer.ensureAborted();\n }\n };\n ConnectionManager.prototype.sendActivityCheck = function () {\n var _this = this;\n this.stopActivityCheck();\n this.connection.ping();\n this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () {\n _this.timeline.error({ pong_timed_out: _this.options.pongTimeout });\n _this.retryIn(0);\n });\n };\n ConnectionManager.prototype.resetActivityCheck = function () {\n var _this = this;\n this.stopActivityCheck();\n if (this.connection && !this.connection.handlesActivityChecks()) {\n this.activityTimer = new OneOffTimer(this.activityTimeout, function () {\n _this.sendActivityCheck();\n });\n }\n };\n ConnectionManager.prototype.stopActivityCheck = function () {\n if (this.activityTimer) {\n this.activityTimer.ensureAborted();\n }\n };\n ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) {\n var _this = this;\n return extend({}, errorCallbacks, {\n message: function (message) {\n _this.resetActivityCheck();\n _this.emit('message', message);\n },\n ping: function () {\n _this.send_event('pusher:pong', {});\n },\n activity: function () {\n _this.resetActivityCheck();\n },\n error: function (error) {\n _this.emit('error', error);\n },\n closed: function () {\n _this.abandonConnection();\n if (_this.shouldRetry()) {\n _this.retryIn(1000);\n }\n }\n });\n };\n ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) {\n var _this = this;\n return extend({}, errorCallbacks, {\n connected: function (handshake) {\n _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity);\n _this.clearUnavailableTimer();\n _this.setConnection(handshake.connection);\n _this.socket_id = _this.connection.id;\n _this.updateState('connected', { socket_id: _this.socket_id });\n }\n });\n };\n ConnectionManager.prototype.buildErrorCallbacks = function () {\n var _this = this;\n var withErrorEmitted = function (callback) {\n return function (result) {\n if (result.error) {\n _this.emit('error', { type: 'WebSocketError', error: result.error });\n }\n callback(result);\n };\n };\n return {\n tls_only: withErrorEmitted(function () {\n _this.usingTLS = true;\n _this.updateStrategy();\n _this.retryIn(0);\n }),\n refused: withErrorEmitted(function () {\n _this.disconnect();\n }),\n backoff: withErrorEmitted(function () {\n _this.retryIn(1000);\n }),\n retry: withErrorEmitted(function () {\n _this.retryIn(0);\n })\n };\n };\n ConnectionManager.prototype.setConnection = function (connection) {\n this.connection = connection;\n for (var event in this.connectionCallbacks) {\n this.connection.bind(event, this.connectionCallbacks[event]);\n }\n this.resetActivityCheck();\n };\n ConnectionManager.prototype.abandonConnection = function () {\n if (!this.connection) {\n return;\n }\n this.stopActivityCheck();\n for (var event in this.connectionCallbacks) {\n this.connection.unbind(event, this.connectionCallbacks[event]);\n }\n var connection = this.connection;\n this.connection = null;\n return connection;\n };\n ConnectionManager.prototype.updateState = function (newState, data) {\n var previousState = this.state;\n this.state = newState;\n if (previousState !== newState) {\n var newStateDescription = newState;\n if (newStateDescription === 'connected') {\n newStateDescription += ' with new socket ID ' + data.socket_id;\n }\n logger.debug('State changed', previousState + ' -> ' + newStateDescription);\n this.timeline.info({ state: newState, params: data });\n this.emit('state_change', { previous: previousState, current: newState });\n this.emit(newState, data);\n }\n };\n ConnectionManager.prototype.shouldRetry = function () {\n return this.state === 'connecting' || this.state === 'connected';\n };\n return ConnectionManager;\n}(dispatcher));\n/* harmony default export */ var connection_manager = (connection_manager_ConnectionManager);\n\n// CONCATENATED MODULE: ./src/core/channels/channels.ts\n\n\n\n\nvar channels_Channels = (function () {\n function Channels() {\n this.channels = {};\n }\n Channels.prototype.add = function (name, pusher) {\n if (!this.channels[name]) {\n this.channels[name] = createChannel(name, pusher);\n }\n return this.channels[name];\n };\n Channels.prototype.all = function () {\n return values(this.channels);\n };\n Channels.prototype.find = function (name) {\n return this.channels[name];\n };\n Channels.prototype.remove = function (name) {\n var channel = this.channels[name];\n delete this.channels[name];\n return channel;\n };\n Channels.prototype.disconnect = function () {\n objectApply(this.channels, function (channel) {\n channel.disconnect();\n });\n };\n return Channels;\n}());\n/* harmony default export */ var channels = (channels_Channels);\nfunction createChannel(name, pusher) {\n if (name.indexOf('private-encrypted-') === 0) {\n if (pusher.config.nacl) {\n return factory.createEncryptedChannel(name, pusher, pusher.config.nacl);\n }\n var errMsg = 'Tried to subscribe to a private-encrypted- channel but no nacl implementation available';\n var suffix = url_store.buildLogSuffix('encryptedChannelSupport');\n throw new UnsupportedFeature(errMsg + \". \" + suffix);\n }\n else if (name.indexOf('private-') === 0) {\n return factory.createPrivateChannel(name, pusher);\n }\n else if (name.indexOf('presence-') === 0) {\n return factory.createPresenceChannel(name, pusher);\n }\n else {\n return factory.createChannel(name, pusher);\n }\n}\n\n// CONCATENATED MODULE: ./src/core/utils/factory.ts\n\n\n\n\n\n\n\n\n\n\nvar Factory = {\n createChannels: function () {\n return new channels();\n },\n createConnectionManager: function (key, options) {\n return new connection_manager(key, options);\n },\n createChannel: function (name, pusher) {\n return new channels_channel(name, pusher);\n },\n createPrivateChannel: function (name, pusher) {\n return new private_channel(name, pusher);\n },\n createPresenceChannel: function (name, pusher) {\n return new presence_channel(name, pusher);\n },\n createEncryptedChannel: function (name, pusher, nacl) {\n return new encrypted_channel(name, pusher, nacl);\n },\n createTimelineSender: function (timeline, options) {\n return new timeline_sender(timeline, options);\n },\n createAuthorizer: function (channel, options) {\n if (options.authorizer) {\n return options.authorizer(channel, options);\n }\n return new pusher_authorizer(channel, options);\n },\n createHandshake: function (transport, callback) {\n return new connection_handshake(transport, callback);\n },\n createAssistantToTheTransportManager: function (manager, transport, options) {\n return new assistant_to_the_transport_manager(manager, transport, options);\n }\n};\n/* harmony default export */ var factory = (Factory);\n\n// CONCATENATED MODULE: ./src/core/transports/transport_manager.ts\n\nvar transport_manager_TransportManager = (function () {\n function TransportManager(options) {\n this.options = options || {};\n this.livesLeft = this.options.lives || Infinity;\n }\n TransportManager.prototype.getAssistant = function (transport) {\n return factory.createAssistantToTheTransportManager(this, transport, {\n minPingDelay: this.options.minPingDelay,\n maxPingDelay: this.options.maxPingDelay\n });\n };\n TransportManager.prototype.isAlive = function () {\n return this.livesLeft > 0;\n };\n TransportManager.prototype.reportDeath = function () {\n this.livesLeft -= 1;\n };\n return TransportManager;\n}());\n/* harmony default export */ var transport_manager = (transport_manager_TransportManager);\n\n// CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts\n\n\n\nvar sequential_strategy_SequentialStrategy = (function () {\n function SequentialStrategy(strategies, options) {\n this.strategies = strategies;\n this.loop = Boolean(options.loop);\n this.failFast = Boolean(options.failFast);\n this.timeout = options.timeout;\n this.timeoutLimit = options.timeoutLimit;\n }\n SequentialStrategy.prototype.isSupported = function () {\n return any(this.strategies, util.method('isSupported'));\n };\n SequentialStrategy.prototype.connect = function (minPriority, callback) {\n var _this = this;\n var strategies = this.strategies;\n var current = 0;\n var timeout = this.timeout;\n var runner = null;\n var tryNextStrategy = function (error, handshake) {\n if (handshake) {\n callback(null, handshake);\n }\n else {\n current = current + 1;\n if (_this.loop) {\n current = current % strategies.length;\n }\n if (current < strategies.length) {\n if (timeout) {\n timeout = timeout * 2;\n if (_this.timeoutLimit) {\n timeout = Math.min(timeout, _this.timeoutLimit);\n }\n }\n runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy);\n }\n else {\n callback(true);\n }\n }\n };\n runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy);\n return {\n abort: function () {\n runner.abort();\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) {\n var timer = null;\n var runner = null;\n if (options.timeout > 0) {\n timer = new OneOffTimer(options.timeout, function () {\n runner.abort();\n callback(true);\n });\n }\n runner = strategy.connect(minPriority, function (error, handshake) {\n if (error && timer && timer.isRunning() && !options.failFast) {\n return;\n }\n if (timer) {\n timer.ensureAborted();\n }\n callback(error, handshake);\n });\n return {\n abort: function () {\n if (timer) {\n timer.ensureAborted();\n }\n runner.abort();\n },\n forceMinPriority: function (p) {\n runner.forceMinPriority(p);\n }\n };\n };\n return SequentialStrategy;\n}());\n/* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts\n\n\nvar best_connected_ever_strategy_BestConnectedEverStrategy = (function () {\n function BestConnectedEverStrategy(strategies) {\n this.strategies = strategies;\n }\n BestConnectedEverStrategy.prototype.isSupported = function () {\n return any(this.strategies, util.method('isSupported'));\n };\n BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) {\n return connect(this.strategies, minPriority, function (i, runners) {\n return function (error, handshake) {\n runners[i].error = error;\n if (error) {\n if (allRunnersFailed(runners)) {\n callback(true);\n }\n return;\n }\n apply(runners, function (runner) {\n runner.forceMinPriority(handshake.transport.priority);\n });\n callback(null, handshake);\n };\n });\n };\n return BestConnectedEverStrategy;\n}());\n/* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy);\nfunction connect(strategies, minPriority, callbackBuilder) {\n var runners = map(strategies, function (strategy, i, _, rs) {\n return strategy.connect(minPriority, callbackBuilder(i, rs));\n });\n return {\n abort: function () {\n apply(runners, abortRunner);\n },\n forceMinPriority: function (p) {\n apply(runners, function (runner) {\n runner.forceMinPriority(p);\n });\n }\n };\n}\nfunction allRunnersFailed(runners) {\n return collections_all(runners, function (runner) {\n return Boolean(runner.error);\n });\n}\nfunction abortRunner(runner) {\n if (!runner.error && !runner.aborted) {\n runner.abort();\n runner.aborted = true;\n }\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts\n\n\n\n\nvar cached_strategy_CachedStrategy = (function () {\n function CachedStrategy(strategy, transports, options) {\n this.strategy = strategy;\n this.transports = transports;\n this.ttl = options.ttl || 1800 * 1000;\n this.usingTLS = options.useTLS;\n this.timeline = options.timeline;\n }\n CachedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n CachedStrategy.prototype.connect = function (minPriority, callback) {\n var usingTLS = this.usingTLS;\n var info = fetchTransportCache(usingTLS);\n var strategies = [this.strategy];\n if (info && info.timestamp + this.ttl >= util.now()) {\n var transport = this.transports[info.transport];\n if (transport) {\n this.timeline.info({\n cached: true,\n transport: info.transport,\n latency: info.latency\n });\n strategies.push(new sequential_strategy([transport], {\n timeout: info.latency * 2 + 1000,\n failFast: true\n }));\n }\n }\n var startTimestamp = util.now();\n var runner = strategies\n .pop()\n .connect(minPriority, function cb(error, handshake) {\n if (error) {\n flushTransportCache(usingTLS);\n if (strategies.length > 0) {\n startTimestamp = util.now();\n runner = strategies.pop().connect(minPriority, cb);\n }\n else {\n callback(error);\n }\n }\n else {\n storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp);\n callback(null, handshake);\n }\n });\n return {\n abort: function () {\n runner.abort();\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n return CachedStrategy;\n}());\n/* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy);\nfunction getTransportCacheKey(usingTLS) {\n return 'pusherTransport' + (usingTLS ? 'TLS' : 'NonTLS');\n}\nfunction fetchTransportCache(usingTLS) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n var serializedCache = storage[getTransportCacheKey(usingTLS)];\n if (serializedCache) {\n return JSON.parse(serializedCache);\n }\n }\n catch (e) {\n flushTransportCache(usingTLS);\n }\n }\n return null;\n}\nfunction storeTransportCache(usingTLS, transport, latency) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({\n timestamp: util.now(),\n transport: transport,\n latency: latency\n });\n }\n catch (e) {\n }\n }\n}\nfunction flushTransportCache(usingTLS) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n delete storage[getTransportCacheKey(usingTLS)];\n }\n catch (e) {\n }\n }\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts\n\nvar delayed_strategy_DelayedStrategy = (function () {\n function DelayedStrategy(strategy, _a) {\n var number = _a.delay;\n this.strategy = strategy;\n this.options = { delay: number };\n }\n DelayedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n DelayedStrategy.prototype.connect = function (minPriority, callback) {\n var strategy = this.strategy;\n var runner;\n var timer = new OneOffTimer(this.options.delay, function () {\n runner = strategy.connect(minPriority, callback);\n });\n return {\n abort: function () {\n timer.ensureAborted();\n if (runner) {\n runner.abort();\n }\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n return DelayedStrategy;\n}());\n/* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts\nvar IfStrategy = (function () {\n function IfStrategy(test, trueBranch, falseBranch) {\n this.test = test;\n this.trueBranch = trueBranch;\n this.falseBranch = falseBranch;\n }\n IfStrategy.prototype.isSupported = function () {\n var branch = this.test() ? this.trueBranch : this.falseBranch;\n return branch.isSupported();\n };\n IfStrategy.prototype.connect = function (minPriority, callback) {\n var branch = this.test() ? this.trueBranch : this.falseBranch;\n return branch.connect(minPriority, callback);\n };\n return IfStrategy;\n}());\n/* harmony default export */ var if_strategy = (IfStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts\nvar FirstConnectedStrategy = (function () {\n function FirstConnectedStrategy(strategy) {\n this.strategy = strategy;\n }\n FirstConnectedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n FirstConnectedStrategy.prototype.connect = function (minPriority, callback) {\n var runner = this.strategy.connect(minPriority, function (error, handshake) {\n if (handshake) {\n runner.abort();\n }\n callback(error, handshake);\n });\n return runner;\n };\n return FirstConnectedStrategy;\n}());\n/* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy);\n\n// CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts\n\n\n\n\n\n\n\nfunction testSupportsStrategy(strategy) {\n return function () {\n return strategy.isSupported();\n };\n}\nvar getDefaultStrategy = function (config, baseOptions, defineTransport) {\n var definedTransports = {};\n function defineTransportStrategy(name, type, priority, options, manager) {\n var transport = defineTransport(config, name, type, priority, options, manager);\n definedTransports[name] = transport;\n return transport;\n }\n var ws_options = Object.assign({}, baseOptions, {\n hostNonTLS: config.wsHost + ':' + config.wsPort,\n hostTLS: config.wsHost + ':' + config.wssPort,\n httpPath: config.wsPath\n });\n var wss_options = Object.assign({}, ws_options, {\n useTLS: true\n });\n var sockjs_options = Object.assign({}, baseOptions, {\n hostNonTLS: config.httpHost + ':' + config.httpPort,\n hostTLS: config.httpHost + ':' + config.httpsPort,\n httpPath: config.httpPath\n });\n var timeouts = {\n loop: true,\n timeout: 15000,\n timeoutLimit: 60000\n };\n var ws_manager = new transport_manager({\n lives: 2,\n minPingDelay: 10000,\n maxPingDelay: config.activityTimeout\n });\n var streaming_manager = new transport_manager({\n lives: 2,\n minPingDelay: 10000,\n maxPingDelay: config.activityTimeout\n });\n var ws_transport = defineTransportStrategy('ws', 'ws', 3, ws_options, ws_manager);\n var wss_transport = defineTransportStrategy('wss', 'ws', 3, wss_options, ws_manager);\n var sockjs_transport = defineTransportStrategy('sockjs', 'sockjs', 1, sockjs_options);\n var xhr_streaming_transport = defineTransportStrategy('xhr_streaming', 'xhr_streaming', 1, sockjs_options, streaming_manager);\n var xdr_streaming_transport = defineTransportStrategy('xdr_streaming', 'xdr_streaming', 1, sockjs_options, streaming_manager);\n var xhr_polling_transport = defineTransportStrategy('xhr_polling', 'xhr_polling', 1, sockjs_options);\n var xdr_polling_transport = defineTransportStrategy('xdr_polling', 'xdr_polling', 1, sockjs_options);\n var ws_loop = new sequential_strategy([ws_transport], timeouts);\n var wss_loop = new sequential_strategy([wss_transport], timeouts);\n var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts);\n var streaming_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport)\n ], timeouts);\n var polling_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport)\n ], timeouts);\n var http_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy([\n streaming_loop,\n new delayed_strategy(polling_loop, { delay: 4000 })\n ]), polling_loop)\n ], timeouts);\n var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop);\n var wsStrategy;\n if (baseOptions.useTLS) {\n wsStrategy = new best_connected_ever_strategy([\n ws_loop,\n new delayed_strategy(http_fallback_loop, { delay: 2000 })\n ]);\n }\n else {\n wsStrategy = new best_connected_ever_strategy([\n ws_loop,\n new delayed_strategy(wss_loop, { delay: 2000 }),\n new delayed_strategy(http_fallback_loop, { delay: 5000 })\n ]);\n }\n return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {\n ttl: 1800000,\n timeline: baseOptions.timeline,\n useTLS: baseOptions.useTLS\n });\n};\n/* harmony default export */ var default_strategy = (getDefaultStrategy);\n\n// CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts\n\n/* harmony default export */ var transport_connection_initializer = (function () {\n var self = this;\n self.timeline.info(self.buildTimelineMessage({\n transport: self.name + (self.options.useTLS ? 's' : '')\n }));\n if (self.hooks.isInitialized()) {\n self.changeState('initialized');\n }\n else if (self.hooks.file) {\n self.changeState('initializing');\n Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) {\n if (self.hooks.isInitialized()) {\n self.changeState('initialized');\n callback(true);\n }\n else {\n if (error) {\n self.onError(error);\n }\n self.onClose();\n callback(false);\n }\n });\n }\n else {\n self.onClose();\n }\n});\n\n// CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts\n\nvar http_xdomain_request_hooks = {\n getRequest: function (socket) {\n var xdr = new window.XDomainRequest();\n xdr.ontimeout = function () {\n socket.emit('error', new RequestTimedOut());\n socket.close();\n };\n xdr.onerror = function (e) {\n socket.emit('error', e);\n socket.close();\n };\n xdr.onprogress = function () {\n if (xdr.responseText && xdr.responseText.length > 0) {\n socket.onChunk(200, xdr.responseText);\n }\n };\n xdr.onload = function () {\n if (xdr.responseText && xdr.responseText.length > 0) {\n socket.onChunk(200, xdr.responseText);\n }\n socket.emit('finished', 200);\n socket.close();\n };\n return xdr;\n },\n abortRequest: function (xdr) {\n xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null;\n xdr.abort();\n }\n};\n/* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks);\n\n// CONCATENATED MODULE: ./src/core/http/http_request.ts\nvar http_request_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar MAX_BUFFER_LENGTH = 256 * 1024;\nvar http_request_HTTPRequest = (function (_super) {\n http_request_extends(HTTPRequest, _super);\n function HTTPRequest(hooks, method, url) {\n var _this = _super.call(this) || this;\n _this.hooks = hooks;\n _this.method = method;\n _this.url = url;\n return _this;\n }\n HTTPRequest.prototype.start = function (payload) {\n var _this = this;\n this.position = 0;\n this.xhr = this.hooks.getRequest(this);\n this.unloader = function () {\n _this.close();\n };\n runtime.addUnloadListener(this.unloader);\n this.xhr.open(this.method, this.url, true);\n if (this.xhr.setRequestHeader) {\n this.xhr.setRequestHeader('Content-Type', 'application/json');\n }\n this.xhr.send(payload);\n };\n HTTPRequest.prototype.close = function () {\n if (this.unloader) {\n runtime.removeUnloadListener(this.unloader);\n this.unloader = null;\n }\n if (this.xhr) {\n this.hooks.abortRequest(this.xhr);\n this.xhr = null;\n }\n };\n HTTPRequest.prototype.onChunk = function (status, data) {\n while (true) {\n var chunk = this.advanceBuffer(data);\n if (chunk) {\n this.emit('chunk', { status: status, data: chunk });\n }\n else {\n break;\n }\n }\n if (this.isBufferTooLong(data)) {\n this.emit('buffer_too_long');\n }\n };\n HTTPRequest.prototype.advanceBuffer = function (buffer) {\n var unreadData = buffer.slice(this.position);\n var endOfLinePosition = unreadData.indexOf('\\n');\n if (endOfLinePosition !== -1) {\n this.position += endOfLinePosition + 1;\n return unreadData.slice(0, endOfLinePosition);\n }\n else {\n return null;\n }\n };\n HTTPRequest.prototype.isBufferTooLong = function (buffer) {\n return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH;\n };\n return HTTPRequest;\n}(dispatcher));\n/* harmony default export */ var http_request = (http_request_HTTPRequest);\n\n// CONCATENATED MODULE: ./src/core/http/state.ts\nvar State;\n(function (State) {\n State[State[\"CONNECTING\"] = 0] = \"CONNECTING\";\n State[State[\"OPEN\"] = 1] = \"OPEN\";\n State[State[\"CLOSED\"] = 3] = \"CLOSED\";\n})(State || (State = {}));\n/* harmony default export */ var state = (State);\n\n// CONCATENATED MODULE: ./src/core/http/http_socket.ts\n\n\n\nvar autoIncrement = 1;\nvar http_socket_HTTPSocket = (function () {\n function HTTPSocket(hooks, url) {\n this.hooks = hooks;\n this.session = randomNumber(1000) + '/' + randomString(8);\n this.location = getLocation(url);\n this.readyState = state.CONNECTING;\n this.openStream();\n }\n HTTPSocket.prototype.send = function (payload) {\n return this.sendRaw(JSON.stringify([payload]));\n };\n HTTPSocket.prototype.ping = function () {\n this.hooks.sendHeartbeat(this);\n };\n HTTPSocket.prototype.close = function (code, reason) {\n this.onClose(code, reason, true);\n };\n HTTPSocket.prototype.sendRaw = function (payload) {\n if (this.readyState === state.OPEN) {\n try {\n runtime.createSocketRequest('POST', getUniqueURL(getSendURL(this.location, this.session))).start(payload);\n return true;\n }\n catch (e) {\n return false;\n }\n }\n else {\n return false;\n }\n };\n HTTPSocket.prototype.reconnect = function () {\n this.closeStream();\n this.openStream();\n };\n HTTPSocket.prototype.onClose = function (code, reason, wasClean) {\n this.closeStream();\n this.readyState = state.CLOSED;\n if (this.onclose) {\n this.onclose({\n code: code,\n reason: reason,\n wasClean: wasClean\n });\n }\n };\n HTTPSocket.prototype.onChunk = function (chunk) {\n if (chunk.status !== 200) {\n return;\n }\n if (this.readyState === state.OPEN) {\n this.onActivity();\n }\n var payload;\n var type = chunk.data.slice(0, 1);\n switch (type) {\n case 'o':\n payload = JSON.parse(chunk.data.slice(1) || '{}');\n this.onOpen(payload);\n break;\n case 'a':\n payload = JSON.parse(chunk.data.slice(1) || '[]');\n for (var i = 0; i < payload.length; i++) {\n this.onEvent(payload[i]);\n }\n break;\n case 'm':\n payload = JSON.parse(chunk.data.slice(1) || 'null');\n this.onEvent(payload);\n break;\n case 'h':\n this.hooks.onHeartbeat(this);\n break;\n case 'c':\n payload = JSON.parse(chunk.data.slice(1) || '[]');\n this.onClose(payload[0], payload[1], true);\n break;\n }\n };\n HTTPSocket.prototype.onOpen = function (options) {\n if (this.readyState === state.CONNECTING) {\n if (options && options.hostname) {\n this.location.base = replaceHost(this.location.base, options.hostname);\n }\n this.readyState = state.OPEN;\n if (this.onopen) {\n this.onopen();\n }\n }\n else {\n this.onClose(1006, 'Server lost session', true);\n }\n };\n HTTPSocket.prototype.onEvent = function (event) {\n if (this.readyState === state.OPEN && this.onmessage) {\n this.onmessage({ data: event });\n }\n };\n HTTPSocket.prototype.onActivity = function () {\n if (this.onactivity) {\n this.onactivity();\n }\n };\n HTTPSocket.prototype.onError = function (error) {\n if (this.onerror) {\n this.onerror(error);\n }\n };\n HTTPSocket.prototype.openStream = function () {\n var _this = this;\n this.stream = runtime.createSocketRequest('POST', getUniqueURL(this.hooks.getReceiveURL(this.location, this.session)));\n this.stream.bind('chunk', function (chunk) {\n _this.onChunk(chunk);\n });\n this.stream.bind('finished', function (status) {\n _this.hooks.onFinished(_this, status);\n });\n this.stream.bind('buffer_too_long', function () {\n _this.reconnect();\n });\n try {\n this.stream.start();\n }\n catch (error) {\n util.defer(function () {\n _this.onError(error);\n _this.onClose(1006, 'Could not start streaming', false);\n });\n }\n };\n HTTPSocket.prototype.closeStream = function () {\n if (this.stream) {\n this.stream.unbind_all();\n this.stream.close();\n this.stream = null;\n }\n };\n return HTTPSocket;\n}());\nfunction getLocation(url) {\n var parts = /([^\\?]*)\\/*(\\??.*)/.exec(url);\n return {\n base: parts[1],\n queryString: parts[2]\n };\n}\nfunction getSendURL(url, session) {\n return url.base + '/' + session + '/xhr_send';\n}\nfunction getUniqueURL(url) {\n var separator = url.indexOf('?') === -1 ? '?' : '&';\n return url + separator + 't=' + +new Date() + '&n=' + autoIncrement++;\n}\nfunction replaceHost(url, hostname) {\n var urlParts = /(https?:\\/\\/)([^\\/:]+)((\\/|:)?.*)/.exec(url);\n return urlParts[1] + hostname + urlParts[3];\n}\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction randomString(length) {\n var result = [];\n for (var i = 0; i < length; i++) {\n result.push(randomNumber(32).toString(32));\n }\n return result.join('');\n}\n/* harmony default export */ var http_socket = (http_socket_HTTPSocket);\n\n// CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts\nvar http_streaming_socket_hooks = {\n getReceiveURL: function (url, session) {\n return url.base + '/' + session + '/xhr_streaming' + url.queryString;\n },\n onHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n sendHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n onFinished: function (socket, status) {\n socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n }\n};\n/* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks);\n\n// CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts\nvar http_polling_socket_hooks = {\n getReceiveURL: function (url, session) {\n return url.base + '/' + session + '/xhr' + url.queryString;\n },\n onHeartbeat: function () {\n },\n sendHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n onFinished: function (socket, status) {\n if (status === 200) {\n socket.reconnect();\n }\n else {\n socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n }\n }\n};\n/* harmony default export */ var http_polling_socket = (http_polling_socket_hooks);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts\n\nvar http_xhr_request_hooks = {\n getRequest: function (socket) {\n var Constructor = runtime.getXHRAPI();\n var xhr = new Constructor();\n xhr.onreadystatechange = xhr.onprogress = function () {\n switch (xhr.readyState) {\n case 3:\n if (xhr.responseText && xhr.responseText.length > 0) {\n socket.onChunk(xhr.status, xhr.responseText);\n }\n break;\n case 4:\n if (xhr.responseText && xhr.responseText.length > 0) {\n socket.onChunk(xhr.status, xhr.responseText);\n }\n socket.emit('finished', xhr.status);\n socket.close();\n break;\n }\n };\n return xhr;\n },\n abortRequest: function (xhr) {\n xhr.onreadystatechange = null;\n xhr.abort();\n }\n};\n/* harmony default export */ var http_xhr_request = (http_xhr_request_hooks);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts\n\n\n\n\n\nvar HTTP = {\n createStreamingSocket: function (url) {\n return this.createSocket(http_streaming_socket, url);\n },\n createPollingSocket: function (url) {\n return this.createSocket(http_polling_socket, url);\n },\n createSocket: function (hooks, url) {\n return new http_socket(hooks, url);\n },\n createXHR: function (method, url) {\n return this.createRequest(http_xhr_request, method, url);\n },\n createRequest: function (hooks, method, url) {\n return new http_request(hooks, method, url);\n }\n};\n/* harmony default export */ var http_http = (HTTP);\n\n// CONCATENATED MODULE: ./src/runtimes/web/http/http.ts\n\n\nhttp_http.createXDR = function (method, url) {\n return this.createRequest(http_xdomain_request, method, url);\n};\n/* harmony default export */ var web_http_http = (http_http);\n\n// CONCATENATED MODULE: ./src/runtimes/web/runtime.ts\n\n\n\n\n\n\n\n\n\n\n\n\nvar Runtime = {\n nextAuthCallbackID: 1,\n auth_callbacks: {},\n ScriptReceivers: ScriptReceivers,\n DependenciesReceivers: DependenciesReceivers,\n getDefaultStrategy: default_strategy,\n Transports: transports_transports,\n transportConnectionInitializer: transport_connection_initializer,\n HTTPFactory: web_http_http,\n TimelineTransport: jsonp_timeline,\n getXHRAPI: function () {\n return window.XMLHttpRequest;\n },\n getWebSocketAPI: function () {\n return window.WebSocket || window.MozWebSocket;\n },\n setup: function (PusherClass) {\n var _this = this;\n window.Pusher = PusherClass;\n var initializeOnDocumentBody = function () {\n _this.onDocumentBody(PusherClass.ready);\n };\n if (!window.JSON) {\n Dependencies.load('json2', {}, initializeOnDocumentBody);\n }\n else {\n initializeOnDocumentBody();\n }\n },\n getDocument: function () {\n return document;\n },\n getProtocol: function () {\n return this.getDocument().location.protocol;\n },\n getAuthorizers: function () {\n return { ajax: xhr_auth, jsonp: jsonp_auth };\n },\n onDocumentBody: function (callback) {\n var _this = this;\n if (document.body) {\n callback();\n }\n else {\n setTimeout(function () {\n _this.onDocumentBody(callback);\n }, 0);\n }\n },\n createJSONPRequest: function (url, data) {\n return new jsonp_request(url, data);\n },\n createScriptRequest: function (src) {\n return new script_request(src);\n },\n getLocalStorage: function () {\n try {\n return window.localStorage;\n }\n catch (e) {\n return undefined;\n }\n },\n createXHR: function () {\n if (this.getXHRAPI()) {\n return this.createXMLHttpRequest();\n }\n else {\n return this.createMicrosoftXHR();\n }\n },\n createXMLHttpRequest: function () {\n var Constructor = this.getXHRAPI();\n return new Constructor();\n },\n createMicrosoftXHR: function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n },\n getNetwork: function () {\n return net_info_Network;\n },\n createWebSocket: function (url) {\n var Constructor = this.getWebSocketAPI();\n return new Constructor(url);\n },\n createSocketRequest: function (method, url) {\n if (this.isXHRSupported()) {\n return this.HTTPFactory.createXHR(method, url);\n }\n else if (this.isXDRSupported(url.indexOf('https:') === 0)) {\n return this.HTTPFactory.createXDR(method, url);\n }\n else {\n throw 'Cross-origin HTTP requests are not supported';\n }\n },\n isXHRSupported: function () {\n var Constructor = this.getXHRAPI();\n return (Boolean(Constructor) && new Constructor().withCredentials !== undefined);\n },\n isXDRSupported: function (useTLS) {\n var protocol = useTLS ? 'https:' : 'http:';\n var documentProtocol = this.getProtocol();\n return (Boolean(window['XDomainRequest']) && documentProtocol === protocol);\n },\n addUnloadListener: function (listener) {\n if (window.addEventListener !== undefined) {\n window.addEventListener('unload', listener, false);\n }\n else if (window.attachEvent !== undefined) {\n window.attachEvent('onunload', listener);\n }\n },\n removeUnloadListener: function (listener) {\n if (window.addEventListener !== undefined) {\n window.removeEventListener('unload', listener, false);\n }\n else if (window.detachEvent !== undefined) {\n window.detachEvent('onunload', listener);\n }\n }\n};\n/* harmony default export */ var runtime = (Runtime);\n\n// CONCATENATED MODULE: ./src/core/timeline/level.ts\nvar TimelineLevel;\n(function (TimelineLevel) {\n TimelineLevel[TimelineLevel[\"ERROR\"] = 3] = \"ERROR\";\n TimelineLevel[TimelineLevel[\"INFO\"] = 6] = \"INFO\";\n TimelineLevel[TimelineLevel[\"DEBUG\"] = 7] = \"DEBUG\";\n})(TimelineLevel || (TimelineLevel = {}));\n/* harmony default export */ var timeline_level = (TimelineLevel);\n\n// CONCATENATED MODULE: ./src/core/timeline/timeline.ts\n\n\n\nvar timeline_Timeline = (function () {\n function Timeline(key, session, options) {\n this.key = key;\n this.session = session;\n this.events = [];\n this.options = options || {};\n this.sent = 0;\n this.uniqueID = 0;\n }\n Timeline.prototype.log = function (level, event) {\n if (level <= this.options.level) {\n this.events.push(extend({}, event, { timestamp: util.now() }));\n if (this.options.limit && this.events.length > this.options.limit) {\n this.events.shift();\n }\n }\n };\n Timeline.prototype.error = function (event) {\n this.log(timeline_level.ERROR, event);\n };\n Timeline.prototype.info = function (event) {\n this.log(timeline_level.INFO, event);\n };\n Timeline.prototype.debug = function (event) {\n this.log(timeline_level.DEBUG, event);\n };\n Timeline.prototype.isEmpty = function () {\n return this.events.length === 0;\n };\n Timeline.prototype.send = function (sendfn, callback) {\n var _this = this;\n var data = extend({\n session: this.session,\n bundle: this.sent + 1,\n key: this.key,\n lib: 'js',\n version: this.options.version,\n cluster: this.options.cluster,\n features: this.options.features,\n timeline: this.events\n }, this.options.params);\n this.events = [];\n sendfn(data, function (error, result) {\n if (!error) {\n _this.sent++;\n }\n if (callback) {\n callback(error, result);\n }\n });\n return true;\n };\n Timeline.prototype.generateUniqueID = function () {\n this.uniqueID++;\n return this.uniqueID;\n };\n return Timeline;\n}());\n/* harmony default export */ var timeline_timeline = (timeline_Timeline);\n\n// CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts\n\n\n\n\nvar transport_strategy_TransportStrategy = (function () {\n function TransportStrategy(name, priority, transport, options) {\n this.name = name;\n this.priority = priority;\n this.transport = transport;\n this.options = options || {};\n }\n TransportStrategy.prototype.isSupported = function () {\n return this.transport.isSupported({\n useTLS: this.options.useTLS\n });\n };\n TransportStrategy.prototype.connect = function (minPriority, callback) {\n var _this = this;\n if (!this.isSupported()) {\n return failAttempt(new UnsupportedStrategy(), callback);\n }\n else if (this.priority < minPriority) {\n return failAttempt(new TransportPriorityTooLow(), callback);\n }\n var connected = false;\n var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options);\n var handshake = null;\n var onInitialized = function () {\n transport.unbind('initialized', onInitialized);\n transport.connect();\n };\n var onOpen = function () {\n handshake = factory.createHandshake(transport, function (result) {\n connected = true;\n unbindListeners();\n callback(null, result);\n });\n };\n var onError = function (error) {\n unbindListeners();\n callback(error);\n };\n var onClosed = function () {\n unbindListeners();\n var serializedTransport;\n serializedTransport = safeJSONStringify(transport);\n callback(new TransportClosed(serializedTransport));\n };\n var unbindListeners = function () {\n transport.unbind('initialized', onInitialized);\n transport.unbind('open', onOpen);\n transport.unbind('error', onError);\n transport.unbind('closed', onClosed);\n };\n transport.bind('initialized', onInitialized);\n transport.bind('open', onOpen);\n transport.bind('error', onError);\n transport.bind('closed', onClosed);\n transport.initialize();\n return {\n abort: function () {\n if (connected) {\n return;\n }\n unbindListeners();\n if (handshake) {\n handshake.close();\n }\n else {\n transport.close();\n }\n },\n forceMinPriority: function (p) {\n if (connected) {\n return;\n }\n if (_this.priority < p) {\n if (handshake) {\n handshake.close();\n }\n else {\n transport.close();\n }\n }\n }\n };\n };\n return TransportStrategy;\n}());\n/* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy);\nfunction failAttempt(error, callback) {\n util.defer(function () {\n callback(error);\n });\n return {\n abort: function () { },\n forceMinPriority: function () { }\n };\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts\n\n\n\n\n\nvar strategy_builder_Transports = runtime.Transports;\nvar strategy_builder_defineTransport = function (config, name, type, priority, options, manager) {\n var transportClass = strategy_builder_Transports[type];\n if (!transportClass) {\n throw new UnsupportedTransport(type);\n }\n var enabled = (!config.enabledTransports ||\n arrayIndexOf(config.enabledTransports, name) !== -1) &&\n (!config.disabledTransports ||\n arrayIndexOf(config.disabledTransports, name) === -1);\n var transport;\n if (enabled) {\n options = Object.assign({ ignoreNullOrigin: config.ignoreNullOrigin }, options);\n transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options);\n }\n else {\n transport = strategy_builder_UnsupportedStrategy;\n }\n return transport;\n};\nvar strategy_builder_UnsupportedStrategy = {\n isSupported: function () {\n return false;\n },\n connect: function (_, callback) {\n var deferred = util.defer(function () {\n callback(new UnsupportedStrategy());\n });\n return {\n abort: function () {\n deferred.ensureAborted();\n },\n forceMinPriority: function () { }\n };\n }\n};\n\n// CONCATENATED MODULE: ./src/core/config.ts\n\n\nfunction getConfig(opts) {\n var config = {\n activityTimeout: opts.activityTimeout || defaults.activityTimeout,\n authEndpoint: opts.authEndpoint || defaults.authEndpoint,\n authTransport: opts.authTransport || defaults.authTransport,\n cluster: opts.cluster || defaults.cluster,\n httpPath: opts.httpPath || defaults.httpPath,\n httpPort: opts.httpPort || defaults.httpPort,\n httpsPort: opts.httpsPort || defaults.httpsPort,\n pongTimeout: opts.pongTimeout || defaults.pongTimeout,\n statsHost: opts.statsHost || defaults.stats_host,\n unavailableTimeout: opts.unavailableTimeout || defaults.unavailableTimeout,\n wsPath: opts.wsPath || defaults.wsPath,\n wsPort: opts.wsPort || defaults.wsPort,\n wssPort: opts.wssPort || defaults.wssPort,\n enableStats: getEnableStatsConfig(opts),\n httpHost: getHttpHost(opts),\n useTLS: shouldUseTLS(opts),\n wsHost: getWebsocketHost(opts)\n };\n if ('auth' in opts)\n config.auth = opts.auth;\n if ('authorizer' in opts)\n config.authorizer = opts.authorizer;\n if ('disabledTransports' in opts)\n config.disabledTransports = opts.disabledTransports;\n if ('enabledTransports' in opts)\n config.enabledTransports = opts.enabledTransports;\n if ('ignoreNullOrigin' in opts)\n config.ignoreNullOrigin = opts.ignoreNullOrigin;\n if ('timelineParams' in opts)\n config.timelineParams = opts.timelineParams;\n if ('nacl' in opts) {\n config.nacl = opts.nacl;\n }\n return config;\n}\nfunction getHttpHost(opts) {\n if (opts.httpHost) {\n return opts.httpHost;\n }\n if (opts.cluster) {\n return \"sockjs-\" + opts.cluster + \".pusher.com\";\n }\n return defaults.httpHost;\n}\nfunction getWebsocketHost(opts) {\n if (opts.wsHost) {\n return opts.wsHost;\n }\n if (opts.cluster) {\n return getWebsocketHostFromCluster(opts.cluster);\n }\n return getWebsocketHostFromCluster(defaults.cluster);\n}\nfunction getWebsocketHostFromCluster(cluster) {\n return \"ws-\" + cluster + \".pusher.com\";\n}\nfunction shouldUseTLS(opts) {\n if (runtime.getProtocol() === 'https:') {\n return true;\n }\n else if (opts.forceTLS === false) {\n return false;\n }\n return true;\n}\nfunction getEnableStatsConfig(opts) {\n if ('enableStats' in opts) {\n return opts.enableStats;\n }\n if ('disableStats' in opts) {\n return !opts.disableStats;\n }\n return false;\n}\n\n// CONCATENATED MODULE: ./src/core/pusher.ts\n\n\n\n\n\n\n\n\n\n\n\n\nvar pusher_Pusher = (function () {\n function Pusher(app_key, options) {\n var _this = this;\n checkAppKey(app_key);\n options = options || {};\n if (!options.cluster && !(options.wsHost || options.httpHost)) {\n var suffix = url_store.buildLogSuffix('javascriptQuickStart');\n logger.warn(\"You should always specify a cluster when connecting. \" + suffix);\n }\n if ('disableStats' in options) {\n logger.warn('The disableStats option is deprecated in favor of enableStats');\n }\n this.key = app_key;\n this.config = getConfig(options);\n this.channels = factory.createChannels();\n this.global_emitter = new dispatcher();\n this.sessionID = Math.floor(Math.random() * 1000000000);\n this.timeline = new timeline_timeline(this.key, this.sessionID, {\n cluster: this.config.cluster,\n features: Pusher.getClientFeatures(),\n params: this.config.timelineParams || {},\n limit: 50,\n level: timeline_level.INFO,\n version: defaults.VERSION\n });\n if (this.config.enableStats) {\n this.timelineSender = factory.createTimelineSender(this.timeline, {\n host: this.config.statsHost,\n path: '/timeline/v2/' + runtime.TimelineTransport.name\n });\n }\n var getStrategy = function (options) {\n return runtime.getDefaultStrategy(_this.config, options, strategy_builder_defineTransport);\n };\n this.connection = factory.createConnectionManager(this.key, {\n getStrategy: getStrategy,\n timeline: this.timeline,\n activityTimeout: this.config.activityTimeout,\n pongTimeout: this.config.pongTimeout,\n unavailableTimeout: this.config.unavailableTimeout,\n useTLS: Boolean(this.config.useTLS)\n });\n this.connection.bind('connected', function () {\n _this.subscribeAll();\n if (_this.timelineSender) {\n _this.timelineSender.send(_this.connection.isUsingTLS());\n }\n });\n this.connection.bind('message', function (event) {\n var eventName = event.event;\n var internal = eventName.indexOf('pusher_internal:') === 0;\n if (event.channel) {\n var channel = _this.channel(event.channel);\n if (channel) {\n channel.handleEvent(event);\n }\n }\n if (!internal) {\n _this.global_emitter.emit(event.event, event.data);\n }\n });\n this.connection.bind('connecting', function () {\n _this.channels.disconnect();\n });\n this.connection.bind('disconnected', function () {\n _this.channels.disconnect();\n });\n this.connection.bind('error', function (err) {\n logger.warn(err);\n });\n Pusher.instances.push(this);\n this.timeline.info({ instances: Pusher.instances.length });\n if (Pusher.isReady) {\n this.connect();\n }\n }\n Pusher.ready = function () {\n Pusher.isReady = true;\n for (var i = 0, l = Pusher.instances.length; i < l; i++) {\n Pusher.instances[i].connect();\n }\n };\n Pusher.getClientFeatures = function () {\n return keys(filterObject({ ws: runtime.Transports.ws }, function (t) {\n return t.isSupported({});\n }));\n };\n Pusher.prototype.channel = function (name) {\n return this.channels.find(name);\n };\n Pusher.prototype.allChannels = function () {\n return this.channels.all();\n };\n Pusher.prototype.connect = function () {\n this.connection.connect();\n if (this.timelineSender) {\n if (!this.timelineSenderTimer) {\n var usingTLS = this.connection.isUsingTLS();\n var timelineSender = this.timelineSender;\n this.timelineSenderTimer = new PeriodicTimer(60000, function () {\n timelineSender.send(usingTLS);\n });\n }\n }\n };\n Pusher.prototype.disconnect = function () {\n this.connection.disconnect();\n if (this.timelineSenderTimer) {\n this.timelineSenderTimer.ensureAborted();\n this.timelineSenderTimer = null;\n }\n };\n Pusher.prototype.bind = function (event_name, callback, context) {\n this.global_emitter.bind(event_name, callback, context);\n return this;\n };\n Pusher.prototype.unbind = function (event_name, callback, context) {\n this.global_emitter.unbind(event_name, callback, context);\n return this;\n };\n Pusher.prototype.bind_global = function (callback) {\n this.global_emitter.bind_global(callback);\n return this;\n };\n Pusher.prototype.unbind_global = function (callback) {\n this.global_emitter.unbind_global(callback);\n return this;\n };\n Pusher.prototype.unbind_all = function (callback) {\n this.global_emitter.unbind_all();\n return this;\n };\n Pusher.prototype.subscribeAll = function () {\n var channelName;\n for (channelName in this.channels.channels) {\n if (this.channels.channels.hasOwnProperty(channelName)) {\n this.subscribe(channelName);\n }\n }\n };\n Pusher.prototype.subscribe = function (channel_name) {\n var channel = this.channels.add(channel_name, this);\n if (channel.subscriptionPending && channel.subscriptionCancelled) {\n channel.reinstateSubscription();\n }\n else if (!channel.subscriptionPending &&\n this.connection.state === 'connected') {\n channel.subscribe();\n }\n return channel;\n };\n Pusher.prototype.unsubscribe = function (channel_name) {\n var channel = this.channels.find(channel_name);\n if (channel && channel.subscriptionPending) {\n channel.cancelSubscription();\n }\n else {\n channel = this.channels.remove(channel_name);\n if (channel && channel.subscribed) {\n channel.unsubscribe();\n }\n }\n };\n Pusher.prototype.send_event = function (event_name, data, channel) {\n return this.connection.send_event(event_name, data, channel);\n };\n Pusher.prototype.shouldUseTLS = function () {\n return this.config.useTLS;\n };\n Pusher.instances = [];\n Pusher.isReady = false;\n Pusher.logToConsole = false;\n Pusher.Runtime = runtime;\n Pusher.ScriptReceivers = runtime.ScriptReceivers;\n Pusher.DependenciesReceivers = runtime.DependenciesReceivers;\n Pusher.auth_callbacks = runtime.auth_callbacks;\n return Pusher;\n}());\n/* harmony default export */ var core_pusher = __webpack_exports__[\"default\"] = (pusher_Pusher);\nfunction checkAppKey(key) {\n if (key === null || key === undefined) {\n throw 'You must pass your app key when you instantiate Pusher.';\n }\n}\nruntime.setup(pusher_Pusher);\n\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=pusher.js.map"],"names":[],"mappings":";;;;;;oBAQA,AAAC,UAA0C,EAAM,EAAS,CAExD,GAAA,QAAiB,GAOnB,GAAG,OAAQ,UAAW,CACtB,MAAiB,UAAS,EAAS,CAEzB,GAAI,GAAmB,CAAA,EAGvB,WAA6B,EAAU,CAGtC,GAAG,EAAiB,GACnB,MAAO,GAAiB,GAAU,QAGnC,GAAI,GAAS,EAAiB,GAAY,CACzC,EAAG,EACH,EAAG,GACH,QAAS,CAAE,CACvB,EAGW,SAAQ,GAAU,KAAK,EAAO,QAAS,EAAQ,EAAO,QAAS,CAAmB,EAGlF,EAAO,EAAI,GAGJ,EAAO,OACd,CAID,SAAoB,EAAI,EAGxB,EAAoB,EAAI,EAGxB,EAAoB,EAAI,SAAS,EAAS,EAAM,EAAQ,CACvD,AAAI,EAAoB,EAAE,EAAS,CAAI,GACtC,OAAO,eAAe,EAAS,EAAM,CAAE,WAAY,GAAM,IAAK,CAAM,CAAE,CAElF,EAGU,EAAoB,EAAI,SAAS,EAAS,CACzC,AAAG,MAAO,SAAW,aAAe,OAAO,aAC1C,OAAO,eAAe,EAAS,OAAO,YAAa,CAAE,MAAO,QAAQ,CAAE,EAEvE,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAI,CAAE,CACvE,EAOU,EAAoB,EAAI,SAAS,EAAO,EA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