diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d203f04b..5ac320e65d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [3.0.5](https://github.com/socketio/socket.io/compare/3.0.4...3.0.5) (2021-01-05) + + +### Bug Fixes + +* properly clear timeout on connection failure ([170b739](https://github.com/socketio/socket.io/commit/170b739f147cb6c92b423729b877e242e376927d)) + + +### Reverts + +* restore the socket middleware functionality ([bf54327](https://github.com/socketio/socket.io/commit/bf5432742158e4d5ba2722cff4a614967dffa5b9)) + + ## [3.0.4](https://github.com/socketio/socket.io/compare/3.0.3...3.0.4) (2020-12-07) diff --git a/client-dist/socket.io.js b/client-dist/socket.io.js index 8bc57f9729..e334014c2f 100644 --- a/client-dist/socket.io.js +++ b/client-dist/socket.io.js @@ -1,6 +1,6 @@ /*! - * Socket.IO v3.0.4 - * (c) 2014-2020 Guillermo Rauch + * Socket.IO v3.0.5 + * (c) 2014-2021 Guillermo Rauch * Released under the MIT License. */ (function webpackUniversalModuleDefinition(root, factory) { @@ -12,17 +12,7 @@ exports["io"] = factory(); else root["io"] = factory(); -})((() => { - if (typeof self !== 'undefined') { - return self; - } else if (typeof window !== 'undefined') { - return window; - } else if (typeof global !== 'undefined') { - return global; - } else { - return Function('return this')(); - } - })(), function() { +})(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -279,8 +269,6 @@ var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket. var on_1 = __webpack_require__(/*! ./on */ "./build/on.js"); -var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js"); - var Backoff = __webpack_require__(/*! backo2 */ "./node_modules/backo2/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("socket.io-client:manager"); @@ -427,7 +415,7 @@ var Manager = /*#__PURE__*/function (_Emitter) { this._readyState = "opening"; this.skipReconnect = false; // emit `open` - var openSub = on_1.on(socket, "open", function () { + var openSubDestroy = on_1.on(socket, "open", function () { self.onopen(); fn && fn(); }); // emit `error` @@ -452,31 +440,29 @@ var Manager = /*#__PURE__*/function (_Emitter) { debug("connect attempt will timeout after %d", timeout); if (timeout === 0) { - openSub.destroy(); // prevents a race condition with the 'open' event + openSubDestroy(); // prevents a race condition with the 'open' event } // set timer var timer = setTimeout(function () { debug("connect attempt timed out after %d", timeout); - openSub.destroy(); + openSubDestroy(); socket.close(); socket.emit("error", new Error("timeout")); }, timeout); - this.subs.push({ - destroy: function destroy() { - clearTimeout(timer); - } + this.subs.push(function subDestroy() { + clearTimeout(timer); }); } - this.subs.push(openSub); + this.subs.push(openSubDestroy); this.subs.push(errorSub); return this; } /** * Alias for open() * - * @return {Manager} self + * @return self * @public */ @@ -504,7 +490,7 @@ var Manager = /*#__PURE__*/function (_Emitter) { var socket = this.engine; - this.subs.push(on_1.on(socket, "data", bind(this, "ondata")), on_1.on(socket, "ping", bind(this, "onping")), on_1.on(socket, "error", bind(this, "onerror")), on_1.on(socket, "close", bind(this, "onclose")), on_1.on(this.decoder, "decoded", bind(this, "ondecoded"))); + this.subs.push(on_1.on(socket, "ping", this.onping.bind(this)), on_1.on(socket, "data", this.ondata.bind(this)), on_1.on(socket, "error", this.onerror.bind(this)), on_1.on(socket, "close", this.onclose.bind(this)), on_1.on(this.decoder, "decoded", this.ondecoded.bind(this))); } /** * Called upon a ping. @@ -623,13 +609,10 @@ var Manager = /*#__PURE__*/function (_Emitter) { key: "cleanup", value: function cleanup() { debug("cleanup"); - var subsLength = this.subs.length; - - for (var i = 0; i < subsLength; i++) { - var sub = this.subs.shift(); - sub.destroy(); - } - + this.subs.forEach(function (subDestroy) { + return subDestroy(); + }); + this.subs.length = 0; this.decoder.destroy(); } /** @@ -732,10 +715,8 @@ var Manager = /*#__PURE__*/function (_Emitter) { } }); }, delay); - this.subs.push({ - destroy: function destroy() { - clearTimeout(timer); - } + this.subs.push(function subDestroy() { + clearTimeout(timer); }); } } @@ -780,10 +761,8 @@ exports.on = void 0; function on(obj, ev, fn) { obj.on(ev, fn); - return { - destroy: function destroy() { - obj.off(ev, fn); - } + return function subDestroy() { + obj.off(ev, fn); }; } @@ -844,8 +823,6 @@ var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/compo var on_1 = __webpack_require__(/*! ./on */ "./build/on.js"); -var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js"); - var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("socket.io-client:socket"); /** * Internal events. @@ -879,10 +856,10 @@ var Socket = /*#__PURE__*/function (_Emitter) { _classCallCheck(this, Socket); _this = _super.call(this); - _this.ids = 0; - _this.acks = {}; _this.receiveBuffer = []; _this.sendBuffer = []; + _this.ids = 0; + _this.acks = {}; _this.flags = {}; _this.io = io; _this.nsp = nsp; @@ -913,7 +890,7 @@ var Socket = /*#__PURE__*/function (_Emitter) { value: function subEvents() { if (this.subs) return; var io = this.io; - this.subs = [on_1.on(io, "open", bind(this, "onopen")), on_1.on(io, "packet", bind(this, "onpacket")), on_1.on(io, "close", bind(this, "onclose"))]; + this.subs = [on_1.on(io, "open", this.onopen.bind(this)), on_1.on(io, "packet", this.onpacket.bind(this)), on_1.on(io, "error", this.onerror.bind(this)), on_1.on(io, "close", this.onclose.bind(this))]; } /** * Whether the Socket will try to reconnect when its Manager connects or reconnects @@ -1051,6 +1028,20 @@ var Socket = /*#__PURE__*/function (_Emitter) { }); } } + /** + * Called upon engine or manager `error`. + * + * @param err + * @private + */ + + }, { + key: "onerror", + value: function onerror(err) { + if (!this.connected) { + _get(_getPrototypeOf(Socket.prototype), "emit", this).call(this, "connect_error", err); + } + } /** * Called upon engine `close`. * @@ -1281,11 +1272,10 @@ var Socket = /*#__PURE__*/function (_Emitter) { value: function destroy() { if (this.subs) { // clean subscriptions to avoid reconnections - for (var i = 0; i < this.subs.length; i++) { - this.subs[i].destroy(); - } - - this.subs = null; + this.subs.forEach(function (subDestroy) { + return subDestroy(); + }); + this.subs = undefined; } this.io["_destroy"](this); @@ -1620,121 +1610,6 @@ Backoff.prototype.setJitter = function (jitter) { /***/ }), -/***/ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js": -/*!*******************************************************************!*\ - !*** ./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/* - * base64-arraybuffer - * https://github.com/niklasvh/base64-arraybuffer - * - * Copyright (c) 2012 Niklas von Hertzen - * Licensed under the MIT license. - */ -(function () { - "use strict"; - - var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Use a lookup table to find the index. - - var lookup = new Uint8Array(256); - - for (var i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; - } - - exports.encode = function (arraybuffer) { - var bytes = new Uint8Array(arraybuffer), - i, - len = bytes.length, - base64 = ""; - - for (i = 0; i < len; i += 3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4]; - base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6]; - base64 += chars[bytes[i + 2] & 63]; - } - - if (len % 3 === 2) { - base64 = base64.substring(0, base64.length - 1) + "="; - } else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + "=="; - } - - return base64; - }; - - exports.decode = function (base64) { - var bufferLength = base64.length * 0.75, - len = base64.length, - i, - p = 0, - encoded1, - encoded2, - encoded3, - encoded4; - - if (base64[base64.length - 1] === "=") { - bufferLength--; - - if (base64[base64.length - 2] === "=") { - bufferLength--; - } - } - - var arraybuffer = new ArrayBuffer(bufferLength), - bytes = new Uint8Array(arraybuffer); - - for (i = 0; i < len; i += 4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i + 1)]; - encoded3 = lookup[base64.charCodeAt(i + 2)]; - encoded4 = lookup[base64.charCodeAt(i + 3)]; - bytes[p++] = encoded1 << 2 | encoded2 >> 4; - bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; - bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; - } - - return arraybuffer; - }; -})(); - -/***/ }), - -/***/ "./node_modules/component-bind/index.js": -/*!**********************************************!*\ - !*** ./node_modules/component-bind/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Slice reference. - */ -var slice = [].slice; -/** - * Bind `obj` to `fn`. - * - * @param {Object} obj - * @param {Function|String} fn or string - * @return {Function} - * @api public - */ - -module.exports = function (obj, fn) { - if ('string' == typeof fn) fn = obj[fn]; - if ('function' != typeof fn) throw new Error('bind() requires a function'); - var args = slice.call(arguments, 2); - return function () { - return fn.apply(obj, args.concat(slice.call(arguments))); - }; -}; - -/***/ }), - /***/ "./node_modules/component-emitter/index.js": /*!*************************************************!*\ !*** ./node_modules/component-emitter/index.js ***! @@ -1922,23 +1797,31 @@ Emitter.prototype.hasListeners = function (event) { /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(process) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/* eslint-env browser */ +/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ -exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); + +exports.destroy = function () { + var warned = false; + return function () { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +}(); /** * Colors. */ + exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, @@ -2007,20 +1890,16 @@ function formatArgs(args) { args.splice(lastC, 0, c); } /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. * * @api public */ -function log() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); -} +exports.log = console.debug || console.log || function () {}; /** * Save `namespaces`. * @@ -2134,15 +2013,11 @@ function setup(env) { createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); + createDebug.destroy = destroy; Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** * The currently active debug mode names, and names to skip. */ @@ -2184,6 +2059,7 @@ function setup(env) { function createDebug(namespace) { var prevTime; + var enableOverride = null; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { @@ -2215,7 +2091,7 @@ function setup(env) { args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { - return match; + return '%'; } index++; @@ -2238,33 +2114,29 @@ function setup(env) { } debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: function get() { + return enableOverride === null ? createDebug.enabled(namespace) : enableOverride; + }, + set: function set(v) { + enableOverride = v; + } + }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } - createDebug.instances.push(debug); return debug; } - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; @@ -2301,11 +2173,6 @@ function setup(env) { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } } /** * Disable debug output. @@ -2381,6 +2248,15 @@ function setup(env) { return val; } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + + + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } createDebug.enable(createDebug.load()); return createDebug; @@ -2471,7 +2347,7 @@ var transports = __webpack_require__(/*! ./transports/index */ "./node_modules/e var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); -var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:socket"); +var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")("engine.io-client:socket"); var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/index.js"); @@ -3663,7 +3539,7 @@ var _require = __webpack_require__(/*! ../util */ "./node_modules/engine.io-clie var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js"); -var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:polling-xhr"); +var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")("engine.io-client:polling-xhr"); /** * Empty function */ @@ -4079,7 +3955,7 @@ var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js"); -var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:polling"); +var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")("engine.io-client:polling"); var Polling = /*#__PURE__*/function (_Transport) { _inherits(Polling, _Transport); @@ -4369,7 +4245,7 @@ var _require2 = __webpack_require__(/*! ./websocket-constructor */ "./node_modul usingBrowserWebSocket = _require2.usingBrowserWebSocket, defaultBinaryType = _require2.defaultBinaryType; -var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:websocket"); // detect ReactNative environment +var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")("engine.io-client:websocket"); // detect ReactNative environment var isReactNative = typeof navigator !== "undefined" && typeof navigator.product === "string" && navigator.product.toLowerCase() === "reactnative"; @@ -4678,783 +4554,2045 @@ module.exports = function (opts) { /***/ }), -/***/ "./node_modules/engine.io-parser/lib/commons.js": -/*!******************************************************!*\ - !*** ./node_modules/engine.io-parser/lib/commons.js ***! - \******************************************************/ +/***/ "./node_modules/engine.io-client/node_modules/debug/src/browser.js": +/*!*************************************************************************!*\ + !*** ./node_modules/engine.io-client/node_modules/debug/src/browser.js ***! + \*************************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -var PACKET_TYPES = Object.create(null); // no Map = no polyfill +/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */ -PACKET_TYPES["open"] = "0"; -PACKET_TYPES["close"] = "1"; -PACKET_TYPES["ping"] = "2"; -PACKET_TYPES["pong"] = "3"; -PACKET_TYPES["message"] = "4"; -PACKET_TYPES["upgrade"] = "5"; -PACKET_TYPES["noop"] = "6"; -var PACKET_TYPES_REVERSE = Object.create(null); -Object.keys(PACKET_TYPES).forEach(function (key) { - PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; -}); -var ERROR_PACKET = { - type: "error", - data: "parser error" -}; -module.exports = { - PACKET_TYPES: PACKET_TYPES, - PACKET_TYPES_REVERSE: PACKET_TYPES_REVERSE, - ERROR_PACKET: ERROR_PACKET -}; +/** + * This is the web browser implementation of `debug()`. + */ +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); -/***/ }), +exports.destroy = function () { + var warned = false; + return function () { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +}(); +/** + * Colors. + */ -/***/ "./node_modules/engine.io-parser/lib/decodePacket.browser.js": -/*!*******************************************************************!*\ - !*** ./node_modules/engine.io-parser/lib/decodePacket.browser.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -var _require = __webpack_require__(/*! ./commons */ "./node_modules/engine.io-parser/lib/commons.js"), - PACKET_TYPES_REVERSE = _require.PACKET_TYPES_REVERSE, - ERROR_PACKET = _require.ERROR_PACKET; +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity -var withNativeArrayBuffer = typeof ArrayBuffer === "function"; -var base64decoder; +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. -if (withNativeArrayBuffer) { - base64decoder = __webpack_require__(/*! base64-arraybuffer */ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"); + + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } +/** + * Colorize log arguments if enabled. + * + * @api public + */ -var decodePacket = function decodePacket(encodedPacket, binaryType) { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType) - }; - } - var type = encodedPacket.charAt(0); +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); - if (type === "b") { - return { - type: "message", - data: decodeBase64Packet(encodedPacket.substring(1), binaryType) - }; + if (!this.useColors) { + return; } - var packetType = PACKET_TYPES_REVERSE[type]; + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into - if (!packetType) { - return ERROR_PACKET; + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } + + index++; + + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ + + +exports.log = console.debug || console.log || function () {}; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ - return encodedPacket.length > 1 ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1) - } : { - type: PACKET_TYPES_REVERSE[type] - }; -}; -var decodeBase64Packet = function decodeBase64Packet(data, binaryType) { - if (base64decoder) { - var decoded = base64decoder.decode(data); - return mapBinary(decoded, binaryType); - } else { - return { - base64: true, - data: data - }; // fallback for old browsers +function load() { + var r; + + try { + r = exports.storage.getItem('debug'); + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; } -}; -var mapBinary = function mapBinary(data, binaryType) { - switch (binaryType) { - case "blob": - return data instanceof ArrayBuffer ? new Blob([data]) : data; + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ - case "arraybuffer": - default: - return data; - // assuming the data is already an ArrayBuffer + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? } -}; +} -module.exports = decodePacket; +module.exports = __webpack_require__(/*! ./common */ "./node_modules/engine.io-client/node_modules/debug/src/common.js")(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) /***/ }), -/***/ "./node_modules/engine.io-parser/lib/encodePacket.browser.js": -/*!*******************************************************************!*\ - !*** ./node_modules/engine.io-parser/lib/encodePacket.browser.js ***! - \*******************************************************************/ +/***/ "./node_modules/engine.io-client/node_modules/debug/src/common.js": +/*!************************************************************************!*\ + !*** ./node_modules/engine.io-client/node_modules/debug/src/common.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -var _require = __webpack_require__(/*! ./commons */ "./node_modules/engine.io-parser/lib/commons.js"), - PACKET_TYPES = _require.PACKET_TYPES; +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]"; -var withNativeArrayBuffer = typeof ArrayBuffer === "function"; // ArrayBuffer.isView method is not defined in IE10 +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -var isView = function isView(obj) { - return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer; -}; +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -var encodePacket = function encodePacket(_ref, supportsBinary, callback) { - var type = _ref.type, - data = _ref.data; +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } - if (withNativeBlob && data instanceof Blob) { - if (supportsBinary) { - return callback(data); - } else { - return encodeBlobAsBase64(data, callback); - } - } else if (withNativeArrayBuffer && (data instanceof ArrayBuffer || isView(data))) { - if (supportsBinary) { - return callback(data instanceof ArrayBuffer ? data : data.buffer); - } else { - return encodeBlobAsBase64(new Blob([data]), callback); - } - } // plain string +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - return callback(PACKET_TYPES[type] + (data || "")); -}; +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug["default"] = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/engine.io-client/node_modules/ms/index.js"); + createDebug.destroy = destroy; + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * The currently active debug mode names, and names to skip. + */ -var encodeBlobAsBase64 = function encodeBlobAsBase64(data, callback) { - var fileReader = new FileReader(); + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ - fileReader.onload = function () { - var content = fileReader.result.split(",")[1]; - callback("b" + content); - }; + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ - return fileReader.readAsDataURL(data); -}; + function selectColor(namespace) { + var hash = 0; -module.exports = encodePacket; + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -/***/ }), + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } -/***/ "./node_modules/engine.io-parser/lib/index.js": -/*!****************************************************!*\ - !*** ./node_modules/engine.io-parser/lib/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ -var encodePacket = __webpack_require__(/*! ./encodePacket */ "./node_modules/engine.io-parser/lib/encodePacket.browser.js"); + function createDebug(namespace) { + var prevTime; + var enableOverride = null; -var decodePacket = __webpack_require__(/*! ./decodePacket */ "./node_modules/engine.io-parser/lib/decodePacket.browser.js"); + function debug() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } -var SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text + // Disabled? + if (!debug.enabled) { + return; + } -var encodePayload = function encodePayload(packets, callback) { - // some packets may be added to the array while encoding, so the initial length must be saved - var length = packets.length; - var encodedPackets = new Array(length); - var count = 0; - packets.forEach(function (packet, i) { - // force base64 encoding for binary packets - encodePacket(packet, false, function (encodedPacket) { - encodedPackets[i] = encodedPacket; + var self = debug; // Set `diff` timestamp + + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + + index++; + var formatter = createDebug.formatters[format]; + + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: function get() { + return enableOverride === null ? createDebug.enabled(namespace) : enableOverride; + }, + set: function set(v) { + enableOverride = v; + } + }); // Env-specific initialization logic for debug instances + + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + + + function disable() { + var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { + return '-' + namespace; + }))).join(','); + createDebug.enable(''); + return namespaces; + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + var i; + var len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + + + function toNamespace(regexp) { + return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + + return val; + } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + + + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + return createDebug; +} + +module.exports = setup; + +/***/ }), + +/***/ "./node_modules/engine.io-client/node_modules/ms/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/engine.io-client/node_modules/ms/index.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/** + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + + var type = _typeof(val); + + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options["long"] ? fmtLong(val) : fmtShort(val); + } + + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + +function parse(str) { + str = String(str); + + if (str.length > 100) { + return; + } + + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); + + if (!match) { + return; + } + + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + + case 'weeks': + case 'week': + case 'w': + return n * w; + + case 'days': + case 'day': + case 'd': + return n * d; + + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + + return ms + ' ms'; +} +/** + * Pluralization helper. + */ + + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + +/***/ }), + +/***/ "./node_modules/engine.io-parser/lib/commons.js": +/*!******************************************************!*\ + !*** ./node_modules/engine.io-parser/lib/commons.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var PACKET_TYPES = Object.create(null); // no Map = no polyfill + +PACKET_TYPES["open"] = "0"; +PACKET_TYPES["close"] = "1"; +PACKET_TYPES["ping"] = "2"; +PACKET_TYPES["pong"] = "3"; +PACKET_TYPES["message"] = "4"; +PACKET_TYPES["upgrade"] = "5"; +PACKET_TYPES["noop"] = "6"; +var PACKET_TYPES_REVERSE = Object.create(null); +Object.keys(PACKET_TYPES).forEach(function (key) { + PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; +}); +var ERROR_PACKET = { + type: "error", + data: "parser error" +}; +module.exports = { + PACKET_TYPES: PACKET_TYPES, + PACKET_TYPES_REVERSE: PACKET_TYPES_REVERSE, + ERROR_PACKET: ERROR_PACKET +}; + +/***/ }), + +/***/ "./node_modules/engine.io-parser/lib/decodePacket.browser.js": +/*!*******************************************************************!*\ + !*** ./node_modules/engine.io-parser/lib/decodePacket.browser.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _require = __webpack_require__(/*! ./commons */ "./node_modules/engine.io-parser/lib/commons.js"), + PACKET_TYPES_REVERSE = _require.PACKET_TYPES_REVERSE, + ERROR_PACKET = _require.ERROR_PACKET; + +var withNativeArrayBuffer = typeof ArrayBuffer === "function"; +var base64decoder; + +if (withNativeArrayBuffer) { + base64decoder = __webpack_require__(/*! base64-arraybuffer */ "./node_modules/engine.io-parser/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"); +} + +var decodePacket = function decodePacket(encodedPacket, binaryType) { + if (typeof encodedPacket !== "string") { + return { + type: "message", + data: mapBinary(encodedPacket, binaryType) + }; + } + + var type = encodedPacket.charAt(0); + + if (type === "b") { + return { + type: "message", + data: decodeBase64Packet(encodedPacket.substring(1), binaryType) + }; + } + + var packetType = PACKET_TYPES_REVERSE[type]; + + if (!packetType) { + return ERROR_PACKET; + } + + return encodedPacket.length > 1 ? { + type: PACKET_TYPES_REVERSE[type], + data: encodedPacket.substring(1) + } : { + type: PACKET_TYPES_REVERSE[type] + }; +}; + +var decodeBase64Packet = function decodeBase64Packet(data, binaryType) { + if (base64decoder) { + var decoded = base64decoder.decode(data); + return mapBinary(decoded, binaryType); + } else { + return { + base64: true, + data: data + }; // fallback for old browsers + } +}; + +var mapBinary = function mapBinary(data, binaryType) { + switch (binaryType) { + case "blob": + return data instanceof ArrayBuffer ? new Blob([data]) : data; + + case "arraybuffer": + default: + return data; + // assuming the data is already an ArrayBuffer + } +}; + +module.exports = decodePacket; + +/***/ }), + +/***/ "./node_modules/engine.io-parser/lib/encodePacket.browser.js": +/*!*******************************************************************!*\ + !*** ./node_modules/engine.io-parser/lib/encodePacket.browser.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var _require = __webpack_require__(/*! ./commons */ "./node_modules/engine.io-parser/lib/commons.js"), + PACKET_TYPES = _require.PACKET_TYPES; + +var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]"; +var withNativeArrayBuffer = typeof ArrayBuffer === "function"; // ArrayBuffer.isView method is not defined in IE10 + +var isView = function isView(obj) { + return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer; +}; + +var encodePacket = function encodePacket(_ref, supportsBinary, callback) { + var type = _ref.type, + data = _ref.data; + + if (withNativeBlob && data instanceof Blob) { + if (supportsBinary) { + return callback(data); + } else { + return encodeBlobAsBase64(data, callback); + } + } else if (withNativeArrayBuffer && (data instanceof ArrayBuffer || isView(data))) { + if (supportsBinary) { + return callback(data instanceof ArrayBuffer ? data : data.buffer); + } else { + return encodeBlobAsBase64(new Blob([data]), callback); + } + } // plain string + + + return callback(PACKET_TYPES[type] + (data || "")); +}; + +var encodeBlobAsBase64 = function encodeBlobAsBase64(data, callback) { + var fileReader = new FileReader(); + + fileReader.onload = function () { + var content = fileReader.result.split(",")[1]; + callback("b" + content); + }; + + return fileReader.readAsDataURL(data); +}; + +module.exports = encodePacket; + +/***/ }), + +/***/ "./node_modules/engine.io-parser/lib/index.js": +/*!****************************************************!*\ + !*** ./node_modules/engine.io-parser/lib/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var encodePacket = __webpack_require__(/*! ./encodePacket */ "./node_modules/engine.io-parser/lib/encodePacket.browser.js"); + +var decodePacket = __webpack_require__(/*! ./decodePacket */ "./node_modules/engine.io-parser/lib/decodePacket.browser.js"); + +var SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text + +var encodePayload = function encodePayload(packets, callback) { + // some packets may be added to the array while encoding, so the initial length must be saved + var length = packets.length; + var encodedPackets = new Array(length); + var count = 0; + packets.forEach(function (packet, i) { + // force base64 encoding for binary packets + encodePacket(packet, false, function (encodedPacket) { + encodedPackets[i] = encodedPacket; + + if (++count === length) { + callback(encodedPackets.join(SEPARATOR)); + } + }); + }); +}; + +var decodePayload = function decodePayload(encodedPayload, binaryType) { + var encodedPackets = encodedPayload.split(SEPARATOR); + var packets = []; + + for (var i = 0; i < encodedPackets.length; i++) { + var decodedPacket = decodePacket(encodedPackets[i], binaryType); + packets.push(decodedPacket); + + if (decodedPacket.type === "error") { + break; + } + } + + return packets; +}; + +module.exports = { + protocol: 4, + encodePacket: encodePacket, + encodePayload: encodePayload, + decodePacket: decodePacket, + decodePayload: decodePayload +}; + +/***/ }), + +/***/ "./node_modules/engine.io-parser/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/engine.io-parser/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ +(function (chars) { + "use strict"; + + exports.encode = function (arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, + len = bytes.length, + base64 = ""; + + for (i = 0; i < len; i += 3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4]; + base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6]; + base64 += chars[bytes[i + 2] & 63]; + } + + if (len % 3 === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function (base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, + i, + p = 0, + encoded1, + encoded2, + encoded3, + encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i += 4) { + encoded1 = chars.indexOf(base64[i]); + encoded2 = chars.indexOf(base64[i + 1]); + encoded3 = chars.indexOf(base64[i + 2]); + encoded4 = chars.indexOf(base64[i + 3]); + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + + return arraybuffer; + }; +})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); + +/***/ }), + +/***/ "./node_modules/has-cors/index.js": +/*!****************************************!*\ + !*** ./node_modules/has-cors/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Module exports. + * + * Logic borrowed from Modernizr: + * + * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js + */ +try { + module.exports = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest(); +} catch (err) { + // if XMLHttp support is disabled in IE then it will throw + // when trying to create + module.exports = false; +} + +/***/ }), + +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/** + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + + var type = _typeof(val); + + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options["long"] ? fmtLong(val) : fmtShort(val); + } + + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + +function parse(str) { + str = String(str); + + if (str.length > 100) { + return; + } + + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); + + if (!match) { + return; + } + + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + + case 'weeks': + case 'week': + case 'w': + return n * w; + + case 'days': + case 'day': + case 'd': + return n * d; + + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + + return ms + ' ms'; +} +/** + * Pluralization helper. + */ + + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + +/***/ }), + +/***/ "./node_modules/parseqs/index.js": +/*!***************************************!*\ + !*** ./node_modules/parseqs/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Compiles a querystring + * Returns string representation of the object + * + * @param {Object} + * @api private + */ +exports.encode = function (obj) { + var str = ''; + + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + if (str.length) str += '&'; + str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); + } + } + + return str; +}; +/** + * Parses a simple querystring into an object + * + * @param {String} qs + * @api private + */ + + +exports.decode = function (qs) { + var qry = {}; + var pairs = qs.split('&'); + + for (var i = 0, l = pairs.length; i < l; i++) { + var pair = pairs[i].split('='); + qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); + } + + return qry; +}; + +/***/ }), + +/***/ "./node_modules/parseuri/index.js": +/*!****************************************!*\ + !*** ./node_modules/parseuri/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Parses an URI + * + * @author Steven Levithan (MIT license) + * @api private + */ +var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; +var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor']; + +module.exports = function parseuri(str) { + var src = str, + b = str.indexOf('['), + e = str.indexOf(']'); + + if (b != -1 && e != -1) { + str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); + } + + var m = re.exec(str || ''), + uri = {}, + i = 14; + + while (i--) { + uri[parts[i]] = m[i] || ''; + } + + if (b != -1 && e != -1) { + uri.source = src; + uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); + uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); + uri.ipv6uri = true; + } + + uri.pathNames = pathNames(uri, uri['path']); + uri.queryKey = queryKey(uri, uri['query']); + return uri; +}; + +function pathNames(obj, path) { + var regx = /\/{2,9}/g, + names = path.replace(regx, "/").split("/"); + + if (path.substr(0, 1) == '/' || path.length === 0) { + names.splice(0, 1); + } + + if (path.substr(path.length - 1, 1) == '/') { + names.splice(names.length - 1, 1); + } + + return names; +} + +function queryKey(uri, query) { + var data = {}; + query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) { + if ($1) { + data[$1] = $2; + } + }); + return data; +} + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} + +function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); +} + +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +})(); + +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } // if setTimeout wasn't available but was latter defined + + + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } +} + +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } // if clearTimeout wasn't available but was latter defined + + + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } +} + +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + + draining = false; + + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + + while (len) { + currentQueue = queue; + queue = []; + + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + + queueIndex = -1; + len = queue.length; + } + + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + + queue.push(new Item(fun, args)); + + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; // v8 likes predictible objects + + +function Item(fun, array) { + this.fun = fun; + this.array = array; +} + +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues + +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; - if (++count === length) { - callback(encodedPackets.join(SEPARATOR)); - } - }); - }); +process.listeners = function (name) { + return []; }; -var decodePayload = function decodePayload(encodedPayload, binaryType) { - var encodedPackets = encodedPayload.split(SEPARATOR); - var packets = []; - - for (var i = 0; i < encodedPackets.length; i++) { - var decodedPacket = decodePacket(encodedPackets[i], binaryType); - packets.push(decodedPacket); +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; - if (decodedPacket.type === "error") { - break; - } - } +process.cwd = function () { + return '/'; +}; - return packets; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); }; -module.exports = { - protocol: 4, - encodePacket: encodePacket, - encodePayload: encodePayload, - decodePacket: decodePacket, - decodePayload: decodePayload +process.umask = function () { + return 0; }; /***/ }), -/***/ "./node_modules/has-cors/index.js": -/*!****************************************!*\ - !*** ./node_modules/has-cors/index.js ***! - \****************************************/ +/***/ "./node_modules/socket.io-parser/dist/binary.js": +/*!******************************************************!*\ + !*** ./node_modules/socket.io-parser/dist/binary.js ***! + \******************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reconstructPacket = exports.deconstructPacket = void 0; +var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); /** - * Module exports. - * - * Logic borrowed from Modernizr: + * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder. * - * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js + * @param {Object} packet - socket.io event packet + * @return {Object} with deconstructed packet and list of buffers + * @public */ -try { - module.exports = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest(); -} catch (err) { - // if XMLHttp support is disabled in IE then it will throw - // when trying to create - module.exports = false; + + +function deconstructPacket(packet) { + var buffers = []; + var packetData = packet.data; + var pack = packet; + pack.data = _deconstructPacket(packetData, buffers); + pack.attachments = buffers.length; // number of binary 'attachments' + + return { + packet: pack, + buffers: buffers + }; } -/***/ }), +exports.deconstructPacket = deconstructPacket; -/***/ "./node_modules/ms/index.js": -/*!**********************************!*\ - !*** ./node_modules/ms/index.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +function _deconstructPacket(data, buffers) { + if (!data) return data; -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + if (is_binary_1.isBinary(data)) { + var placeholder = { + _placeholder: true, + num: buffers.length + }; + buffers.push(data); + return placeholder; + } else if (Array.isArray(data)) { + var newData = new Array(data.length); -/** - * Helpers. - */ -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ + for (var i = 0; i < data.length; i++) { + newData[i] = _deconstructPacket(data[i], buffers); + } -module.exports = function (val, options) { - options = options || {}; + return newData; + } else if (_typeof(data) === "object" && !(data instanceof Date)) { + var _newData = {}; - var type = _typeof(val); + for (var key in data) { + if (data.hasOwnProperty(key)) { + _newData[key] = _deconstructPacket(data[key], buffers); + } + } - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options["long"] ? fmtLong(val) : fmtShort(val); + return _newData; } - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); -}; + return data; +} /** - * Parse the given `str` and return milliseconds. + * Reconstructs a binary packet from its placeholder packet and buffers * - * @param {String} str - * @return {Number} - * @api private + * @param {Object} packet - event packet with placeholders + * @param {Array} buffers - binary buffers to put in placeholder positions + * @return {Object} reconstructed packet + * @public */ -function parse(str) { - str = String(str); +function reconstructPacket(packet, buffers) { + packet.data = _reconstructPacket(packet.data, buffers); + packet.attachments = undefined; // no longer useful - if (str.length > 100) { - return; - } + return packet; +} - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); +exports.reconstructPacket = reconstructPacket; - if (!match) { - return; +function _reconstructPacket(data, buffers) { + if (!data) return data; + + if (data && data._placeholder) { + return buffers[data.num]; // appropriate buffer (should be natural order anyway) + } else if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + data[i] = _reconstructPacket(data[i], buffers); + } + } else if (_typeof(data) === "object") { + for (var key in data) { + if (data.hasOwnProperty(key)) { + data[key] = _reconstructPacket(data[key], buffers); + } + } } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); + return data; +} - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; +/***/ }), - case 'weeks': - case 'week': - case 'w': - return n * w; +/***/ "./node_modules/socket.io-parser/dist/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/socket.io-parser/dist/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - case 'days': - case 'day': - case 'd': - return n * d; +"use strict"; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; +function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - default: - return undefined; - } -} -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function fmtShort(ms) { - var msAbs = Math.abs(ms); +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Decoder = exports.Encoder = exports.PacketType = exports.protocol = void 0; - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } +var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } +var binary_1 = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/dist/binary.js"); - return ms + 'ms'; -} +var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); + +var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-parser/node_modules/debug/src/browser.js")("socket.io-parser"); /** - * Long format for `ms`. + * Protocol version. * - * @param {Number} ms - * @return {String} - * @api private + * @public */ -function fmtLong(ms) { - var msAbs = Math.abs(ms); +exports.protocol = 5; +var PacketType; - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } +(function (PacketType) { + PacketType[PacketType["CONNECT"] = 0] = "CONNECT"; + PacketType[PacketType["DISCONNECT"] = 1] = "DISCONNECT"; + PacketType[PacketType["EVENT"] = 2] = "EVENT"; + PacketType[PacketType["ACK"] = 3] = "ACK"; + PacketType[PacketType["CONNECT_ERROR"] = 4] = "CONNECT_ERROR"; + PacketType[PacketType["BINARY_EVENT"] = 5] = "BINARY_EVENT"; + PacketType[PacketType["BINARY_ACK"] = 6] = "BINARY_ACK"; +})(PacketType = exports.PacketType || (exports.PacketType = {})); +/** + * A socket.io Encoder instance + */ - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); +var Encoder = /*#__PURE__*/function () { + function Encoder() { + _classCallCheck(this, Encoder); } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } + _createClass(Encoder, [{ + key: "encode", - return ms + ' ms'; -} -/** - * Pluralization helper. - */ + /** + * Encode a packet as a single string if non-binary, or as a + * buffer sequence, depending on packet type. + * + * @param {Object} obj - packet object + */ + value: function encode(obj) { + debug("encoding packet %j", obj); + if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) { + if (is_binary_1.hasBinary(obj)) { + obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK; + return this.encodeAsBinary(obj); + } + } -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} + return [this.encodeAsString(obj)]; + } + /** + * Encode packet as string. + */ -/***/ }), + }, { + key: "encodeAsString", + value: function encodeAsString(obj) { + // first is type + var str = "" + obj.type; // attachments if we have them -/***/ "./node_modules/parseqs/index.js": -/*!***************************************!*\ - !*** ./node_modules/parseqs/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { + str += obj.attachments + "-"; + } // if we have a namespace other than `/` + // we append it followed by a comma `,` -/** - * Compiles a querystring - * Returns string representation of the object - * - * @param {Object} - * @api private - */ -exports.encode = function (obj) { - var str = ''; - for (var i in obj) { - if (obj.hasOwnProperty(i)) { - if (str.length) str += '&'; - str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); - } - } + if (obj.nsp && "/" !== obj.nsp) { + str += obj.nsp + ","; + } // immediately followed by the id - return str; -}; -/** - * Parses a simple querystring into an object - * - * @param {String} qs - * @api private - */ + if (null != obj.id) { + str += obj.id; + } // json data -exports.decode = function (qs) { - var qry = {}; - var pairs = qs.split('&'); - for (var i = 0, l = pairs.length; i < l; i++) { - var pair = pairs[i].split('='); - qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); - } + if (null != obj.data) { + str += JSON.stringify(obj.data); + } - return qry; -}; + debug("encoded %j as %s", obj, str); + return str; + } + /** + * Encode packet as 'buffer sequence' by removing blobs, and + * deconstructing packet into object with placeholders and + * a list of buffers. + */ -/***/ }), + }, { + key: "encodeAsBinary", + value: function encodeAsBinary(obj) { + var deconstruction = binary_1.deconstructPacket(obj); + var pack = this.encodeAsString(deconstruction.packet); + var buffers = deconstruction.buffers; + buffers.unshift(pack); // add packet info to beginning of data list -/***/ "./node_modules/parseuri/index.js": -/*!****************************************!*\ - !*** ./node_modules/parseuri/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + return buffers; // write all the buffers + } + }]); + return Encoder; +}(); + +exports.Encoder = Encoder; /** - * Parses an URI + * A socket.io Decoder instance * - * @author Steven Levithan (MIT license) - * @api private + * @return {Object} decoder */ -var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; -var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor']; -module.exports = function parseuri(str) { - var src = str, - b = str.indexOf('['), - e = str.indexOf(']'); +var Decoder = /*#__PURE__*/function (_Emitter) { + _inherits(Decoder, _Emitter); - if (b != -1 && e != -1) { - str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); - } + var _super = _createSuper(Decoder); - var m = re.exec(str || ''), - uri = {}, - i = 14; + function Decoder() { + _classCallCheck(this, Decoder); - while (i--) { - uri[parts[i]] = m[i] || ''; + return _super.call(this); } + /** + * Decodes an encoded packet string into packet JSON. + * + * @param {String} obj - encoded packet + */ - if (b != -1 && e != -1) { - uri.source = src; - uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); - uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); - uri.ipv6uri = true; - } - uri.pathNames = pathNames(uri, uri['path']); - uri.queryKey = queryKey(uri, uri['query']); - return uri; -}; + _createClass(Decoder, [{ + key: "add", + value: function add(obj) { + var packet; -function pathNames(obj, path) { - var regx = /\/{2,9}/g, - names = path.replace(regx, "/").split("/"); + if (typeof obj === "string") { + packet = this.decodeString(obj); - if (path.substr(0, 1) == '/' || path.length === 0) { - names.splice(0, 1); - } + if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) { + // binary packet's json + this.reconstructor = new BinaryReconstructor(packet); // no attachments, labeled binary but no binary data to follow - if (path.substr(path.length - 1, 1) == '/') { - names.splice(names.length - 1, 1); - } + if (packet.attachments === 0) { + _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); + } + } else { + // non-binary full packet + _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); + } + } else if (is_binary_1.isBinary(obj) || obj.base64) { + // raw binary data + if (!this.reconstructor) { + throw new Error("got binary data when not reconstructing a packet"); + } else { + packet = this.reconstructor.takeBinaryData(obj); - return names; -} + if (packet) { + // received final buffer + this.reconstructor = null; -function queryKey(uri, query) { - var data = {}; - query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) { - if ($1) { - data[$1] = $2; + _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); + } + } + } else { + throw new Error("Unknown type: " + obj); + } } - }); - return data; -} + /** + * Decode a packet String (JSON data) + * + * @param {String} str + * @return {Object} packet + */ -/***/ }), + }, { + key: "decodeString", + value: function decodeString(str) { + var i = 0; // look up type -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + var p = { + type: Number(str.charAt(0)) + }; -// shim for using process in browser -var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. + if (PacketType[p.type] === undefined) { + throw new Error("unknown packet type " + p.type); + } // look up attachments if type binary -var cachedSetTimeout; -var cachedClearTimeout; -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} + if (p.type === PacketType.BINARY_EVENT || p.type === PacketType.BINARY_ACK) { + var start = i + 1; -function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); -} + while (str.charAt(++i) !== "-" && i != str.length) {} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } + var buf = str.substring(start, i); - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -})(); + if (buf != Number(buf) || str.charAt(i) !== "-") { + throw new Error("Illegal attachments"); + } -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined + p.attachments = Number(buf); + } // look up namespace (if any) - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } + if ("/" === str.charAt(i + 1)) { + var _start = i + 1; - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } -} + while (++i) { + var c = str.charAt(i); + if ("," === c) break; + if (i === str.length) break; + } -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined + p.nsp = str.substring(_start, i); + } else { + p.nsp = "/"; + } // look up id - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } + var next = str.charAt(i + 1); - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } -} + if ("" !== next && Number(next) == next) { + var _start2 = i + 1; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; + while (++i) { + var _c = str.charAt(i); -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } + if (null == _c || Number(_c) != _c) { + --i; + break; + } - draining = false; + if (i === str.length) break; + } - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } + p.id = Number(str.substring(_start2, i + 1)); + } // look up json data - if (queue.length) { - drainQueue(); - } -} -function drainQueue() { - if (draining) { - return; - } + if (str.charAt(++i)) { + var payload = tryParse(str.substr(i)); - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; + if (Decoder.isPayloadValid(p.type, payload)) { + p.data = payload; + } else { + throw new Error("invalid payload"); + } + } - while (len) { - currentQueue = queue; - queue = []; + debug("decoded %s as %j", str, p); + return p; + } + }, { + key: "destroy", - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); + /** + * Deallocates a parser's resources + */ + value: function destroy() { + if (this.reconstructor) { + this.reconstructor.finishedReconstruction(); } } + }], [{ + key: "isPayloadValid", + value: function isPayloadValid(type, payload) { + switch (type) { + case PacketType.CONNECT: + return _typeof(payload) === "object"; - queueIndex = -1; - len = queue.length; - } + case PacketType.DISCONNECT: + return payload === undefined; - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} + case PacketType.CONNECT_ERROR: + return typeof payload === "string" || _typeof(payload) === "object"; -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); + case PacketType.EVENT: + case PacketType.BINARY_EVENT: + return Array.isArray(payload) && typeof payload[0] === "string"; - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; + case PacketType.ACK: + case PacketType.BINARY_ACK: + return Array.isArray(payload); + } } - } - - queue.push(new Item(fun, args)); + }]); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; // v8 likes predictible objects + return Decoder; +}(Emitter); +exports.Decoder = Decoder; -function Item(fun, array) { - this.fun = fun; - this.array = array; +function tryParse(str) { + try { + return JSON.parse(str); + } catch (e) { + return false; + } } +/** + * A manager of a binary event's 'buffer sequence'. Should + * be constructed whenever a packet of type BINARY_EVENT is + * decoded. + * + * @param {Object} packet + * @return {BinaryReconstructor} initialized reconstructor + */ -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; +var BinaryReconstructor = /*#__PURE__*/function () { + function BinaryReconstructor(packet) { + _classCallCheck(this, BinaryReconstructor); -function noop() {} + this.packet = packet; + this.buffers = []; + this.reconPack = packet; + } + /** + * Method to be called when binary data received from connection + * after a BINARY_EVENT packet. + * + * @param {Buffer | ArrayBuffer} binData - the raw binary data received + * @return {null | Object} returns null if more binary data is expected or + * a reconstructed packet object if all buffers have been received. + */ -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; -process.listeners = function (name) { - return []; -}; + _createClass(BinaryReconstructor, [{ + key: "takeBinaryData", + value: function takeBinaryData(binData) { + this.buffers.push(binData); -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; + if (this.buffers.length === this.reconPack.attachments) { + // done with buffer list + var packet = binary_1.reconstructPacket(this.reconPack, this.buffers); + this.finishedReconstruction(); + return packet; + } -process.cwd = function () { - return '/'; -}; + return null; + } + /** + * Cleans up binary packet reconstruction variables. + */ -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; + }, { + key: "finishedReconstruction", + value: function finishedReconstruction() { + this.reconPack = null; + this.buffers = []; + } + }]); -process.umask = function () { - return 0; -}; + return BinaryReconstructor; +}(); /***/ }), -/***/ "./node_modules/socket.io-parser/dist/binary.js": -/*!******************************************************!*\ - !*** ./node_modules/socket.io-parser/dist/binary.js ***! - \******************************************************/ +/***/ "./node_modules/socket.io-parser/dist/is-binary.js": +/*!*********************************************************!*\ + !*** ./node_modules/socket.io-parser/dist/is-binary.js ***! + \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -5466,579 +6604,729 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi Object.defineProperty(exports, "__esModule", { value: true }); -exports.reconstructPacket = exports.deconstructPacket = void 0; +exports.hasBinary = exports.isBinary = void 0; +var withNativeArrayBuffer = typeof ArrayBuffer === "function"; -var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); +var isView = function isView(obj) { + return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer; +}; + +var toString = Object.prototype.toString; +var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString.call(Blob) === "[object BlobConstructor]"; +var withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString.call(File) === "[object FileConstructor]"; /** - * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder. + * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File. * - * @param {Object} packet - socket.io event packet - * @return {Object} with deconstructed packet and list of buffers - * @public + * @private */ - -function deconstructPacket(packet) { - var buffers = []; - var packetData = packet.data; - var pack = packet; - pack.data = _deconstructPacket(packetData, buffers); - pack.attachments = buffers.length; // number of binary 'attachments' - - return { - packet: pack, - buffers: buffers - }; +function isBinary(obj) { + return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; } -exports.deconstructPacket = deconstructPacket; - -function _deconstructPacket(data, buffers) { - if (!data) return data; - - if (is_binary_1.isBinary(data)) { - var placeholder = { - _placeholder: true, - num: buffers.length - }; - buffers.push(data); - return placeholder; - } else if (Array.isArray(data)) { - var newData = new Array(data.length); - - for (var i = 0; i < data.length; i++) { - newData[i] = _deconstructPacket(data[i], buffers); - } +exports.isBinary = isBinary; - return newData; - } else if (_typeof(data) === "object" && !(data instanceof Date)) { - var _newData = {}; +function hasBinary(obj, toJSON) { + if (!obj || _typeof(obj) !== "object") { + return false; + } - for (var key in data) { - if (data.hasOwnProperty(key)) { - _newData[key] = _deconstructPacket(data[key], buffers); + if (Array.isArray(obj)) { + for (var i = 0, l = obj.length; i < l; i++) { + if (hasBinary(obj[i])) { + return true; } } - return _newData; + return false; } - return data; -} -/** - * Reconstructs a binary packet from its placeholder packet and buffers - * - * @param {Object} packet - event packet with placeholders - * @param {Array} buffers - binary buffers to put in placeholder positions - * @return {Object} reconstructed packet - * @public - */ - - -function reconstructPacket(packet, buffers) { - packet.data = _reconstructPacket(packet.data, buffers); - packet.attachments = undefined; // no longer useful - - return packet; -} - -exports.reconstructPacket = reconstructPacket; + if (isBinary(obj)) { + return true; + } -function _reconstructPacket(data, buffers) { - if (!data) return data; + if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) { + return hasBinary(obj.toJSON(), true); + } - if (data && data._placeholder) { - return buffers[data.num]; // appropriate buffer (should be natural order anyway) - } else if (Array.isArray(data)) { - for (var i = 0; i < data.length; i++) { - data[i] = _reconstructPacket(data[i], buffers); - } - } else if (_typeof(data) === "object") { - for (var key in data) { - if (data.hasOwnProperty(key)) { - data[key] = _reconstructPacket(data[key], buffers); - } + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { + return true; } } - return data; + return false; } +exports.hasBinary = hasBinary; + /***/ }), -/***/ "./node_modules/socket.io-parser/dist/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/socket.io-parser/dist/index.js ***! - \*****************************************************/ +/***/ "./node_modules/socket.io-parser/node_modules/debug/src/browser.js": +/*!*************************************************************************!*\ + !*** ./node_modules/socket.io-parser/node_modules/debug/src/browser.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } +/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */ -function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } +/** + * This is the web browser implementation of `debug()`. + */ +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } +exports.destroy = function () { + var warned = false; + return function () { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +}(); +/** + * Colors. + */ -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ +// eslint-disable-next-line complexity -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } // Internet Explorer and Edge do not support colors. -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Decoder = exports.Encoder = exports.PacketType = exports.protocol = void 0; + if (!this.useColors) { + return; + } -var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into -var binary_1 = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/dist/binary.js"); + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') { + return; + } -var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); + index++; -var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("socket.io-parser"); + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} /** - * Protocol version. + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. * - * @public + * @api public */ -exports.protocol = 5; -var PacketType; - -(function (PacketType) { - PacketType[PacketType["CONNECT"] = 0] = "CONNECT"; - PacketType[PacketType["DISCONNECT"] = 1] = "DISCONNECT"; - PacketType[PacketType["EVENT"] = 2] = "EVENT"; - PacketType[PacketType["ACK"] = 3] = "ACK"; - PacketType[PacketType["CONNECT_ERROR"] = 4] = "CONNECT_ERROR"; - PacketType[PacketType["BINARY_EVENT"] = 5] = "BINARY_EVENT"; - PacketType[PacketType["BINARY_ACK"] = 6] = "BINARY_ACK"; -})(PacketType = exports.PacketType || (exports.PacketType = {})); +exports.log = console.debug || console.log || function () {}; /** - * A socket.io Encoder instance + * Save `namespaces`. + * + * @param {String} namespaces + * @api private */ -var Encoder = /*#__PURE__*/function () { - function Encoder() { - _classCallCheck(this, Encoder); +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ - _createClass(Encoder, [{ - key: "encode", - - /** - * Encode a packet as a single string if non-binary, or as a - * buffer sequence, depending on packet type. - * - * @param {Object} obj - packet object - */ - value: function encode(obj) { - debug("encoding packet %j", obj); - if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) { - if (is_binary_1.hasBinary(obj)) { - obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK; - return this.encodeAsBinary(obj); - } - } +function load() { + var r; - return [this.encodeAsString(obj)]; - } - /** - * Encode packet as string. - */ + try { + r = exports.storage.getItem('debug'); + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - }, { - key: "encodeAsString", - value: function encodeAsString(obj) { - // first is type - var str = "" + obj.type; // attachments if we have them - if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { - str += obj.attachments + "-"; - } // if we have a namespace other than `/` - // we append it followed by a comma `,` + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ - if (obj.nsp && "/" !== obj.nsp) { - str += obj.nsp + ","; - } // immediately followed by the id +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } +} - if (null != obj.id) { - str += obj.id; - } // json data +module.exports = __webpack_require__(/*! ./common */ "./node_modules/socket.io-parser/node_modules/debug/src/common.js")(exports); +var formatters = module.exports.formatters; +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) - if (null != obj.data) { - str += JSON.stringify(obj.data); - } +/***/ }), - debug("encoded %j as %s", obj, str); - return str; - } - /** - * Encode packet as 'buffer sequence' by removing blobs, and - * deconstructing packet into object with placeholders and - * a list of buffers. - */ +/***/ "./node_modules/socket.io-parser/node_modules/debug/src/common.js": +/*!************************************************************************!*\ + !*** ./node_modules/socket.io-parser/node_modules/debug/src/common.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - }, { - key: "encodeAsBinary", - value: function encodeAsBinary(obj) { - var deconstruction = binary_1.deconstructPacket(obj); - var pack = this.encodeAsString(deconstruction.packet); - var buffers = deconstruction.buffers; - buffers.unshift(pack); // add packet info to beginning of data list +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - return buffers; // write all the buffers - } - }]); +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - return Encoder; -}(); +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -exports.Encoder = Encoder; -/** - * A socket.io Decoder instance - * - * @return {Object} decoder - */ +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } -var Decoder = /*#__PURE__*/function (_Emitter) { - _inherits(Decoder, _Emitter); +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } - var _super = _createSuper(Decoder); +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - function Decoder() { - _classCallCheck(this, Decoder); +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ +function setup(env) { + createDebug.debug = createDebug; + createDebug["default"] = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/socket.io-parser/node_modules/ms/index.js"); + createDebug.destroy = destroy; + Object.keys(env).forEach(function (key) { + createDebug[key] = env[key]; + }); + /** + * The currently active debug mode names, and names to skip. + */ - return _super.call(this); - } + createDebug.names = []; + createDebug.skips = []; /** - * Decodes an encoded packet string into packet JSON. - * - * @param {String} obj - encoded packet - */ + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ - _createClass(Decoder, [{ - key: "add", - value: function add(obj) { - var packet; + function selectColor(namespace) { + var hash = 0; - if (typeof obj === "string") { - packet = this.decodeString(obj); + for (var i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } - if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) { - // binary packet's json - this.reconstructor = new BinaryReconstructor(packet); // no attachments, labeled binary but no binary data to follow + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } - if (packet.attachments === 0) { - _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); - } - } else { - // non-binary full packet - _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); - } - } else if (is_binary_1.isBinary(obj) || obj.base64) { - // raw binary data - if (!this.reconstructor) { - throw new Error("got binary data when not reconstructing a packet"); - } else { - packet = this.reconstructor.takeBinaryData(obj); + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ - if (packet) { - // received final buffer - this.reconstructor = null; + function createDebug(namespace) { + var prevTime; + var enableOverride = null; - _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); - } - } - } else { - throw new Error("Unknown type: " + obj); + function debug() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - } - /** - * Decode a packet String (JSON data) - * - * @param {String} str - * @return {Object} packet - */ - }, { - key: "decodeString", - value: function decodeString(str) { - var i = 0; // look up type + // Disabled? + if (!debug.enabled) { + return; + } - var p = { - type: Number(str.charAt(0)) - }; + var self = debug; // Set `diff` timestamp - if (PacketType[p.type] === undefined) { - throw new Error("unknown packet type " + p.type); - } // look up attachments if type binary + var curr = Number(new Date()); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } // Apply any `formatters` transformations - if (p.type === PacketType.BINARY_EVENT || p.type === PacketType.BINARY_ACK) { - var start = i + 1; - while (str.charAt(++i) !== "-" && i != str.length) {} + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } - var buf = str.substring(start, i); + index++; + var formatter = createDebug.formatters[format]; - if (buf != Number(buf) || str.charAt(i) !== "-") { - throw new Error("Illegal attachments"); + if (typeof formatter === 'function') { + var val = args[index]; + match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; } - p.attachments = Number(buf); - } // look up namespace (if any) + return match; + }); // Apply env-specific formatting (colors, etc.) + + createDebug.formatArgs.call(self, args); + var logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: function get() { + return enableOverride === null ? createDebug.enabled(namespace) : enableOverride; + }, + set: function set(v) { + enableOverride = v; + } + }); // Env-specific initialization logic for debug instances - if ("/" === str.charAt(i + 1)) { - var _start = i + 1; + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } - while (++i) { - var c = str.charAt(i); - if ("," === c) break; - if (i === str.length) break; - } + return debug; + } - p.nsp = str.substring(_start, i); - } else { - p.nsp = "/"; - } // look up id + function extend(namespace, delimiter) { + var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ - var next = str.charAt(i + 1); + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.names = []; + createDebug.skips = []; + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; - if ("" !== next && Number(next) == next) { - var _start2 = i + 1; + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } - while (++i) { - var _c = str.charAt(i); + namespaces = split[i].replace(/\*/g, '.*?'); - if (null == _c || Number(_c) != _c) { - --i; - break; - } + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ - if (i === str.length) break; - } - p.id = Number(str.substring(_start2, i + 1)); - } // look up json data + function disable() { + var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { + return '-' + namespace; + }))).join(','); + createDebug.enable(''); + return namespaces; + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ - if (str.charAt(++i)) { - var payload = tryParse(str.substr(i)); + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } - if (Decoder.isPayloadValid(p.type, payload)) { - p.data = payload; - } else { - throw new Error("invalid payload"); - } - } + var i; + var len; - debug("decoded %s as %j", str, p); - return p; + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } } - }, { - key: "destroy", - /** - * Deallocates a parser's resources - */ - value: function destroy() { - if (this.reconstructor) { - this.reconstructor.finishedReconstruction(); + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; } } - }], [{ - key: "isPayloadValid", - value: function isPayloadValid(type, payload) { - switch (type) { - case PacketType.CONNECT: - return _typeof(payload) === "object"; - case PacketType.DISCONNECT: - return payload === undefined; + return false; + } + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ - case PacketType.CONNECT_ERROR: - return typeof payload === "string" || _typeof(payload) === "object"; - case PacketType.EVENT: - case PacketType.BINARY_EVENT: - return Array.isArray(payload) && typeof payload[0] === "string"; + function toNamespace(regexp) { + return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); + } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ - case PacketType.ACK: - case PacketType.BINARY_ACK: - return Array.isArray(payload); - } + + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; } - }]); - return Decoder; -}(Emitter); + return val; + } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ -exports.Decoder = Decoder; -function tryParse(str) { - try { - return JSON.parse(str); - } catch (e) { - return false; + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } + + createDebug.enable(createDebug.load()); + return createDebug; } + +module.exports = setup; + +/***/ }), + +/***/ "./node_modules/socket.io-parser/node_modules/ms/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/socket.io-parser/node_modules/ms/index.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + /** - * A manager of a binary event's 'buffer sequence'. Should - * be constructed whenever a packet of type BINARY_EVENT is - * decoded. + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; +/** + * Parse or format the given `val`. * - * @param {Object} packet - * @return {BinaryReconstructor} initialized reconstructor + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public */ +module.exports = function (val, options) { + options = options || {}; -var BinaryReconstructor = /*#__PURE__*/function () { - function BinaryReconstructor(packet) { - _classCallCheck(this, BinaryReconstructor); + var type = _typeof(val); - this.packet = packet; - this.buffers = []; - this.reconPack = packet; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options["long"] ? fmtLong(val) : fmtShort(val); } - /** - * Method to be called when binary data received from connection - * after a BINARY_EVENT packet. - * - * @param {Buffer | ArrayBuffer} binData - the raw binary data received - * @return {null | Object} returns null if more binary data is expected or - * a reconstructed packet object if all buffers have been received. - */ + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ - _createClass(BinaryReconstructor, [{ - key: "takeBinaryData", - value: function takeBinaryData(binData) { - this.buffers.push(binData); - if (this.buffers.length === this.reconPack.attachments) { - // done with buffer list - var packet = binary_1.reconstructPacket(this.reconPack, this.buffers); - this.finishedReconstruction(); - return packet; - } +function parse(str) { + str = String(str); - return null; - } - /** - * Cleans up binary packet reconstruction variables. - */ + if (str.length > 100) { + return; + } - }, { - key: "finishedReconstruction", - value: function finishedReconstruction() { - this.reconPack = null; - this.buffers = []; - } - }]); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - return BinaryReconstructor; -}(); + if (!match) { + return; + } -/***/ }), + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); -/***/ "./node_modules/socket.io-parser/dist/is-binary.js": -/*!*********************************************************!*\ - !*** ./node_modules/socket.io-parser/dist/is-binary.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; -"use strict"; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hasBinary = exports.isBinary = void 0; -var withNativeArrayBuffer = typeof ArrayBuffer === "function"; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; -var isView = function isView(obj) { - return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer; -}; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; -var toString = Object.prototype.toString; -var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString.call(Blob) === "[object BlobConstructor]"; -var withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString.call(File) === "[object FileConstructor]"; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} /** - * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File. + * Short format for `ms`. * - * @private + * @param {Number} ms + * @return {String} + * @api private */ -function isBinary(obj) { - return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; -} -exports.isBinary = isBinary; +function fmtShort(ms) { + var msAbs = Math.abs(ms); -function hasBinary(obj, toJSON) { - if (!obj || _typeof(obj) !== "object") { - return false; + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; } - if (Array.isArray(obj)) { - for (var i = 0, l = obj.length; i < l; i++) { - if (hasBinary(obj[i])) { - return true; - } - } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } - return false; + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; } - if (isBinary(obj)) { - return true; + if (msAbs >= s) { + return Math.round(ms / s) + 's'; } - if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) { - return hasBinary(obj.toJSON(), true); + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); } - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { - return true; - } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); } - return false; + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + + return ms + ' ms'; } +/** + * Pluralization helper. + */ -exports.hasBinary = hasBinary; + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} /***/ }), diff --git a/client-dist/socket.io.js.map b/client-dist/socket.io.js.map index b28848b80c..5f3cd12012 100644 --- a/client-dist/socket.io.js.map +++ b/client-dist/socket.io.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://io/webpack/universalModuleDefinition","webpack://io/webpack/bootstrap","webpack://io/./build/index.js","webpack://io/./build/manager.js","webpack://io/./build/on.js","webpack://io/./build/socket.js","webpack://io/./build/url.js","webpack://io/./node_modules/backo2/index.js","webpack://io/./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","webpack://io/./node_modules/component-bind/index.js","webpack://io/./node_modules/component-emitter/index.js","webpack://io/./node_modules/debug/src/browser.js","webpack://io/./node_modules/debug/src/common.js","webpack://io/./node_modules/engine.io-client/lib/globalThis.browser.js","webpack://io/./node_modules/engine.io-client/lib/index.js","webpack://io/./node_modules/engine.io-client/lib/socket.js","webpack://io/./node_modules/engine.io-client/lib/transport.js","webpack://io/./node_modules/engine.io-client/lib/transports/index.js","webpack://io/./node_modules/engine.io-client/lib/transports/polling-jsonp.js","webpack://io/./node_modules/engine.io-client/lib/transports/polling-xhr.js","webpack://io/./node_modules/engine.io-client/lib/transports/polling.js","webpack://io/./node_modules/engine.io-client/lib/transports/websocket-constructor.browser.js","webpack://io/./node_modules/engine.io-client/lib/transports/websocket.js","webpack://io/./node_modules/engine.io-client/lib/util.js","webpack://io/./node_modules/engine.io-client/lib/xmlhttprequest.js","webpack://io/./node_modules/engine.io-parser/lib/commons.js","webpack://io/./node_modules/engine.io-parser/lib/decodePacket.browser.js","webpack://io/./node_modules/engine.io-parser/lib/encodePacket.browser.js","webpack://io/./node_modules/engine.io-parser/lib/index.js","webpack://io/./node_modules/has-cors/index.js","webpack://io/./node_modules/ms/index.js","webpack://io/./node_modules/parseqs/index.js","webpack://io/./node_modules/parseuri/index.js","webpack://io/./node_modules/process/browser.js","webpack://io/./node_modules/socket.io-parser/dist/binary.js","webpack://io/./node_modules/socket.io-parser/dist/index.js","webpack://io/./node_modules/socket.io-parser/dist/is-binary.js","webpack://io/./node_modules/yeast/index.js"],"names":["Object","defineProperty","exports","value","Socket","io","Manager","protocol","url_1","require","manager_1","socket_1","enumerable","get","debug","module","lookup","cache","managers","uri","opts","undefined","parsed","url","source","id","path","sameNamespace","newConnection","forceNew","multiplex","query","socket","socket_io_parser_1","connect","manager_2","eio","Emitter","parser","on_1","bind","Backoff","nsps","subs","reconnection","reconnectionAttempts","Infinity","reconnectionDelay","reconnectionDelayMax","randomizationFactor","backoff","min","max","jitter","timeout","_readyState","_parser","encoder","Encoder","decoder","Decoder","_autoConnect","autoConnect","open","v","arguments","length","_reconnection","_reconnectionAttempts","_a","_reconnectionDelay","setMin","_randomizationFactor","setJitter","_reconnectionDelayMax","setMax","_timeout","_reconnecting","attempts","reconnect","fn","indexOf","engine","self","skipReconnect","openSub","on","onopen","errorSub","err","cleanup","maybeReconnectOnOpen","destroy","timer","setTimeout","close","emit","Error","push","clearTimeout","data","add","packet","nsp","keys","active","_close","type","encodedPackets","encode","i","write","options","subsLength","sub","shift","reset","reason","delay","duration","onreconnect","attempt","obj","ev","off","RESERVED_EVENTS","freeze","connect_error","disconnect","disconnecting","newListener","removeListener","ids","acks","receiveBuffer","sendBuffer","flags","connected","disconnected","auth","subEvents","args","unshift","apply","hasOwnProperty","PacketType","EVENT","compress","pop","isTransportWritable","transport","writable","discardPacket","_packet","CONNECT","sid","onconnect","onevent","BINARY_EVENT","ACK","onack","BINARY_ACK","DISCONNECT","ondisconnect","CONNECT_ERROR","message","ack","emitEvent","_anyListeners","listeners","slice","listener","sent","emitBuffered","forEach","onclose","splice","parseuri","loc","location","host","charAt","test","port","ipv6","href","ms","factor","prototype","Math","pow","rand","random","deviation","floor","chars","Uint8Array","charCodeAt","arraybuffer","bytes","len","base64","substring","decode","bufferLength","p","encoded1","encoded2","encoded3","encoded4","ArrayBuffer","call","concat","mixin","key","addEventListener","event","_callbacks","once","removeAllListeners","removeEventListener","callbacks","cb","Array","hasListeners","log","formatArgs","save","load","useColors","storage","localstorage","colors","window","process","__nwjs","navigator","userAgent","toLowerCase","match","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","namespace","humanize","diff","c","color","index","lastC","replace","namespaces","setItem","removeItem","error","r","getItem","env","DEBUG","localStorage","formatters","j","JSON","stringify","setup","createDebug","coerce","disable","enable","enabled","instances","names","skips","selectColor","hash","abs","prevTime","curr","Number","Date","prev","format","formatter","val","logFn","extend","init","delimiter","newDebug","split","substr","instance","map","toNamespace","join","name","regexp","toString","stack","Function","Transport","transports","parseqs","hostname","secure","readyState","writeBuffer","prevBufferLen","agent","withCredentials","upgrade","jsonp","timestampParam","rememberUpgrade","rejectUnauthorized","perMessageDeflate","threshold","transportOptions","upgrades","pingInterval","pingTimeout","pingTimeoutTimer","clone","EIO","priorWebsocketSuccess","createTransport","e","setTransport","onDrain","onPacket","onError","onClose","probe","failed","onTransportOpen","onlyBinaryUpgrades","upgradeLosesBinary","supportsBinary","send","msg","upgrading","pause","flush","freezeTransport","onerror","onTransportClose","onupgrade","to","l","onHandshake","parse","resetPingTimeout","sendPacket","code","filterUpgrades","onOpen","waitForUpgrade","cleanupAndClose","desc","pingIntervalTimer","filteredUpgrades","o","description","doOpen","doClose","packets","decodePacket","binaryType","XMLHttpRequest","XHR","JSONP","websocket","polling","xhr","xd","xs","isSSL","xdomain","xscheme","forceJSONP","Polling","globalThis","rNewline","rEscapedNewline","empty","JSONPPolling","___eio","onData","script","parentNode","removeChild","form","iframe","createElement","async","src","insertAt","getElementsByTagName","insertBefore","head","body","appendChild","isUAgecko","area","iframeId","className","position","top","left","target","method","setAttribute","action","complete","initIframe","html","submit","attachEvent","onreadystatechange","onload","pick","hasXHR2","responseType","forceBase64","Request","req","request","pollXhr","create","extraHeaders","setDisableHeaderCheck","setRequestHeader","requestTimeout","hasXDR","onLoad","responseText","status","requestsCount","requests","onSuccess","fromError","abort","XDomainRequest","enablesXDR","unloadHandler","terminationEvent","yeast","poll","onPause","total","doPoll","callback","decodePayload","encodePayload","doWrite","schema","timestampRequests","b64","WebSocket","MozWebSocket","usingBrowserWebSocket","defaultBinaryType","isReactNative","product","WS","check","protocols","headers","ws","addEventListeners","onmessage","encodePacket","Buffer","byteLength","done","attr","reduce","acc","k","hasCORS","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeArrayBuffer","base64decoder","encodedPacket","mapBinary","decodeBase64Packet","packetType","decoded","Blob","withNativeBlob","isView","buffer","encodeBlobAsBase64","fileReader","FileReader","content","result","readAsDataURL","SEPARATOR","String","fromCharCode","count","encodedPayload","decodedPacket","s","m","h","d","w","y","isFinite","fmtLong","fmtShort","str","exec","n","parseFloat","msAbs","round","plural","isPlural","encodeURIComponent","qs","qry","pairs","pair","decodeURIComponent","re","parts","b","authority","ipv6uri","pathNames","queryKey","regx","$0","$2","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","drainQueue","run","nextTick","Item","array","title","browser","argv","version","versions","noop","addListener","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","reconstructPacket","deconstructPacket","is_binary_1","buffers","packetData","pack","_deconstructPacket","attachments","isBinary","placeholder","_placeholder","num","isArray","newData","_reconstructPacket","binary_1","hasBinary","encodeAsBinary","encodeAsString","deconstruction","decodeString","reconstructor","BinaryReconstructor","takeBinaryData","start","buf","next","payload","tryParse","isPayloadValid","finishedReconstruction","reconPack","binData","withNativeFile","File","toJSON","alphabet","seed","encoded","now"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,O;QCpBA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+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ED;AACA;AACA;;;AACA,OAAO1f,CAAC,GAAG5C,MAAX,EAAmB4C,CAAC,EAApB;AAAwB8L,KAAG,CAAC2T,QAAQ,CAACzf,CAAD,CAAT,CAAH,GAAmBA,CAAnB;AAAxB,C,CAEA;AACA;AACA;;;AACAwV,KAAK,CAACzV,MAAN,GAAeA,MAAf;AACAyV,KAAK,CAAC3P,MAAN,GAAeA,MAAf;AACA5L,MAAM,CAACb,OAAP,GAAiBoc,KAAjB,C","file":"socket.io.js","sourcesContent":["(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[\"io\"] = factory();\n\telse\n\t\troot[\"io\"] = factory();\n})((() => {\n if (typeof self !== 'undefined') {\n return self;\n } else if (typeof window !== 'undefined') {\n return window;\n } else if (typeof global !== 'undefined') {\n return global;\n } else {\n return Function('return this')();\n }\n })(), function() {\nreturn "," \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 = \"./build/index.js\");\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Socket = exports.io = exports.Manager = exports.protocol = void 0;\nconst url_1 = require(\"./url\");\nconst manager_1 = require(\"./manager\");\nconst socket_1 = require(\"./socket\");\nObject.defineProperty(exports, \"Socket\", { enumerable: true, get: function () { return socket_1.Socket; } });\nconst debug = require(\"debug\")(\"socket.io-client\");\n/**\n * Module exports.\n */\nmodule.exports = exports = lookup;\n/**\n * Managers cache.\n */\nconst cache = (exports.managers = {});\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url_1.url(uri);\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n debug(\"ignoring socket cache for %s\", source);\n io = new manager_1.Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n debug(\"new io instance for %s\", source);\n cache[id] = new manager_1.Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.query;\n }\n return io.socket(parsed.path, opts);\n}\nexports.io = lookup;\n/**\n * Protocol version.\n *\n * @public\n */\nvar socket_io_parser_1 = require(\"socket.io-parser\");\nObject.defineProperty(exports, \"protocol\", { enumerable: true, get: function () { return socket_io_parser_1.protocol; } });\n/**\n * `connect`.\n *\n * @param {String} uri\n * @public\n */\nexports.connect = lookup;\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nvar manager_2 = require(\"./manager\");\nObject.defineProperty(exports, \"Manager\", { enumerable: true, get: function () { return manager_2.Manager; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Manager = void 0;\nconst eio = require(\"engine.io-client\");\nconst socket_1 = require(\"./socket\");\nconst Emitter = require(\"component-emitter\");\nconst parser = require(\"socket.io-parser\");\nconst on_1 = require(\"./on\");\nconst bind = require(\"component-bind\");\nconst Backoff = require(\"backo2\");\nconst debug = require(\"debug\")(\"socket.io-client:manager\");\nclass Manager extends Emitter {\n constructor(uri, opts) {\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor(opts.randomizationFactor || 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n debug(\"readyState %s\", this._readyState);\n if (~this._readyState.indexOf(\"open\"))\n return this;\n debug(\"opening %s\", this.uri);\n this.engine = eio(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSub = on_1.on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n // emit `error`\n const errorSub = on_1.on(socket, \"error\", (err) => {\n debug(\"error\");\n self.cleanup();\n self._readyState = \"closed\";\n super.emit(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n self.maybeReconnectOnOpen();\n }\n });\n if (false !== this._timeout) {\n const timeout = this._timeout;\n debug(\"connect attempt will timeout after %d\", timeout);\n if (timeout === 0) {\n openSub.destroy(); // prevents a race condition with the 'open' event\n }\n // set timer\n const timer = setTimeout(() => {\n debug(\"connect attempt timed out after %d\", timeout);\n openSub.destroy();\n socket.close();\n socket.emit(\"error\", new Error(\"timeout\"));\n }, timeout);\n this.subs.push({\n destroy: function () {\n clearTimeout(timer);\n },\n });\n }\n this.subs.push(openSub);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return {Manager} self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", bind(this, \"ondata\")), on_1.on(socket, \"ping\", bind(this, \"onping\")), on_1.on(socket, \"error\", bind(this, \"onerror\")), on_1.on(socket, \"close\", bind(this, \"onclose\")), on_1.on(this.decoder, \"decoded\", bind(this, \"ondecoded\")));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n super.emit(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n this.decoder.add(data);\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n super.emit(\"packet\", packet);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new socket_1.Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n debug(\"writing packet %j\", packet);\n if (packet.query && packet.type === 0)\n packet.nsp += \"?\" + packet.query;\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason) {\n debug(\"onclose\");\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n super.emit(\"close\", reason);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n debug(\"reconnect failed\");\n this.backoff.reset();\n super.emit(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n debug(\"will wait %dms before reconnect attempt\", delay);\n this._reconnecting = true;\n const timer = setTimeout(() => {\n if (self.skipReconnect)\n return;\n debug(\"attempting reconnect\");\n super.emit(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n debug(\"reconnect attempt error\");\n self._reconnecting = false;\n self.reconnect();\n super.emit(\"reconnect_error\", err);\n }\n else {\n debug(\"reconnect success\");\n self.onreconnect();\n }\n });\n }, delay);\n this.subs.push({\n destroy: function () {\n clearTimeout(timer);\n },\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }\n}\nexports.Manager = Manager;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.on = void 0;\nfunction on(obj, ev, fn) {\n obj.on(ev, fn);\n return {\n destroy: function () {\n obj.off(ev, fn);\n },\n };\n}\nexports.on = on;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Socket = void 0;\nconst socket_io_parser_1 = require(\"socket.io-parser\");\nconst Emitter = require(\"component-emitter\");\nconst on_1 = require(\"./on\");\nconst bind = require(\"component-bind\");\nconst debug = require(\"debug\")(\"socket.io-client:socket\");\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\nclass Socket extends Emitter {\n /**\n * `Socket` constructor.\n *\n * @public\n */\n constructor(io, nsp, opts) {\n super();\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.connected = false;\n this.disconnected = true;\n this.flags = {};\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", bind(this, \"onopen\")),\n on_1.on(io, \"packet\", bind(this, \"onpacket\")),\n on_1.on(io, \"close\", bind(this, \"onclose\")),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @public\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for connect()\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * @return self\n * @public\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param ev - event name\n * @return self\n * @public\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @private\n */\n onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n super.emit(\"disconnect\", reason);\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowlegement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id) {\n debug(\"socket connected with id %s\", id);\n this.id = id;\n this.connected = true;\n this.disconnected = false;\n super.emit(\"connect\");\n this.emitBuffered();\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (let i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n this.subs = null;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually.\n *\n * @return self\n * @public\n */\n disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for disconnect()\n *\n * @return self\n * @public\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n * @public\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @returns self\n * @public\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @param listener\n * @public\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @param listener\n * @public\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @param listener\n * @public\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n *\n * @public\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n}\nexports.Socket = Socket;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.url = void 0;\nconst parseuri = require(\"parseuri\");\nconst debug = require(\"debug\")(\"socket.io-client:url\");\n/**\n * URL parser.\n *\n * @param uri - url\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nfunction url(uri, loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n debug(\"protocol-less url %s\", uri);\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n debug(\"parse %s\", uri);\n obj = parseuri(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\nexports.url = url;\n","\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n this.jitter = jitter;\n};\n\n","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n \"use strict\";\n\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n // Use a lookup table to find the index.\n var lookup = new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i+1)];\n encoded3 = lookup[base64.charCodeAt(i+2)];\n encoded4 = lookup[base64.charCodeAt(i+3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})();\n","/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n if ('string' == typeof fn) fn = obj[fn];\n if ('function' != typeof fn) throw new Error('bind() requires a function');\n var args = slice.call(arguments, 2);\n return function(){\n return fn.apply(obj, args.concat(slice.call(arguments)));\n }\n};\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n // Remove event specific arrays for event types that no\r\n // one is subscribed for to avoid memory leak.\r\n if (callbacks.length === 0) {\r\n delete this._callbacks['$' + event];\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n\r\n var args = new Array(arguments.length - 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","module.exports = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n } else if (typeof window !== \"undefined\") {\n return window;\n } else {\n return Function(\"return this\")();\n }\n})();\n","const Socket = require(\"./socket\");\n\nmodule.exports = (uri, opts) => new Socket(uri, opts);\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nmodule.exports.Socket = Socket;\nmodule.exports.protocol = Socket.protocol; // this is an int\nmodule.exports.Transport = require(\"./transport\");\nmodule.exports.transports = require(\"./transports/index\");\nmodule.exports.parser = require(\"engine.io-parser\");\n","const transports = require(\"./transports/index\");\nconst Emitter = require(\"component-emitter\");\nconst debug = require(\"debug\")(\"engine.io-client:socket\");\nconst parser = require(\"engine.io-parser\");\nconst parseuri = require(\"parseuri\");\nconst parseqs = require(\"parseqs\");\n\nclass Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n constructor(uri, opts = {}) {\n super();\n\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n\n if (uri) {\n uri = parseuri(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query) opts.query = uri.query;\n } else if (opts.host) {\n opts.hostname = parseuri(opts.host).host;\n }\n\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? 443\n : 80);\n\n this.transports = opts.transports || [\"polling\", \"websocket\"];\n this.readyState = \"\";\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n\n this.opts = Object.assign(\n {\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n jsonp: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024\n },\n transportOptions: {}\n },\n opts\n );\n\n this.opts.path = this.opts.path.replace(/\\/$/, \"\") + \"/\";\n\n if (typeof this.opts.query === \"string\") {\n this.opts.query = parseqs.decode(this.opts.query);\n }\n\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n\n // set on heartbeat\n this.pingTimeoutTimer = null;\n\n this.open();\n }\n\n /**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n createTransport(name) {\n debug('creating transport \"%s\"', name);\n const query = clone(this.opts.query);\n\n // append engine.io protocol identifier\n query.EIO = parser.protocol;\n\n // transport name\n query.transport = name;\n\n // session id if we already have one\n if (this.id) query.sid = this.id;\n\n const opts = Object.assign(\n {},\n this.opts.transportOptions[name],\n this.opts,\n {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port\n }\n );\n\n debug(\"options: %j\", opts);\n\n return new transports[name](opts);\n }\n\n /**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\n open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }\n\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }\n\n /**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n probe(name) {\n debug('probing transport \"%s\"', name);\n let transport = this.createTransport(name, { probe: 1 });\n let failed = false;\n const self = this;\n\n Socket.priorWebsocketSuccess = false;\n\n function onTransportOpen() {\n if (self.onlyBinaryUpgrades) {\n const upgradeLosesBinary =\n !this.supportsBinary && self.transport.supportsBinary;\n failed = failed || upgradeLosesBinary;\n }\n if (failed) return;\n\n debug('probe transport \"%s\" opened', name);\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", function(msg) {\n if (failed) return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n debug('probe transport \"%s\" pong', name);\n self.upgrading = true;\n self.emit(\"upgrading\", transport);\n if (!transport) return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n\n debug('pausing current transport \"%s\"', self.transport.name);\n self.transport.pause(function() {\n if (failed) return;\n if (\"closed\" === self.readyState) return;\n debug(\"changing transport and sending upgrade packet\");\n\n cleanup();\n\n self.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n self.emit(\"upgrade\", transport);\n transport = null;\n self.upgrading = false;\n self.flush();\n });\n } else {\n debug('probe transport \"%s\" failed', name);\n const err = new Error(\"probe error\");\n err.transport = transport.name;\n self.emit(\"upgradeError\", err);\n }\n });\n }\n\n function freezeTransport() {\n if (failed) return;\n\n // Any callback called by transport should be ignored since now\n failed = true;\n\n cleanup();\n\n transport.close();\n transport = null;\n }\n\n // Handle any error that happens while probing\n function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }\n\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }\n\n // Remove all listeners on the transport and on self\n function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }\n\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n\n transport.open();\n }\n\n /**\n * Called when connection is deemed open.\n *\n * @api public\n */\n onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n\n /**\n * Handles a packet.\n *\n * @api private\n */\n onPacket(packet) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n this.emit(\"packet\", packet);\n\n // Socket is live - any packet counts\n this.emit(\"heartbeat\");\n\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n\n case \"ping\":\n this.resetPingTimeout();\n this.sendPacket(\"pong\");\n this.emit(\"pong\");\n break;\n\n case \"error\":\n const err = new Error(\"server error\");\n err.code = packet.data;\n this.onError(err);\n break;\n\n case \"message\":\n this.emit(\"data\", packet.data);\n this.emit(\"message\", packet.data);\n break;\n }\n } else {\n debug('packet received with socket readyState \"%s\"', this.readyState);\n }\n }\n\n /**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n onHandshake(data) {\n this.emit(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState) return;\n this.resetPingTimeout();\n }\n\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @api private\n */\n resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }\n\n /**\n * Called on `drain` event\n *\n * @api private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }\n\n /**\n * Flush write buffers.\n *\n * @api private\n */\n flush() {\n if (\n \"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length\n ) {\n debug(\"flushing %d packets in socket\", this.writeBuffer.length);\n this.transport.send(this.writeBuffer);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = this.writeBuffer.length;\n this.emit(\"flush\");\n }\n }\n\n /**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n\n /**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n\n options = options || {};\n options.compress = false !== options.compress;\n\n const packet = {\n type: type,\n data: data,\n options: options\n };\n this.emit(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn) this.once(\"flush\", fn);\n this.flush();\n }\n\n /**\n * Closes the connection.\n *\n * @api private\n */\n close() {\n const self = this;\n\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n\n if (this.writeBuffer.length) {\n this.once(\"drain\", function() {\n if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n });\n } else if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n }\n\n function close() {\n self.onClose(\"forced close\");\n debug(\"socket closing - telling transport to close\");\n self.transport.close();\n }\n\n function cleanupAndClose() {\n self.removeListener(\"upgrade\", cleanupAndClose);\n self.removeListener(\"upgradeError\", cleanupAndClose);\n close();\n }\n\n function waitForUpgrade() {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n self.once(\"upgrade\", cleanupAndClose);\n self.once(\"upgradeError\", cleanupAndClose);\n }\n\n return this;\n }\n\n /**\n * Called upon transport error\n *\n * @api private\n */\n onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n\n /**\n * Called upon transport close.\n *\n * @api private\n */\n onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }\n\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\nfunction clone(obj) {\n const o = {};\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n o[i] = obj[i];\n }\n }\n return o;\n}\n\nmodule.exports = Socket;\n","const parser = require(\"engine.io-parser\");\nconst Emitter = require(\"component-emitter\");\n\nclass Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n constructor(opts) {\n super();\n\n this.opts = opts;\n this.query = opts.query;\n this.readyState = \"\";\n this.socket = opts.socket;\n }\n\n /**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n onError(msg, desc) {\n const err = new Error(msg);\n err.type = \"TransportError\";\n err.description = desc;\n this.emit(\"error\", err);\n return this;\n }\n\n /**\n * Opens the transport.\n *\n * @api public\n */\n open() {\n if (\"closed\" === this.readyState || \"\" === this.readyState) {\n this.readyState = \"opening\";\n this.doOpen();\n }\n\n return this;\n }\n\n /**\n * Closes the transport.\n *\n * @api private\n */\n close() {\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.doClose();\n this.onClose();\n }\n\n return this;\n }\n\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n send(packets) {\n if (\"open\" === this.readyState) {\n this.write(packets);\n } else {\n throw new Error(\"Transport not open\");\n }\n }\n\n /**\n * Called upon open\n *\n * @api private\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n this.emit(\"open\");\n }\n\n /**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n onData(data) {\n const packet = parser.decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n\n /**\n * Called with a decoded packet.\n */\n onPacket(packet) {\n this.emit(\"packet\", packet);\n }\n\n /**\n * Called upon close.\n *\n * @api private\n */\n onClose() {\n this.readyState = \"closed\";\n this.emit(\"close\");\n }\n}\n\nmodule.exports = Transport;\n","const XMLHttpRequest = require(\"xmlhttprequest-ssl\");\nconst XHR = require(\"./polling-xhr\");\nconst JSONP = require(\"./polling-jsonp\");\nconst websocket = require(\"./websocket\");\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}\n","const Polling = require(\"./polling\");\nconst globalThis = require(\"../globalThis\");\n\nconst rNewline = /\\n/g;\nconst rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nlet callbacks;\n\n/**\n * Noop.\n */\n\nfunction empty() {}\n\nclass JSONPPolling extends Polling {\n /**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n constructor(opts) {\n super(opts);\n\n this.query = this.query || {};\n\n // define global callbacks array if not present\n // we do this here (lazily) to avoid unneeded global pollution\n if (!callbacks) {\n // we need to consider multiple engines in the same page\n callbacks = globalThis.___eio = globalThis.___eio || [];\n }\n\n // callback identifier\n this.index = callbacks.length;\n\n // add callback to jsonp global\n const self = this;\n callbacks.push(function(msg) {\n self.onData(msg);\n });\n\n // append to query string\n this.query.j = this.index;\n\n // prevent spurious errors from being emitted when the window is unloaded\n if (typeof addEventListener === \"function\") {\n addEventListener(\n \"beforeunload\",\n function() {\n if (self.script) self.script.onerror = empty;\n },\n false\n );\n }\n }\n\n /**\n * JSONP only supports binary as base64 encoded strings\n */\n get supportsBinary() {\n return false;\n }\n\n /**\n * Closes the socket.\n *\n * @api private\n */\n doClose() {\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n if (this.form) {\n this.form.parentNode.removeChild(this.form);\n this.form = null;\n this.iframe = null;\n }\n\n super.doClose();\n }\n\n /**\n * Starts a poll cycle.\n *\n * @api private\n */\n doPoll() {\n const self = this;\n const script = document.createElement(\"script\");\n\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n script.async = true;\n script.src = this.uri();\n script.onerror = function(e) {\n self.onError(\"jsonp poll error\", e);\n };\n\n const insertAt = document.getElementsByTagName(\"script\")[0];\n if (insertAt) {\n insertAt.parentNode.insertBefore(script, insertAt);\n } else {\n (document.head || document.body).appendChild(script);\n }\n this.script = script;\n\n const isUAgecko =\n \"undefined\" !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n if (isUAgecko) {\n setTimeout(function() {\n const iframe = document.createElement(\"iframe\");\n document.body.appendChild(iframe);\n document.body.removeChild(iframe);\n }, 100);\n }\n }\n\n /**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n doWrite(data, fn) {\n const self = this;\n let iframe;\n\n if (!this.form) {\n const form = document.createElement(\"form\");\n const area = document.createElement(\"textarea\");\n const id = (this.iframeId = \"eio_iframe_\" + this.index);\n\n form.className = \"socketio\";\n form.style.position = \"absolute\";\n form.style.top = \"-1000px\";\n form.style.left = \"-1000px\";\n form.target = id;\n form.method = \"POST\";\n form.setAttribute(\"accept-charset\", \"utf-8\");\n area.name = \"d\";\n form.appendChild(area);\n document.body.appendChild(form);\n\n this.form = form;\n this.area = area;\n }\n\n this.form.action = this.uri();\n\n function complete() {\n initIframe();\n fn();\n }\n\n function initIframe() {\n if (self.iframe) {\n try {\n self.form.removeChild(self.iframe);\n } catch (e) {\n self.onError(\"jsonp polling iframe removal error\", e);\n }\n }\n\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n const html = '