|
|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
/*!
|
|
|
|
|
* Socket.IO v4.1.1
|
|
|
|
|
* Socket.IO v4.2.0
|
|
|
|
|
* (c) 2014-2021 Guillermo Rauch
|
|
|
|
|
* Released under the MIT License.
|
|
|
|
|
*/
|
|
|
|
|
@@ -142,7 +142,7 @@ function lookup(uri, opts) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opts = opts || {};
|
|
|
|
|
var parsed = url_1.url(uri, opts.path || "/socket.io");
|
|
|
|
|
var parsed = (0, url_1.url)(uri, opts.path || "/socket.io");
|
|
|
|
|
var source = parsed.source;
|
|
|
|
|
var id = parsed.id;
|
|
|
|
|
var path = parsed.path;
|
|
|
|
|
@@ -243,11 +243,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -258,6 +258,8 @@ exports.Manager = void 0;
|
|
|
|
|
|
|
|
|
|
var eio = __webpack_require__(/*! engine.io-client */ "./node_modules/engine.io-client/lib/index.js");
|
|
|
|
|
|
|
|
|
|
var util_1 = __webpack_require__(/*! engine.io-client/lib/util */ "./node_modules/engine.io-client/lib/util.js");
|
|
|
|
|
|
|
|
|
|
var socket_1 = __webpack_require__(/*! ./socket */ "./build/socket.js");
|
|
|
|
|
|
|
|
|
|
var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/dist/index.js");
|
|
|
|
|
@@ -280,6 +282,8 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, Manager);
|
|
|
|
|
|
|
|
|
|
var _a;
|
|
|
|
|
|
|
|
|
|
_this = _super.call(this);
|
|
|
|
|
_this.nsps = {};
|
|
|
|
|
_this.subs = [];
|
|
|
|
|
@@ -292,6 +296,7 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
opts = opts || {};
|
|
|
|
|
opts.path = opts.path || "/socket.io";
|
|
|
|
|
_this.opts = opts;
|
|
|
|
|
(0, util_1.installTimerFunctions)(_assertThisInitialized(_this), opts);
|
|
|
|
|
|
|
|
|
|
_this.reconnection(opts.reconnection !== false);
|
|
|
|
|
|
|
|
|
|
@@ -301,7 +306,7 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
|
|
|
|
|
_this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
|
|
|
|
|
|
|
|
|
|
_this.randomizationFactor(opts.randomizationFactor || 0.5);
|
|
|
|
|
_this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
|
|
|
|
|
|
|
|
|
|
_this.backoff = new Backoff({
|
|
|
|
|
min: _this.reconnectionDelay(),
|
|
|
|
|
@@ -412,12 +417,12 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
this._readyState = "opening";
|
|
|
|
|
this.skipReconnect = false; // emit `open`
|
|
|
|
|
|
|
|
|
|
var openSubDestroy = on_1.on(socket, "open", function () {
|
|
|
|
|
var openSubDestroy = (0, on_1.on)(socket, "open", function () {
|
|
|
|
|
self.onopen();
|
|
|
|
|
fn && fn();
|
|
|
|
|
}); // emit `error`
|
|
|
|
|
|
|
|
|
|
var errorSub = on_1.on(socket, "error", function (err) {
|
|
|
|
|
var errorSub = (0, on_1.on)(socket, "error", function (err) {
|
|
|
|
|
debug("error");
|
|
|
|
|
self.cleanup();
|
|
|
|
|
self._readyState = "closed";
|
|
|
|
|
@@ -441,7 +446,7 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
} // set timer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var timer = setTimeout(function () {
|
|
|
|
|
var timer = this.setTimeoutFn(function () {
|
|
|
|
|
debug("connect attempt timed out after %d", timeout);
|
|
|
|
|
openSubDestroy();
|
|
|
|
|
socket.close();
|
|
|
|
|
@@ -490,7 +495,7 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
this.emitReserved("open"); // add new subs
|
|
|
|
|
|
|
|
|
|
var socket = this.engine;
|
|
|
|
|
this.subs.push(on_1.on(socket, "ping", this.onping.bind(this)), on_1.on(socket, "data", this.ondata.bind(this)), on_1.on(socket, "error", this.onerror.bind(this)), on_1.on(socket, "close", this.onclose.bind(this)), on_1.on(this.decoder, "decoded", this.ondecoded.bind(this)));
|
|
|
|
|
this.subs.push((0, on_1.on)(socket, "ping", this.onping.bind(this)), (0, on_1.on)(socket, "data", this.ondata.bind(this)), (0, on_1.on)(socket, "error", this.onerror.bind(this)), (0, on_1.on)(socket, "close", this.onclose.bind(this)), (0, on_1.on)(this.decoder, "decoded", this.ondecoded.bind(this)));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Called upon a ping.
|
|
|
|
|
@@ -689,7 +694,7 @@ var Manager = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
var delay = this.backoff.duration();
|
|
|
|
|
debug("will wait %dms before reconnect attempt", delay);
|
|
|
|
|
this._reconnecting = true;
|
|
|
|
|
var timer = setTimeout(function () {
|
|
|
|
|
var timer = this.setTimeoutFn(function () {
|
|
|
|
|
if (self.skipReconnect) return;
|
|
|
|
|
debug("attempting reconnect");
|
|
|
|
|
|
|
|
|
|
@@ -781,7 +786,7 @@ exports.on = on;
|
|
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
|
|
|
|
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
|
|
|
@@ -803,11 +808,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -855,6 +860,8 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
_classCallCheck(this, Socket);
|
|
|
|
|
|
|
|
|
|
_this = _super.call(this);
|
|
|
|
|
_this.connected = false;
|
|
|
|
|
_this.disconnected = true;
|
|
|
|
|
_this.receiveBuffer = [];
|
|
|
|
|
_this.sendBuffer = [];
|
|
|
|
|
_this.ids = 0;
|
|
|
|
|
@@ -862,13 +869,6 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
_this.flags = {};
|
|
|
|
|
_this.io = io;
|
|
|
|
|
_this.nsp = nsp;
|
|
|
|
|
_this.ids = 0;
|
|
|
|
|
_this.acks = {};
|
|
|
|
|
_this.receiveBuffer = [];
|
|
|
|
|
_this.sendBuffer = [];
|
|
|
|
|
_this.connected = false;
|
|
|
|
|
_this.disconnected = true;
|
|
|
|
|
_this.flags = {};
|
|
|
|
|
|
|
|
|
|
if (opts && opts.auth) {
|
|
|
|
|
_this.auth = opts.auth;
|
|
|
|
|
@@ -889,20 +889,25 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
value: function subEvents() {
|
|
|
|
|
if (this.subs) return;
|
|
|
|
|
var io = this.io;
|
|
|
|
|
this.subs = [on_1.on(io, "open", this.onopen.bind(this)), on_1.on(io, "packet", this.onpacket.bind(this)), on_1.on(io, "error", this.onerror.bind(this)), on_1.on(io, "close", this.onclose.bind(this))];
|
|
|
|
|
this.subs = [(0, on_1.on)(io, "open", this.onopen.bind(this)), (0, on_1.on)(io, "packet", this.onpacket.bind(this)), (0, on_1.on)(io, "error", this.onerror.bind(this)), (0, on_1.on)(io, "close", this.onclose.bind(this))];
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Whether the Socket will try to reconnect when its Manager connects or reconnects
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "connect",
|
|
|
|
|
|
|
|
|
|
key: "active",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return !!this.subs;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* "Opens" the socket.
|
|
|
|
|
*
|
|
|
|
|
* @public
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "connect",
|
|
|
|
|
value: function connect() {
|
|
|
|
|
if (this.connected) return this;
|
|
|
|
|
this.subEvents();
|
|
|
|
|
@@ -1335,8 +1340,11 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "onAny",
|
|
|
|
|
|
|
|
|
|
key: "volatile",
|
|
|
|
|
get: function get() {
|
|
|
|
|
this.flags["volatile"] = true;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
|
|
|
|
|
* callback.
|
|
|
|
|
@@ -1344,6 +1352,9 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
* @param listener
|
|
|
|
|
* @public
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "onAny",
|
|
|
|
|
value: function onAny(listener) {
|
|
|
|
|
this._anyListeners = this._anyListeners || [];
|
|
|
|
|
|
|
|
|
|
@@ -1409,17 +1420,6 @@ var Socket = /*#__PURE__*/function (_typed_events_1$Stric) {
|
|
|
|
|
value: function listenersAny() {
|
|
|
|
|
return this._anyListeners || [];
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "active",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return !!this.subs;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "volatile",
|
|
|
|
|
get: function get() {
|
|
|
|
|
this.flags["volatile"] = true;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Socket;
|
|
|
|
|
@@ -1457,11 +1457,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -1499,14 +1499,14 @@ var StrictEventEmitter = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
|
|
|
|
|
_createClass(StrictEventEmitter, [{
|
|
|
|
|
key: "on",
|
|
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
/**
|
|
|
|
|
* Adds the `listener` function as an event listener for `ev`.
|
|
|
|
|
*
|
|
|
|
|
* @param ev Name of the event
|
|
|
|
|
* @param listener Callback function
|
|
|
|
|
*/
|
|
|
|
|
value: function on(ev, listener) {
|
|
|
|
|
function on(ev, listener) {
|
|
|
|
|
_get(_getPrototypeOf(StrictEventEmitter.prototype), "on", this).call(this, ev, listener);
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -2003,11 +2003,7 @@ function useColors() {
|
|
|
|
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
|
|
|
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
|
|
|
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
|
|
|
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
|
|
|
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Colorize log arguments if enabled.
|
|
|
|
|
@@ -2150,7 +2146,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
|
|
|
|
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
|
|
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
|
|
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
|
|
|
|
|
|
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
|
|
|
|
|
|
|
|
@@ -2215,6 +2211,8 @@ function setup(env) {
|
|
|
|
|
function createDebug(namespace) {
|
|
|
|
|
var prevTime;
|
|
|
|
|
var enableOverride = null;
|
|
|
|
|
var namespacesCache;
|
|
|
|
|
var enabledCache;
|
|
|
|
|
|
|
|
|
|
function debug() {
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
|
|
@@ -2278,7 +2276,16 @@ function setup(env) {
|
|
|
|
|
enumerable: true,
|
|
|
|
|
configurable: false,
|
|
|
|
|
get: function get() {
|
|
|
|
|
return enableOverride === null ? createDebug.enabled(namespace) : enableOverride;
|
|
|
|
|
if (enableOverride !== null) {
|
|
|
|
|
return enableOverride;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (namespacesCache !== createDebug.namespaces) {
|
|
|
|
|
namespacesCache = createDebug.namespaces;
|
|
|
|
|
enabledCache = createDebug.enabled(namespace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return enabledCache;
|
|
|
|
|
},
|
|
|
|
|
set: function set(v) {
|
|
|
|
|
enableOverride = v;
|
|
|
|
|
@@ -2308,6 +2315,7 @@ function setup(env) {
|
|
|
|
|
|
|
|
|
|
function enable(namespaces) {
|
|
|
|
|
createDebug.save(namespaces);
|
|
|
|
|
createDebug.namespaces = namespaces;
|
|
|
|
|
createDebug.names = [];
|
|
|
|
|
createDebug.skips = [];
|
|
|
|
|
var i;
|
|
|
|
|
@@ -2490,11 +2498,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -2510,6 +2518,9 @@ var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/inde
|
|
|
|
|
|
|
|
|
|
var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
|
|
|
|
|
|
|
|
|
|
var _require = __webpack_require__(/*! ./util */ "./node_modules/engine.io-client/lib/util.js"),
|
|
|
|
|
installTimerFunctions = _require.installTimerFunctions;
|
|
|
|
|
|
|
|
|
|
var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
_inherits(Socket, _Emitter);
|
|
|
|
|
|
|
|
|
|
@@ -2546,6 +2557,7 @@ var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
opts.hostname = parseuri(opts.host).host;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
installTimerFunctions(_assertThisInitialized(_this), opts);
|
|
|
|
|
_this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
|
|
|
|
|
|
|
|
|
|
if (opts.hostname && !opts.port) {
|
|
|
|
|
@@ -2665,7 +2677,7 @@ var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
transport = "websocket";
|
|
|
|
|
} else if (0 === this.transports.length) {
|
|
|
|
|
// Emit error on next tick so it can be listened to
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
this.setTimeoutFn(function () {
|
|
|
|
|
_this2.emit("error", "No transports available");
|
|
|
|
|
}, 0);
|
|
|
|
|
return;
|
|
|
|
|
@@ -2883,6 +2895,7 @@ var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
case "ping":
|
|
|
|
|
this.resetPingTimeout();
|
|
|
|
|
this.sendPacket("pong");
|
|
|
|
|
this.emit("ping");
|
|
|
|
|
this.emit("pong");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
@@ -2933,8 +2946,8 @@ var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
value: function resetPingTimeout() {
|
|
|
|
|
var _this5 = this;
|
|
|
|
|
|
|
|
|
|
clearTimeout(this.pingTimeoutTimer);
|
|
|
|
|
this.pingTimeoutTimer = setTimeout(function () {
|
|
|
|
|
this.clearTimeoutFn(this.pingTimeoutTimer);
|
|
|
|
|
this.pingTimeoutTimer = this.setTimeoutFn(function () {
|
|
|
|
|
_this5.onClose("ping timeout");
|
|
|
|
|
}, this.pingInterval + this.pingTimeout);
|
|
|
|
|
|
|
|
|
|
@@ -3122,8 +3135,8 @@ var Socket = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
|
|
|
|
|
debug('socket close with reason: "%s"', reason); // clear timers
|
|
|
|
|
|
|
|
|
|
clearTimeout(this.pingIntervalTimer);
|
|
|
|
|
clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport
|
|
|
|
|
this.clearTimeoutFn(this.pingIntervalTimer);
|
|
|
|
|
this.clearTimeoutFn(this.pingTimeoutTimer); // stop event from firing again for transport
|
|
|
|
|
|
|
|
|
|
this.transport.removeAllListeners("close"); // ensure transport won't stay open
|
|
|
|
|
|
|
|
|
|
@@ -3219,11 +3232,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -3231,6 +3244,9 @@ var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.
|
|
|
|
|
|
|
|
|
|
var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
|
|
|
|
|
|
|
|
|
|
var _require = __webpack_require__(/*! ./util */ "./node_modules/engine.io-client/lib/util.js"),
|
|
|
|
|
installTimerFunctions = _require.installTimerFunctions;
|
|
|
|
|
|
|
|
|
|
var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:transport");
|
|
|
|
|
|
|
|
|
|
var Transport = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
@@ -3250,6 +3266,7 @@ var Transport = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
_classCallCheck(this, Transport);
|
|
|
|
|
|
|
|
|
|
_this = _super.call(this);
|
|
|
|
|
installTimerFunctions(_assertThisInitialized(_this), opts);
|
|
|
|
|
_this.opts = opts;
|
|
|
|
|
_this.query = opts.query;
|
|
|
|
|
_this.readyState = "";
|
|
|
|
|
@@ -3386,7 +3403,7 @@ module.exports = Transport;
|
|
|
|
|
/*! no static exports found */
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
var XMLHttpRequest = __webpack_require__(/*! ../../contrib/xmlhttprequest-ssl/XMLHttpRequest */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
|
|
|
|
|
var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
|
|
|
|
|
|
|
|
|
|
var XHR = __webpack_require__(/*! ./polling-xhr */ "./node_modules/engine.io-client/lib/transports/polling-xhr.js");
|
|
|
|
|
|
|
|
|
|
@@ -3460,11 +3477,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -3519,13 +3536,18 @@ var JSONPPolling = /*#__PURE__*/function (_Polling) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(JSONPPolling, [{
|
|
|
|
|
key: "doClose",
|
|
|
|
|
|
|
|
|
|
key: "supportsBinary",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Closes the socket.
|
|
|
|
|
*
|
|
|
|
|
* @api private
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "doClose",
|
|
|
|
|
value: function doClose() {
|
|
|
|
|
if (this.script) {
|
|
|
|
|
// prevent spurious errors from being emitted when the window is unloaded
|
|
|
|
|
@@ -3580,7 +3602,7 @@ var JSONPPolling = /*#__PURE__*/function (_Polling) {
|
|
|
|
|
var isUAgecko = "undefined" !== typeof navigator && /gecko/i.test(navigator.userAgent);
|
|
|
|
|
|
|
|
|
|
if (isUAgecko) {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
this.setTimeoutFn(function () {
|
|
|
|
|
var iframe = document.createElement("iframe");
|
|
|
|
|
document.body.appendChild(iframe);
|
|
|
|
|
document.body.removeChild(iframe);
|
|
|
|
|
@@ -3673,11 +3695,6 @@ var JSONPPolling = /*#__PURE__*/function (_Polling) {
|
|
|
|
|
this.iframe.onload = complete;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "supportsBinary",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return JSONPPolling;
|
|
|
|
|
@@ -3710,23 +3727,24 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
/* global attachEvent */
|
|
|
|
|
var XMLHttpRequest = __webpack_require__(/*! ../../contrib/xmlhttprequest-ssl/XMLHttpRequest */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
|
|
|
|
|
var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
|
|
|
|
|
|
|
|
|
|
var Polling = __webpack_require__(/*! ./polling */ "./node_modules/engine.io-client/lib/transports/polling.js");
|
|
|
|
|
|
|
|
|
|
var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
|
|
|
|
|
|
|
|
|
|
var _require = __webpack_require__(/*! ../util */ "./node_modules/engine.io-client/lib/util.js"),
|
|
|
|
|
pick = _require.pick;
|
|
|
|
|
pick = _require.pick,
|
|
|
|
|
installTimerFunctions = _require.installTimerFunctions;
|
|
|
|
|
|
|
|
|
|
var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
|
|
|
|
|
|
|
|
|
|
@@ -3866,6 +3884,7 @@ var Request = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
_classCallCheck(this, Request);
|
|
|
|
|
|
|
|
|
|
_this4 = _super2.call(this);
|
|
|
|
|
installTimerFunctions(_assertThisInitialized(_this4), opts);
|
|
|
|
|
_this4.opts = opts;
|
|
|
|
|
_this4.method = opts.method || "GET";
|
|
|
|
|
_this4.uri = uri;
|
|
|
|
|
@@ -3945,7 +3964,7 @@ var Request = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
} else {
|
|
|
|
|
// make sure the `error` event handler that's user-set
|
|
|
|
|
// does not throw in the same tick and gets caught here
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
_this5.setTimeoutFn(function () {
|
|
|
|
|
_this5.onError(typeof xhr.status === "number" ? xhr.status : 0);
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
@@ -3958,7 +3977,7 @@ var Request = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
// Need to defer since .create() is called directly from the constructor
|
|
|
|
|
// and thus the 'error' event can only be only bound *after* this exception
|
|
|
|
|
// occurs. Therefore, also, we cannot throw here at all.
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
this.setTimeoutFn(function () {
|
|
|
|
|
_this5.onError(e);
|
|
|
|
|
}, 0);
|
|
|
|
|
return;
|
|
|
|
|
@@ -4131,11 +4150,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -4161,14 +4180,23 @@ var Polling = /*#__PURE__*/function (_Transport) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_createClass(Polling, [{
|
|
|
|
|
key: "doOpen",
|
|
|
|
|
|
|
|
|
|
key: "name",
|
|
|
|
|
get:
|
|
|
|
|
/**
|
|
|
|
|
* Transport name.
|
|
|
|
|
*/
|
|
|
|
|
function get() {
|
|
|
|
|
return "polling";
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Opens the socket (triggers polling). We write a PING message to determine
|
|
|
|
|
* when the transport is open.
|
|
|
|
|
*
|
|
|
|
|
* @api private
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "doOpen",
|
|
|
|
|
value: function doOpen() {
|
|
|
|
|
this.poll();
|
|
|
|
|
}
|
|
|
|
|
@@ -4361,15 +4389,6 @@ var Polling = /*#__PURE__*/function (_Transport) {
|
|
|
|
|
var ipv6 = this.opts.hostname.indexOf(":") !== -1;
|
|
|
|
|
return schema + "://" + (ipv6 ? "[" + this.opts.hostname + "]" : this.opts.hostname) + port + this.opts.path + query;
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "name",
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Transport name.
|
|
|
|
|
*/
|
|
|
|
|
get: function get() {
|
|
|
|
|
return "polling";
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Polling;
|
|
|
|
|
@@ -4388,10 +4407,25 @@ module.exports = Polling;
|
|
|
|
|
|
|
|
|
|
var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
|
|
|
|
|
|
|
|
|
|
var nextTick = function () {
|
|
|
|
|
var isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function";
|
|
|
|
|
|
|
|
|
|
if (isPromiseAvailable) {
|
|
|
|
|
return function (cb) {
|
|
|
|
|
return Promise.resolve().then(cb);
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
return function (cb, setTimeoutFn) {
|
|
|
|
|
return setTimeoutFn(cb, 0);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
WebSocket: globalThis.WebSocket || globalThis.MozWebSocket,
|
|
|
|
|
usingBrowserWebSocket: true,
|
|
|
|
|
defaultBinaryType: "arraybuffer"
|
|
|
|
|
defaultBinaryType: "arraybuffer",
|
|
|
|
|
nextTick: nextTick
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
@@ -4417,11 +4451,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -4439,7 +4473,8 @@ var _require = __webpack_require__(/*! ../util */ "./node_modules/engine.io-clie
|
|
|
|
|
var _require2 = __webpack_require__(/*! ./websocket-constructor */ "./node_modules/engine.io-client/lib/transports/websocket-constructor.browser.js"),
|
|
|
|
|
WebSocket = _require2.WebSocket,
|
|
|
|
|
usingBrowserWebSocket = _require2.usingBrowserWebSocket,
|
|
|
|
|
defaultBinaryType = _require2.defaultBinaryType;
|
|
|
|
|
defaultBinaryType = _require2.defaultBinaryType,
|
|
|
|
|
nextTick = _require2.nextTick;
|
|
|
|
|
|
|
|
|
|
var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("engine.io-client:websocket"); // detect ReactNative environment
|
|
|
|
|
|
|
|
|
|
@@ -4474,13 +4509,18 @@ var WS = /*#__PURE__*/function (_Transport) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(WS, [{
|
|
|
|
|
key: "doOpen",
|
|
|
|
|
|
|
|
|
|
key: "name",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return "websocket";
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Opens socket.
|
|
|
|
|
*
|
|
|
|
|
* @api private
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "doOpen",
|
|
|
|
|
value: function doOpen() {
|
|
|
|
|
if (!this.check()) {
|
|
|
|
|
// let probe timeout
|
|
|
|
|
@@ -4587,11 +4627,11 @@ var WS = /*#__PURE__*/function (_Transport) {
|
|
|
|
|
if (lastPacket) {
|
|
|
|
|
// fake drain
|
|
|
|
|
// defer to next tick to allow Socket to clear writeBuffer
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
nextTick(function () {
|
|
|
|
|
_this3.writable = true;
|
|
|
|
|
|
|
|
|
|
_this3.emit("drain");
|
|
|
|
|
}, 0);
|
|
|
|
|
}, _this3.setTimeoutFn);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@@ -4673,11 +4713,6 @@ var WS = /*#__PURE__*/function (_Transport) {
|
|
|
|
|
value: function check() {
|
|
|
|
|
return !!WebSocket && !("__initialize" in WebSocket && this.name === WS.prototype.name);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "name",
|
|
|
|
|
get: function get() {
|
|
|
|
|
return "websocket";
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return WS;
|
|
|
|
|
@@ -4692,7 +4727,9 @@ module.exports = WS;
|
|
|
|
|
!*** ./node_modules/engine.io-client/lib/util.js ***!
|
|
|
|
|
\***************************************************/
|
|
|
|
|
/*! no static exports found */
|
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
var globalThis = __webpack_require__(/*! ./globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
|
|
|
|
|
|
|
|
|
|
module.exports.pick = function (obj) {
|
|
|
|
|
for (var _len = arguments.length, attr = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
|
|
|
@@ -4706,6 +4743,20 @@ module.exports.pick = function (obj) {
|
|
|
|
|
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
}; // Keep a reference to the real timeout functions so they can be used when overridden
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var NATIVE_SET_TIMEOUT = setTimeout;
|
|
|
|
|
var NATIVE_CLEAR_TIMEOUT = clearTimeout;
|
|
|
|
|
|
|
|
|
|
module.exports.installTimerFunctions = function (obj, opts) {
|
|
|
|
|
if (opts.useNativeTimers) {
|
|
|
|
|
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);
|
|
|
|
|
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);
|
|
|
|
|
} else {
|
|
|
|
|
obj.setTimeoutFn = setTimeout.bind(globalThis);
|
|
|
|
|
obj.clearTimeoutFn = clearTimeout.bind(globalThis);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
@@ -5523,11 +5574,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
@@ -5580,14 +5631,14 @@ var Encoder = /*#__PURE__*/function () {
|
|
|
|
|
|
|
|
|
|
_createClass(Encoder, [{
|
|
|
|
|
key: "encode",
|
|
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
/**
|
|
|
|
|
* Encode a packet as a single string if non-binary, or as a
|
|
|
|
|
* buffer sequence, depending on packet type.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} obj - packet object
|
|
|
|
|
*/
|
|
|
|
|
value: function encode(obj) {
|
|
|
|
|
function encode(obj) {
|
|
|
|
|
debug("encoding packet %j", obj);
|
|
|
|
|
|
|
|
|
|
if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
|
|
|
|
|
@@ -5800,11 +5851,11 @@ var Decoder = /*#__PURE__*/function (_Emitter) {
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "destroy",
|
|
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
/**
|
|
|
|
|
* Deallocates a parser's resources
|
|
|
|
|
*/
|
|
|
|
|
value: function destroy() {
|
|
|
|
|
function destroy() {
|
|
|
|
|
if (this.reconstructor) {
|
|
|
|
|
this.reconstructor.finishedReconstruction();
|
|
|
|
|
}
|
|
|
|
|
|