From b600e78f710912f6ce76dc195201041cc8a44f9c Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 15 Oct 2020 12:55:30 +0200 Subject: [PATCH] chore(release): 3.0.0-rc2 Diff: https://github.com/socketio/socket.io-client/compare/3.0.0-rc1...3.0.0-rc2 --- CHANGELOG.md | 14 + dist/socket.io.js | 660 ++++++++++++-------------------------- dist/socket.io.js.map | 2 +- dist/socket.io.min.js | 4 +- dist/socket.io.min.js.map | 2 +- package.json | 6 +- 6 files changed, 231 insertions(+), 457 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cfc26cc3..53b34aa2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [3.0.0-rc2](https://github.com/socketio/socket.io-client/compare/3.0.0-rc1...3.0.0-rc2) (2020-10-15) + + +### Features + +* move binary detection back to the parser ([1789094](https://github.com/socketio/socket.io-client/commit/178909471a3dd232e71cba83b729b4cc66f1412f)) + + +### BREAKING CHANGES + +* the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser. + + + # [3.0.0-rc1](https://github.com/socketio/socket.io-client/compare/2.3.1...3.0.0-rc1) (2020-10-13) diff --git a/dist/socket.io.js b/dist/socket.io.js index d761b9a92..4b64aa7cb 100644 --- a/dist/socket.io.js +++ b/dist/socket.io.js @@ -1,5 +1,5 @@ /*! - * Socket.IO v3.0.0-rc1 + * Socket.IO v3.0.0-rc2 * (c) 2014-2020 Guillermo Rauch * Released under the MIT License. */ @@ -126,7 +126,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi Object.defineProperty(exports, "__esModule", { value: true }); -exports.Socket = exports.Manager = exports.protocol = void 0; +exports.io = exports.Manager = exports.protocol = void 0; var url_1 = __webpack_require__(/*! ./url */ "./build/url.js"); @@ -144,18 +144,6 @@ module.exports = exports = lookup; */ var cache = exports.managers = {}; -/** - * Looks up an existing `Manager` for multiplexing. - * If the user summons: - * - * `io('http://localhost/a');` - * `io('http://localhost/b');` - * - * We reuse the existing instance based on same scheme/port/host, - * and we initialize sockets for each namespace. - * - * @api public - */ function lookup(uri, opts) { if (_typeof(uri) === "object") { @@ -190,13 +178,14 @@ function lookup(uri, opts) { return io.socket(parsed.path, opts); } + +exports.io = lookup; /** * Protocol version. * - * @api public + * @public */ - var socket_io_parser_1 = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/dist/index.js"); Object.defineProperty(exports, "protocol", { @@ -209,14 +198,14 @@ Object.defineProperty(exports, "protocol", { * `connect`. * * @param {String} uri - * @api public + * @public */ exports.connect = lookup; /** * Expose constructors for standalone build. * - * @api public + * @public */ var manager_2 = __webpack_require__(/*! ./manager */ "./build/manager.js"); @@ -228,15 +217,6 @@ Object.defineProperty(exports, "Manager", { } }); -var socket_1 = __webpack_require__(/*! ./socket */ "./build/socket.js"); - -Object.defineProperty(exports, "Socket", { - enumerable: true, - get: function get() { - return socket_1.Socket; - } -}); - /***/ }), /***/ "./build/manager.js": @@ -275,87 +255,32 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function get() { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) { - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - Object.defineProperty(exports, "__esModule", { value: true }); exports.Manager = void 0; -var engine_io_client_1 = __importDefault(__webpack_require__(/*! engine.io-client */ "./node_modules/engine.io-client/lib/index.js")); +var eio = __webpack_require__(/*! engine.io-client */ "./node_modules/engine.io-client/lib/index.js"); var socket_1 = __webpack_require__(/*! ./socket */ "./build/socket.js"); -var component_emitter_1 = __importDefault(__webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js")); +var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); -var parser = __importStar(__webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/dist/index.js")); +var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/dist/index.js"); var on_1 = __webpack_require__(/*! ./on */ "./build/on.js"); -var component_bind_1 = __importDefault(__webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js")); +var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js"); -var indexof_1 = __importDefault(__webpack_require__(/*! indexof */ "./node_modules/indexof/index.js")); - -var backo2_1 = __importDefault(__webpack_require__(/*! backo2 */ "./node_modules/backo2/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"); -/** - * IE6+ hasOwnProperty - */ - - -var has = Object.prototype.hasOwnProperty; -var Manager = /*#__PURE__*/function (_component_emitter_1$) { - _inherits(Manager, _component_emitter_1$); +var Manager = /*#__PURE__*/function (_Emitter) { + _inherits(Manager, _Emitter); var _super = _createSuper(Manager); - /** - * `Manager` constructor. - * - * @param {String} engine instance or engine uri/opts - * @param {Object} options - * @api public - */ function Manager(uri, opts) { var _this; @@ -385,7 +310,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { _this.randomizationFactor(opts.randomizationFactor || 0.5); - _this.backoff = new backo2_1["default"]({ + _this.backoff = new Backoff({ min: _this.reconnectionDelay(), max: _this.reconnectionDelayMax(), jitter: _this.randomizationFactor() @@ -393,25 +318,17 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { _this.timeout(null == opts.timeout ? 20000 : opts.timeout); - _this.readyState = "closed"; + _this._readyState = "closed"; _this.uri = uri; var _parser = opts.parser || parser; _this.encoder = new _parser.Encoder(); _this.decoder = new _parser.Decoder(); - _this.autoConnect = opts.autoConnect !== false; - if (_this.autoConnect) _this.open(); + _this._autoConnect = opts.autoConnect !== false; + if (_this._autoConnect) _this.open(); return _this; } - /** - * Sets the `reconnection` config. - * - * @param {Boolean} true/false if it should automatically reconnect - * @return {Manager} self or value - * @api public - */ - _createClass(Manager, [{ key: "reconnection", @@ -420,33 +337,17 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { this._reconnection = !!v; return this; } - /** - * Sets the reconnection attempts config. - * - * @param {Number} max reconnection attempts before giving up - * @return {Manager} self or value - * @api public - */ - }, { key: "reconnectionAttempts", value: function reconnectionAttempts(v) { - if (!arguments.length) return this._reconnectionAttempts; + if (v === undefined) return this._reconnectionAttempts; this._reconnectionAttempts = v; return this; } - /** - * Sets the delay between reconnections. - * - * @param {Number} delay - * @return {Manager} self or value - * @api public - */ - }, { key: "reconnectionDelay", value: function reconnectionDelay(v) { - if (!arguments.length) return this._reconnectionDelay; + if (v === undefined) return this._reconnectionDelay; this._reconnectionDelay = v; this.backoff && this.backoff.setMin(v); return this; @@ -454,34 +355,19 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { }, { key: "randomizationFactor", value: function randomizationFactor(v) { - if (!arguments.length) return this._randomizationFactor; + if (v === undefined) return this._randomizationFactor; this._randomizationFactor = v; this.backoff && this.backoff.setJitter(v); return this; } - /** - * Sets the maximum delay between reconnections. - * - * @param {Number} delay - * @return {Manager} self or value - * @api public - */ - }, { key: "reconnectionDelayMax", value: function reconnectionDelayMax(v) { - if (!arguments.length) return this._reconnectionDelayMax; + if (v === undefined) return this._reconnectionDelayMax; this._reconnectionDelayMax = v; this.backoff && this.backoff.setMax(v); return this; } - /** - * Sets the connection timeout. `false` to disable - * - * @return {Manager} self or value - * @api public - */ - }, { key: "timeout", value: function timeout(v) { @@ -493,14 +379,14 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { * Starts trying to reconnect if reconnection is enabled and we have not * started reconnecting yet * - * @api private + * @private */ }, { key: "maybeReconnectOnOpen", value: function maybeReconnectOnOpen() { // Only try to reconnect if it's the first time we're connecting - if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) { + if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) { // keeps reconnection from firing twice for the same reconnection loop this.reconnect(); } @@ -508,23 +394,23 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Sets the current transport `socket`. * - * @param {Function} optional, callback + * @param {Function} fn - optional, callback * @return {Manager} self - * @api public + * @public */ }, { key: "open", - value: function open(fn, opts) { + value: function open(fn) { var _this2 = this; - debug("readyState %s", this.readyState); - if (~this.readyState.indexOf("open")) return this; + debug("readyState %s", this._readyState); + if (~this._readyState.indexOf("open")) return this; debug("opening %s", this.uri); - this.engine = engine_io_client_1["default"](this.uri, this.opts); + this.engine = eio(this.uri, this.opts); var socket = this.engine; var self = this; - this.readyState = "opening"; + this._readyState = "opening"; this.skipReconnect = false; // emit `open` var openSub = on_1.on(socket, "open", function () { @@ -535,7 +421,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { var errorSub = on_1.on(socket, "error", function (err) { debug("connect_error"); self.cleanup(); - self.readyState = "closed"; + self._readyState = "closed"; _get(_getPrototypeOf(Manager.prototype), "emit", _this2).call(_this2, "connect_error", err); @@ -575,15 +461,22 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { this.subs.push(errorSub); return this; } + /** + * Alias for open() + * + * @return {Manager} self + * @public + */ + }, { key: "connect", - value: function connect(fn, opts) { - return this.open(fn, opts); + value: function connect(fn) { + return this.open(fn); } /** * Called upon transport open. * - * @api private + * @private */ }, { @@ -593,22 +486,22 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { this.cleanup(); // mark as open - this.readyState = "open"; + this._readyState = "open"; _get(_getPrototypeOf(Manager.prototype), "emit", this).call(this, "open"); // add new subs var socket = this.engine; - this.subs.push(on_1.on(socket, "data", component_bind_1["default"](this, "ondata"))); - this.subs.push(on_1.on(socket, "ping", component_bind_1["default"](this, "onping"))); - this.subs.push(on_1.on(socket, "error", component_bind_1["default"](this, "onerror"))); - this.subs.push(on_1.on(socket, "close", component_bind_1["default"](this, "onclose"))); - this.subs.push(on_1.on(this.decoder, "decoded", component_bind_1["default"](this, "ondecoded"))); + this.subs.push(on_1.on(socket, "data", bind(this, "ondata"))); + this.subs.push(on_1.on(socket, "ping", bind(this, "onping"))); + this.subs.push(on_1.on(socket, "error", bind(this, "onerror"))); + this.subs.push(on_1.on(socket, "close", bind(this, "onclose"))); + this.subs.push(on_1.on(this.decoder, "decoded", bind(this, "ondecoded"))); } /** * Called upon a ping. * - * @api private + * @private */ }, { @@ -619,7 +512,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Called with data. * - * @api private + * @private */ }, { @@ -630,7 +523,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Called when parser fully decodes a packet. * - * @api private + * @private */ }, { @@ -641,7 +534,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Called upon socket error. * - * @api private + * @private */ }, { @@ -655,7 +548,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { * Creates a new socket for the given `nsp`. * * @return {Socket} - * @api public + * @public */ }, { @@ -669,14 +562,14 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { var self = this; socket.on("connecting", onConnecting); - if (this.autoConnect) { + if (this._autoConnect) { // manually call here since connecting event is fired before listening onConnecting(); } } function onConnecting() { - if (!~indexof_1["default"](self.connecting, socket)) { + if (!~self.connecting.indexOf(socket)) { self.connecting.push(socket); } } @@ -687,38 +580,40 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { * Called upon a socket close. * * @param {Socket} socket + * @private */ }, { - key: "destroy", - value: function destroy(socket) { - var index = indexof_1["default"](this.connecting, socket); + key: "_destroy", + value: function _destroy(socket) { + var index = this.connecting.indexOf(socket); if (~index) this.connecting.splice(index, 1); if (this.connecting.length) return; - this.close(); + + this._close(); } /** * Writes a packet. * * @param {Object} packet - * @api private + * @private */ }, { - key: "packet", - value: function packet(_packet) { - debug("writing packet %j", _packet); - if (_packet.query && _packet.type === 0) _packet.nsp += "?" + _packet.query; - var encodedPackets = this.encoder.encode(_packet); + key: "_packet", + value: function _packet(packet) { + debug("writing packet %j", packet); + if (packet.query && packet.type === 0) packet.nsp += "?" + packet.query; + var encodedPackets = this.encoder.encode(packet); for (var i = 0; i < encodedPackets.length; i++) { - this.engine.write(encodedPackets[i], _packet.options); + this.engine.write(encodedPackets[i], packet.options); } } /** * Clean up transport subscriptions and packet buffer. * - * @api private + * @private */ }, { @@ -737,47 +632,41 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Close the current socket. * - * @api private + * @private */ }, { - key: "close", - value: function close() { + key: "_close", + value: function _close() { debug("disconnect"); this.skipReconnect = true; - this.reconnecting = false; + this._reconnecting = false; - if ("opening" === this.readyState) { + if ("opening" === this._readyState) { // `onclose` will not fire because // an open event never happened this.cleanup(); } this.backoff.reset(); - this.readyState = "closed"; + this._readyState = "closed"; if (this.engine) this.engine.close(); } + /** + * Alias for close() + * + * @private + */ + }, { key: "disconnect", value: function disconnect() { - debug("disconnect"); - this.skipReconnect = true; - this.reconnecting = false; - - if ("opening" === this.readyState) { - // `onclose` will not fire because - // an open event never happened - this.cleanup(); - } - - this.backoff.reset(); - this.readyState = "closed"; - if (this.engine) this.engine.close(); + return this._close(); } /** * Called upon engine close. * - * @api private + * @private */ }, { @@ -786,7 +675,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { debug("onclose"); this.cleanup(); this.backoff.reset(); - this.readyState = "closed"; + this._readyState = "closed"; _get(_getPrototypeOf(Manager.prototype), "emit", this).call(this, "close", reason); @@ -797,7 +686,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Attempt a reconnection. * - * @api private + * @private */ }, { @@ -805,7 +694,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { value: function reconnect() { var _this3 = this; - if (this.reconnecting || this.skipReconnect) return this; + if (this._reconnecting || this.skipReconnect) return this; var self = this; if (this.backoff.attempts >= this._reconnectionAttempts) { @@ -814,11 +703,11 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { _get(_getPrototypeOf(Manager.prototype), "emit", this).call(this, "reconnect_failed"); - this.reconnecting = false; + this._reconnecting = false; } else { var delay = this.backoff.duration(); debug("will wait %dms before reconnect attempt", delay); - this.reconnecting = true; + this._reconnecting = true; var timer = setTimeout(function () { if (self.skipReconnect) return; debug("attempting reconnect"); @@ -832,7 +721,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { self.open(function (err) { if (err) { debug("reconnect attempt error"); - self.reconnecting = false; + self._reconnecting = false; self.reconnect(); _get(_getPrototypeOf(Manager.prototype), "emit", _this3).call(_this3, "reconnect_error", err); @@ -852,14 +741,14 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { /** * Called upon successful reconnect. * - * @api private + * @private */ }, { key: "onreconnect", value: function onreconnect() { var attempt = this.backoff.attempts; - this.reconnecting = false; + this._reconnecting = false; this.backoff.reset(); _get(_getPrototypeOf(Manager.prototype), "emit", this).call(this, "reconnect", attempt); @@ -867,7 +756,7 @@ var Manager = /*#__PURE__*/function (_component_emitter_1$) { }]); return Manager; -}(component_emitter_1["default"]); +}(Emitter); exports.Manager = Manager; @@ -937,12 +826,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - Object.defineProperty(exports, "__esModule", { value: true }); @@ -950,22 +833,16 @@ exports.Socket = void 0; var socket_io_parser_1 = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/dist/index.js"); -var component_emitter_1 = __importDefault(__webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js")); - -var to_array_1 = __importDefault(__webpack_require__(/*! to-array */ "./node_modules/to-array/index.js")); +var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); var on_1 = __webpack_require__(/*! ./on */ "./build/on.js"); -var component_bind_1 = __importDefault(__webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js")); - -var has_binary2_1 = __importDefault(__webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.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. * These events can't be emitted by the user. - * - * @api private */ @@ -979,15 +856,15 @@ var RESERVED_EVENTS = { removeListener: 1 }; -var Socket = /*#__PURE__*/function (_component_emitter_1$) { - _inherits(Socket, _component_emitter_1$); +var Socket = /*#__PURE__*/function (_Emitter) { + _inherits(Socket, _Emitter); var _super = _createSuper(Socket); /** * `Socket` constructor. * - * @api public + * @public */ function Socket(io, nsp, opts) { var _this; @@ -1014,13 +891,13 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { _this.auth = opts.auth; } - if (_this.io.autoConnect) _this.open(); + if (_this.io._autoConnect) _this.open(); return _this; } /** * Subscribe to open, close and packet events * - * @api private + * @private */ @@ -1029,45 +906,47 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { value: function subEvents() { if (this.subs) return; var io = this.io; - this.subs = [on_1.on(io, "open", component_bind_1["default"](this, "onopen")), on_1.on(io, "packet", component_bind_1["default"](this, "onpacket")), on_1.on(io, "close", component_bind_1["default"](this, "onclose"))]; + 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"))]; } /** * "Opens" the socket. * - * @api public + * @public */ - }, { - key: "open", - value: function open() { - if (this.connected) return this; - this.subEvents(); - if (!this.io.reconnecting) this.io.open(); // ensure open - - if ("open" === this.io.readyState) this.onopen(); - return this; - } }, { key: "connect", value: function connect() { if (this.connected) return this; this.subEvents(); - if (!this.io.reconnecting) this.io.open(); // ensure open + if (!this.io._reconnecting) this.io.open(); // ensure open - if ("open" === this.io.readyState) this.onopen(); + if ("open" === this.io._readyState) this.onopen(); return this; } + /** + * Alias for connect() + */ + + }, { + key: "open", + value: function open() { + return this.connect(); + } /** * Sends a `message` event. * * @return {Socket} self - * @api public + * @public */ }, { key: "send", value: function send() { - var args = to_array_1["default"](arguments); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + args.unshift("message"); this.emit.apply(this, args); return this; @@ -1076,9 +955,9 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Override `emit`. * If the event is in `events`, it's emitted normally. * - * @param {String} event name + * @param {String} ev - event name * @return {Socket} self - * @api public + * @public */ }, { @@ -1088,9 +967,13 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { throw new Error('"' + ev + '" is a reserved event name'); } - var args = to_array_1["default"](arguments); + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + args.unshift(ev); var packet = { - type: (this.flags.binary !== undefined ? this.flags.binary : has_binary2_1["default"](args)) ? socket_io_parser_1.PacketType.BINARY_EVENT : socket_io_parser_1.PacketType.EVENT, + type: socket_io_parser_1.PacketType.EVENT, data: args }; packet.options = {}; @@ -1115,19 +998,20 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Sends a packet. * * @param {Object} packet - * @api private + * @private */ }, { key: "packet", value: function packet(_packet) { _packet.nsp = this.nsp; - this.io.packet(_packet); + + this.io._packet(_packet); } /** * Called upon engine `open`. * - * @api private + * @private */ }, { @@ -1155,7 +1039,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Called upon engine `close`. * * @param {String} reason - * @api private + * @private */ }, { @@ -1172,7 +1056,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Called with socket packet. * * @param {Object} packet - * @api private + * @private */ }, { @@ -1218,7 +1102,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Called upon a server event. * * @param {Object} packet - * @api private + * @private */ }, { @@ -1241,7 +1125,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { /** * Produces an ack callback to emit with an event. * - * @api private + * @private */ }, { @@ -1253,10 +1137,14 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { // prevent double callbacks if (sent) return; sent = true; - var args = to_array_1["default"](arguments); + + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + debug("sending ack %j", args); self.packet({ - type: has_binary2_1["default"](args) ? socket_io_parser_1.PacketType.BINARY_ACK : socket_io_parser_1.PacketType.ACK, + type: socket_io_parser_1.PacketType.ACK, id: id, data: args }); @@ -1266,7 +1154,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * Called upon a server acknowlegement. * * @param {Object} packet - * @api private + * @private */ }, { @@ -1285,7 +1173,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { /** * Called upon server connect. * - * @api private + * @private */ }, { @@ -1302,7 +1190,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { /** * Emit buffered events (received and emitted). * - * @api private + * @private */ }, { @@ -1323,7 +1211,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { /** * Called upon server disconnect. * - * @api private + * @private */ }, { @@ -1338,7 +1226,7 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { * this method ensures the manager stops tracking us and * that reconnections don't get triggered for this. * - * @api private. + * @private */ }, { @@ -1353,35 +1241,15 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { this.subs = null; } - this.io.destroy(this); + this.io._destroy(this); } /** * Disconnects the socket manually. * * @return {Socket} self - * @api public + * @public */ - }, { - key: "close", - value: function close() { - if (this.connected) { - debug("performing disconnect (%s)", this.nsp); - this.packet({ - type: socket_io_parser_1.PacketType.DISCONNECT - }); - } // remove socket from pool - - - this.destroy(); - - if (this.connected) { - // fire events - this.onclose("io client disconnect"); - } - - return this; - } }, { key: "disconnect", value: function disconnect() { @@ -1403,37 +1271,35 @@ var Socket = /*#__PURE__*/function (_component_emitter_1$) { return this; } /** - * Sets the compress flag. + * Alias for disconnect() * - * @param {Boolean} if `true`, compresses the sending data * @return {Socket} self - * @api public + * @public */ }, { - key: "compress", - value: function compress(_compress) { - this.flags.compress = _compress; - return this; + key: "close", + value: function close() { + return this.disconnect(); } /** - * Sets the binary flag + * Sets the compress flag. * - * @param {Boolean} whether the emitted data contains binary + * @param {Boolean} compress - if `true`, compresses the sending data * @return {Socket} self - * @api public + * @public */ }, { - key: "binary", - value: function binary(_binary) { - this.flags.binary = _binary; + key: "compress", + value: function compress(_compress) { + this.flags.compress = _compress; return this; } }]); return Socket; -}(component_emitter_1["default"]); +}(Emitter); exports.Socket = Socket; @@ -1449,27 +1315,21 @@ exports.Socket = Socket; "use strict"; -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - Object.defineProperty(exports, "__esModule", { value: true }); exports.url = void 0; -var parseuri_1 = __importDefault(__webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js")); +var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("socket.io-client:url"); /** * URL parser. * - * @param {String} url - * @param {Object} An object meant to mimic window.location. + * @param {String} uri - url + * @param {Object} loc - An object meant to mimic window.location. * Defaults to window.location. - * @api public + * @public */ @@ -1500,7 +1360,7 @@ function url(uri, loc) { debug("parse %s", uri); - obj = parseuri_1["default"](uri); + obj = parseuri(uri); } // make sure we treat `localhost:80` and `localhost` equally @@ -4992,74 +4852,6 @@ module.exports = { /***/ }), -/***/ "./node_modules/has-binary2/index.js": -/*!*******************************************!*\ - !*** ./node_modules/has-binary2/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -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); } - -/* global Blob File */ - -/* - * Module requirements. - */ -var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js"); - -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]'; -/** - * Module exports. - */ - -module.exports = hasBinary; -/** - * Checks for binary data. - * - * Supports Buffer, ArrayBuffer, Blob and File. - * - * @param {Object} anything - * @api public - */ - -function hasBinary(obj) { - if (!obj || _typeof(obj) !== 'object') { - return false; - } - - if (isArray(obj)) { - for (var i = 0, l = obj.length; i < l; i++) { - if (hasBinary(obj[i])) { - return true; - } - } - - return false; - } - - if (typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj) || typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File) { - return true; - } // see: https://github.com/Automattic/has-binary/pull/4 - - - if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) { - return hasBinary(obj.toJSON(), true); - } - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { - return true; - } - } - - return false; -} - -/***/ }), - /***/ "./node_modules/has-cors/index.js": /*!****************************************!*\ !*** ./node_modules/has-cors/index.js ***! @@ -5084,42 +4876,6 @@ try { /***/ }), -/***/ "./node_modules/indexof/index.js": -/*!***************************************!*\ - !*** ./node_modules/indexof/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var indexOf = [].indexOf; - -module.exports = function (arr, obj) { - if (indexOf) return arr.indexOf(obj); - - for (var i = 0; i < arr.length; ++i) { - if (arr[i] === obj) return i; - } - - return -1; -}; - -/***/ }), - -/***/ "./node_modules/isarray/index.js": -/*!***************************************!*\ - !*** ./node_modules/isarray/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -/***/ }), - /***/ "./node_modules/ms/index.js": /*!**********************************!*\ !*** ./node_modules/ms/index.js ***! @@ -5662,18 +5418,12 @@ process.umask = function () { 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); } -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - Object.defineProperty(exports, "__esModule", { value: true }); exports.reconstructPacket = exports.deconstructPacket = void 0; -var is_binary_1 = __importDefault(__webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js")); +var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); /** * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder. * @@ -5701,7 +5451,7 @@ exports.deconstructPacket = deconstructPacket; function _deconstructPacket(data, buffers) { if (!data) return data; - if (is_binary_1["default"](data)) { + if (is_binary_1.isBinary(data)) { var placeholder = { _placeholder: true, num: buffers.length @@ -5807,22 +5557,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - Object.defineProperty(exports, "__esModule", { value: true }); exports.Decoder = exports.Encoder = exports.PacketType = exports.protocol = void 0; -var component_emitter_1 = __importDefault(__webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js")); +var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js"); var binary_1 = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/dist/binary.js"); -var is_binary_1 = __importDefault(__webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js")); +var is_binary_1 = __webpack_require__(/*! ./is-binary */ "./node_modules/socket.io-parser/dist/is-binary.js"); var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("socket.io-parser"); /** @@ -5832,7 +5576,7 @@ var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.j */ -exports.protocol = 4; +exports.protocol = 5; var PacketType; (function (PacketType) { @@ -5866,12 +5610,14 @@ var Encoder = /*#__PURE__*/function () { value: function encode(obj) { debug("encoding packet %j", obj); - if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { - return this.encodeAsBinary(obj); - } else { - var encoding = this.encodeAsString(obj); - return [encoding]; + 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); + } } + + return [this.encodeAsString(obj)]; } /** * Encode packet as string. @@ -5934,8 +5680,8 @@ exports.Encoder = Encoder; * @return {Object} decoder */ -var Decoder = /*#__PURE__*/function (_component_emitter_1$) { - _inherits(Decoder, _component_emitter_1$); +var Decoder = /*#__PURE__*/function (_Emitter) { + _inherits(Decoder, _Emitter); var _super = _createSuper(Decoder); @@ -5970,7 +5716,7 @@ var Decoder = /*#__PURE__*/function (_component_emitter_1$) { // non-binary full packet _get(_getPrototypeOf(Decoder.prototype), "emit", this).call(this, "decoded", packet); } - } else if (is_binary_1["default"](obj) || obj.base64) { + } 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"); @@ -6108,7 +5854,7 @@ var Decoder = /*#__PURE__*/function (_component_emitter_1$) { }]); return Decoder; -}(component_emitter_1["default"]); +}(Emitter); exports.Decoder = Decoder; @@ -6188,10 +5934,12 @@ var BinaryReconstructor = /*#__PURE__*/function () { "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 }); -var withNativeBuffer = typeof Buffer === "function" && typeof Buffer.isBuffer === "function"; +exports.hasBinary = exports.isBinary = void 0; var withNativeArrayBuffer = typeof ArrayBuffer === "function"; var isView = function isView(obj) { @@ -6208,33 +5956,45 @@ var withNativeFile = typeof File === "function" || typeof File !== "undefined" & */ function isBinary(obj) { - return withNativeBuffer && Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; + return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; } -exports["default"] = isBinary; +exports.isBinary = isBinary; -/***/ }), +function hasBinary(obj, toJSON) { + if (!obj || _typeof(obj) !== "object") { + return false; + } -/***/ "./node_modules/to-array/index.js": -/*!****************************************!*\ - !*** ./node_modules/to-array/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + if (Array.isArray(obj)) { + for (var i = 0, l = obj.length; i < l; i++) { + if (hasBinary(obj[i])) { + return true; + } + } + + return false; + } -module.exports = toArray; + if (isBinary(obj)) { + return true; + } -function toArray(list, index) { - var array = []; - index = index || 0; + if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) { + return hasBinary(obj.toJSON(), true); + } - for (var i = index || 0; i < list.length; i++) { - array[i - index] = list[i]; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { + return true; + } } - return array; + return false; } +exports.hasBinary = hasBinary; + /***/ }), /***/ "./node_modules/yeast/index.js": diff --git a/dist/socket.io.js.map b/dist/socket.io.js.map index 770cb33ad..59629f1d6 100644 --- a/dist/socket.io.js.map +++ b/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-client/node_modules/parseuri/index.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-binary2/index.js","webpack://io/./node_modules/has-cors/index.js","webpack://io/./node_modules/indexof/index.js","webpack://io/./node_modules/isarray/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/to-array/index.js","webpack://io/./node_modules/yeast/index.js"],"names":["Object","defineProperty","exports","value","Socket","Manager","protocol","url_1","require","manager_1","debug","module","lookup","cache","managers","uri","opts","undefined","parsed","url","source","id","path","sameNamespace","nsps","newConnection","forceNew","multiplex","io","query","socket","socket_io_parser_1","enumerable","get","connect","manager_2","socket_1","__createBinding","create","o","m","k","k2","__setModuleDefault","v","__importStar","mod","__esModule","result","prototype","hasOwnProperty","call","__importDefault","engine_io_client_1","component_emitter_1","parser","on_1","component_bind_1","indexof_1","backo2_1","has","subs","connecting","reconnection","reconnectionAttempts","Infinity","reconnectionDelay","reconnectionDelayMax","randomizationFactor","backoff","min","max","jitter","timeout","readyState","_parser","encoder","Encoder","decoder","Decoder","autoConnect","open","arguments","length","_reconnection","_reconnectionAttempts","_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","onConnecting","index","splice","type","encodedPackets","encode","i","write","options","subsLength","sub","shift","reset","reason","delay","duration","onreconnect","attempt","obj","ev","removeListener","to_array_1","has_binary2_1","RESERVED_EVENTS","disconnect","disconnecting","error","newListener","ids","acks","receiveBuffer","sendBuffer","flags","connected","disconnected","auth","subEvents","args","unshift","apply","binary","PacketType","BINARY_EVENT","EVENT","compress","pop","CONNECT","rootNamespaceError","ERROR","sid","onconnect","onevent","ACK","onack","BINARY_ACK","DISCONNECT","ondisconnect","ack","sent","emitBuffered","onclose","parseuri_1","loc","location","host","charAt","test","port","ipv6","href","Backoff","ms","factor","Math","pow","rand","random","deviation","floor","chars","Uint8Array","charCodeAt","arraybuffer","bytes","len","base64","substring","decode","bufferLength","p","encoded1","encoded2","encoded3","encoded4","ArrayBuffer","slice","concat","Emitter","mixin","key","addEventListener","event","_callbacks","once","off","removeAllListeners","removeEventListener","callbacks","cb","Array","listeners","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","lastC","replace","namespaces","setItem","removeItem","r","getItem","env","DEBUG","localStorage","formatters","j","JSON","stringify","message","setup","createDebug","coerce","disable","enable","enabled","keys","forEach","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","parseuri","parseqs","hostname","secure","writeBuffer","prevBufferLen","agent","upgrade","jsonp","timestampParam","policyPort","rememberUpgrade","rejectUnauthorized","perMessageDeflate","threshold","transportOptions","upgrades","pingInterval","pingTimeout","pingTimeoutTimer","clone","EIO","transport","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","writable","waitForUpgrade","cleanupAndClose","desc","pingIntervalTimer","filteredUpgrades","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","isBinary","req","request","pollXhr","extraHeaders","setDisableHeaderCheck","setRequestHeader","withCredentials","requestTimeout","hasXDR","onLoad","responseText","contentType","getResponseHeader","status","requestsCount","requests","onSuccess","fromError","abort","response","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","hasCORS","re","parts","str","b","exec","authority","ipv6uri","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeArrayBuffer","base64decoder","encodedPacket","mapBinary","decodeBase64Packet","packetType","decoded","Blob","withNativeBlob","isView","buffer","encodeBlobAsBase64","fileReader","FileReader","content","readAsDataURL","SEPARATOR","String","fromCharCode","count","encodedPayload","decodedPacket","isArray","withNativeFile","File","hasBinary","isBuffer","toJSON","arr","s","h","d","w","y","isFinite","fmtLong","fmtShort","n","parseFloat","msAbs","round","plural","isPlural","encodeURIComponent","qs","qry","pairs","pair","decodeURIComponent","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","placeholder","_placeholder","num","newData","_reconstructPacket","binary_1","encodeAsBinary","encoding","encodeAsString","deconstruction","decodeString","reconstructor","BinaryReconstructor","takeBinaryData","start","buf","next","payload","tryParse","isPayloadValid","finishedReconstruction","reconPack","binData","withNativeBuffer","toArray","list","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+D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;AAOA,SAASza,MAAT,CAAgBuS,GAAhB,EAAqB;AACnB,MAAIc,OAAO,GAAG,CAAd;;AAEA,OAAKtY,CAAC,GAAG,CAAT,EAAYA,CAAC,GAAGwX,GAAG,CAACna,MAApB,EAA4B2C,CAAC,EAA7B,EAAiC;AAC/BsY,WAAO,GAAGA,OAAO,GAAGjb,MAAV,GAAmBiO,GAAG,CAACkM,GAAG,CAAC7T,MAAJ,CAAW3D,CAAX,CAAD,CAAhC;AACD;;AAED,SAAOsY,OAAP;AACD;AAED;;;;;;;;AAMA,SAASjD,KAAT,GAAiB;AACf,MAAIsK,GAAG,GAAG5f,MAAM,CAAC,CAAC,IAAI0K,IAAJ,EAAF,CAAhB;AAEA,MAAIkV,GAAG,KAAKjV,IAAZ,EAAkB,OAAO+U,IAAI,GAAG,CAAP,EAAU/U,IAAI,GAAGiV,GAAxB;AAClB,SAAOA,GAAG,GAAE,GAAL,GAAU5f,MAAM,CAAC0f,IAAI,EAAL,CAAvB;AACD,C,CAED;AACA;AACA;;;AACA,OAAOzf,CAAC,GAAG3C,MAAX,EAAmB2C,CAAC,EAApB;AAAwBsL,KAAG,CAACkU,QAAQ,CAACxf,CAAD,CAAT,CAAH,GAAmBA,CAAnB;AAAxB,C,CAEA;AACA;AACA;;;AACAqV,KAAK,CAACtV,MAAN,GAAeA,MAAf;AACAsV,KAAK,CAACpQ,MAAN,GAAeA,MAAf;AACApM,MAAM,CAACT,OAAP,GAAiBid,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.Manager = exports.protocol = void 0;\nconst url_1 = require(\"./url\");\nconst manager_1 = require(\"./manager\");\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 = {});\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n * `io('http://localhost/a');`\n * `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\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}\n/**\n * Protocol version.\n *\n * @api 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 * @api public\n */\nexports.connect = lookup;\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\nvar manager_2 = require(\"./manager\");\nObject.defineProperty(exports, \"Manager\", { enumerable: true, get: function () { return manager_2.Manager; } });\nvar socket_1 = require(\"./socket\");\nObject.defineProperty(exports, \"Socket\", { enumerable: true, get: function () { return socket_1.Socket; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Manager = void 0;\nconst engine_io_client_1 = __importDefault(require(\"engine.io-client\"));\nconst socket_1 = require(\"./socket\");\nconst component_emitter_1 = __importDefault(require(\"component-emitter\"));\nconst parser = __importStar(require(\"socket.io-parser\"));\nconst on_1 = require(\"./on\");\nconst component_bind_1 = __importDefault(require(\"component-bind\"));\nconst indexof_1 = __importDefault(require(\"indexof\"));\nconst backo2_1 = __importDefault(require(\"backo2\"));\nconst debug = require(\"debug\")(\"socket.io-client:manager\");\n/**\n * IE6+ hasOwnProperty\n */\nconst has = Object.prototype.hasOwnProperty;\nclass Manager extends component_emitter_1.default {\n /**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n constructor(uri, opts) {\n super();\n this.nsps = {};\n this.subs = [];\n this.connecting = [];\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 backo2_1.default({\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 /**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n /**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n reconnectionAttempts(v) {\n if (!arguments.length)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n /**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n reconnectionDelay(v) {\n if (!arguments.length)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n this.backoff && this.backoff.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n if (!arguments.length)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n this.backoff && this.backoff.setJitter(v);\n return this;\n }\n /**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n reconnectionDelayMax(v) {\n if (!arguments.length)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n this.backoff && this.backoff.setMax(v);\n return this;\n }\n /**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\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 * @api 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} optional, callback\n * @return {Manager} self\n * @api public\n */\n open(fn, opts) {\n debug(\"readyState %s\", this.readyState);\n if (~this.readyState.indexOf(\"open\"))\n return this;\n debug(\"opening %s\", this.uri);\n this.engine = engine_io_client_1.default(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 `connect_error`\n const errorSub = on_1.on(socket, \"error\", (err) => {\n debug(\"connect_error\");\n self.cleanup();\n self.readyState = \"closed\";\n super.emit(\"connect_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 // emit `connect_timeout`\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\", \"timeout\");\n super.emit(\"connect_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 connect(fn, opts) {\n return this.open(fn, opts);\n }\n /**\n * Called upon transport open.\n *\n * @api 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\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }\n /**\n * Called upon a ping.\n *\n * @api private\n */\n onping() {\n super.emit(\"ping\");\n }\n /**\n * Called with data.\n *\n * @api private\n */\n ondata(data) {\n this.decoder.add(data);\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n ondecoded(packet) {\n super.emit(\"packet\", packet);\n }\n /**\n * Called upon socket error.\n *\n * @api 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 * @api 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 var self = this;\n socket.on(\"connecting\", onConnecting);\n if (this.autoConnect) {\n // manually call here since connecting event is fired before listening\n onConnecting();\n }\n }\n function onConnecting() {\n if (!~indexof_1.default(self.connecting, socket)) {\n self.connecting.push(socket);\n }\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n destroy(socket) {\n const index = indexof_1.default(this.connecting, socket);\n if (~index)\n this.connecting.splice(index, 1);\n if (this.connecting.length)\n return;\n this.close();\n }\n /**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api 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 * @api 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 * @api 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 disconnect() {\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 * Called upon engine close.\n *\n * @api 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 * @api 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 super.emit(\"reconnecting\", 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 * @api 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.removeListener(ev, fn);\n },\n };\n}\nexports.on = on;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Socket = void 0;\nconst socket_io_parser_1 = require(\"socket.io-parser\");\nconst component_emitter_1 = __importDefault(require(\"component-emitter\"));\nconst to_array_1 = __importDefault(require(\"to-array\"));\nconst on_1 = require(\"./on\");\nconst component_bind_1 = __importDefault(require(\"component-bind\"));\nconst has_binary2_1 = __importDefault(require(\"has-binary2\"));\nconst debug = require(\"debug\")(\"socket.io-client:socket\");\n/**\n * Internal events.\n * These events can't be emitted by the user.\n *\n * @api private\n */\nconst RESERVED_EVENTS = {\n connect: 1,\n disconnect: 1,\n disconnecting: 1,\n error: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n};\nclass Socket extends component_emitter_1.default {\n /**\n * `Socket` constructor.\n *\n * @api 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 * @api private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", component_bind_1.default(this, \"onopen\")),\n on_1.on(io, \"packet\", component_bind_1.default(this, \"onpacket\")),\n on_1.on(io, \"close\", component_bind_1.default(this, \"onclose\")),\n ];\n }\n /**\n * \"Opens\" the socket.\n *\n * @api public\n */\n open() {\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 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 * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n send() {\n const args = to_array_1.default(arguments);\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 {String} event name\n * @return {Socket} self\n * @api public\n */\n emit(ev) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n const args = to_array_1.default(arguments);\n const packet = {\n type: (this.flags.binary !== undefined ? this.flags.binary : has_binary2_1.default(args))\n ? socket_io_parser_1.PacketType.BINARY_EVENT\n : socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = !this.flags || false !== this.flags.compress;\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 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 {Object} packet\n * @api private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io.packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @api 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 {String} reason\n * @api 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 {Object} packet\n * @api private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n const rootNamespaceError = packet.type === socket_io_parser_1.PacketType.ERROR && packet.nsp === \"/\";\n if (!sameNamespace && !rootNamespaceError)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n const id = packet.data.sid;\n this.onconnect(id);\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.ERROR:\n super.emit(\"error\", packet.data);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api 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 super.emit.apply(this, args);\n }\n else {\n this.receiveBuffer.push(args);\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function () {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n const args = to_array_1.default(arguments);\n debug(\"sending ack %j\", args);\n self.packet({\n type: has_binary2_1.default(args) ? socket_io_parser_1.PacketType.BINARY_ACK : 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 {Object} packet\n * @api 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 * @api private\n */\n onconnect(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 * @api private\n */\n emitBuffered() {\n for (let i = 0; i < this.receiveBuffer.length; i++) {\n super.emit.apply(this, this.receiveBuffer[i]);\n }\n this.receiveBuffer = [];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n this.packet(this.sendBuffer[i]);\n }\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @api 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 * @api 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 {Socket} self\n * @api public\n */\n close() {\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 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 * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets the binary flag\n *\n * @param {Boolean} whether the emitted data contains binary\n * @return {Socket} self\n * @api public\n */\n binary(binary) {\n this.flags.binary = binary;\n return this;\n }\n}\nexports.Socket = Socket;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.url = void 0;\nconst parseuri_1 = __importDefault(require(\"parseuri\"));\nconst debug = require(\"debug\")(\"socket.io-client:url\");\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n * Defaults to window.location.\n * @api 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 (\"string\" === typeof uri) {\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_1.default(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 upgrade: true,\n jsonp: true,\n timestampParam: \"t\",\n policyPort: 843,\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 = '