Last active
December 3, 2024 11:28
-
-
Save ezirmusitua/fb00ff413ae97523a11a49aa86eed08e to your computer and use it in GitHub Desktop.
MQTT for taro-dd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (factory) { | |
typeof define === "function" && define.amd ? define(factory) : factory(); | |
})(function () { | |
"use strict"; | |
function _classCallCheck(instance, Constructor) { | |
if (!(instance instanceof Constructor)) { | |
throw new TypeError("Cannot call a class as a function"); | |
} | |
} | |
function _defineProperties(target, props) { | |
for (var i = 0; i < props.length; i++) { | |
var descriptor = props[i]; | |
descriptor.enumerable = descriptor.enumerable || false; | |
descriptor.configurable = true; | |
if ("value" in descriptor) descriptor.writable = true; | |
Object.defineProperty(target, descriptor.key, descriptor); | |
} | |
} | |
function _createClass(Constructor, protoProps, staticProps) { | |
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
if (staticProps) _defineProperties(Constructor, staticProps); | |
Object.defineProperty(Constructor, "prototype", { | |
writable: false, | |
}); | |
return Constructor; | |
} | |
function _inherits(subClass, superClass) { | |
if (typeof superClass !== "function" && superClass !== null) { | |
throw new TypeError("Super expression must either be null or a function"); | |
} | |
subClass.prototype = Object.create(superClass && superClass.prototype, { | |
constructor: { | |
value: subClass, | |
writable: true, | |
configurable: true, | |
}, | |
}); | |
Object.defineProperty(subClass, "prototype", { | |
writable: false, | |
}); | |
if (superClass) _setPrototypeOf(subClass, superClass); | |
} | |
function _getPrototypeOf(o) { | |
_getPrototypeOf = Object.setPrototypeOf | |
? Object.getPrototypeOf.bind() | |
: function _getPrototypeOf(o) { | |
return o.__proto__ || Object.getPrototypeOf(o); | |
}; | |
return _getPrototypeOf(o); | |
} | |
function _setPrototypeOf(o, p) { | |
_setPrototypeOf = Object.setPrototypeOf | |
? Object.setPrototypeOf.bind() | |
: function _setPrototypeOf(o, p) { | |
o.__proto__ = p; | |
return o; | |
}; | |
return _setPrototypeOf(o, p); | |
} | |
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 _assertThisInitialized(self) { | |
if (self === void 0) { | |
throw new ReferenceError( | |
"this hasn't been initialised - super() hasn't been called", | |
); | |
} | |
return 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 _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 _superPropBase(object, property) { | |
while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
object = _getPrototypeOf(object); | |
if (object === null) break; | |
} | |
return object; | |
} | |
function _get() { | |
if (typeof Reflect !== "undefined" && Reflect.get) { | |
_get = Reflect.get.bind(); | |
} else { | |
_get = function _get(target, property, receiver) { | |
var base = _superPropBase(target, property); | |
if (!base) return; | |
var desc = Object.getOwnPropertyDescriptor(base, property); | |
if (desc.get) { | |
return desc.get.call(arguments.length < 3 ? target : receiver); | |
} | |
return desc.value; | |
}; | |
} | |
return _get.apply(this, arguments); | |
} | |
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 _arrayLikeToArray(arr, len) { | |
if (len == null || len > arr.length) len = arr.length; | |
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | |
return arr2; | |
} | |
function _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 () {}; | |
return { | |
s: F, | |
n: function () { | |
if (i >= o.length) | |
return { | |
done: true, | |
}; | |
return { | |
done: false, | |
value: o[i++], | |
}; | |
}, | |
e: function (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 () { | |
it = it.call(o); | |
}, | |
n: function () { | |
var step = it.next(); | |
normalCompletion = step.done; | |
return step; | |
}, | |
e: function (e) { | |
didErr = true; | |
err = e; | |
}, | |
f: function () { | |
try { | |
if (!normalCompletion && it.return != null) it.return(); | |
} finally { | |
if (didErr) throw err; | |
} | |
}, | |
}; | |
} | |
var Emitter = /*#__PURE__*/ (function () { | |
function Emitter() { | |
_classCallCheck(this, Emitter); | |
Object.defineProperty(this, "listeners", { | |
value: {}, | |
writable: true, | |
configurable: true, | |
}); | |
} | |
_createClass(Emitter, [ | |
{ | |
key: "addEventListener", | |
value: function addEventListener(type, callback, options) { | |
if (!(type in this.listeners)) { | |
this.listeners[type] = []; | |
} | |
this.listeners[type].push({ | |
callback: callback, | |
options: options, | |
}); | |
}, | |
}, | |
{ | |
key: "removeEventListener", | |
value: function removeEventListener(type, callback) { | |
if (!(type in this.listeners)) { | |
return; | |
} | |
var stack = this.listeners[type]; | |
for (var i = 0, l = stack.length; i < l; i++) { | |
if (stack[i].callback === callback) { | |
stack.splice(i, 1); | |
return; | |
} | |
} | |
}, | |
}, | |
{ | |
key: "dispatchEvent", | |
value: function dispatchEvent(event) { | |
if (!(event.type in this.listeners)) { | |
return; | |
} | |
var stack = this.listeners[event.type]; | |
var stackToCall = stack.slice(); | |
for (var i = 0, l = stackToCall.length; i < l; i++) { | |
var listener = stackToCall[i]; | |
try { | |
listener.callback.call(this, event); | |
} catch (e) { | |
Promise.resolve().then(function () { | |
throw e; | |
}); | |
} | |
if (listener.options && listener.options.once) { | |
this.removeEventListener(event.type, listener.callback); | |
} | |
} | |
return !event.defaultPrevented; | |
}, | |
}, | |
]); | |
return Emitter; | |
})(); | |
var AbortSignal = /*#__PURE__*/ (function (_Emitter) { | |
_inherits(AbortSignal, _Emitter); | |
var _super = _createSuper(AbortSignal); | |
function AbortSignal() { | |
var _this; | |
_classCallCheck(this, AbortSignal); | |
_this = _super.call(this); // Some versions of babel does not transpile super() correctly for IE <= 10, if the parent | |
// constructor has failed to run, then "this.listeners" will still be undefined and then we call | |
// the parent constructor directly instead as a workaround. For general details, see babel bug: | |
// https://github.com/babel/babel/issues/3041 | |
// This hack was added as a fix for the issue described here: | |
// https://github.com/Financial-Times/polyfill-library/pull/59#issuecomment-477558042 | |
if (!_this.listeners) { | |
Emitter.call(_assertThisInitialized(_this)); | |
} // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | |
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | |
Object.defineProperty(_assertThisInitialized(_this), "aborted", { | |
value: false, | |
writable: true, | |
configurable: true, | |
}); | |
Object.defineProperty(_assertThisInitialized(_this), "onabort", { | |
value: null, | |
writable: true, | |
configurable: true, | |
}); | |
Object.defineProperty(_assertThisInitialized(_this), "reason", { | |
value: undefined, | |
writable: true, | |
configurable: true, | |
}); | |
return _this; | |
} | |
_createClass( | |
AbortSignal, | |
[ | |
{ | |
key: "toString", | |
value: function toString() { | |
return "[object AbortSignal]"; | |
}, | |
}, | |
{ | |
key: "dispatchEvent", | |
value: function dispatchEvent(event) { | |
if (event.type === "abort") { | |
this.aborted = true; | |
if (typeof this.onabort === "function") { | |
this.onabort.call(this, event); | |
} | |
} | |
_get( | |
_getPrototypeOf(AbortSignal.prototype), | |
"dispatchEvent", | |
this, | |
).call(this, event); | |
}, | |
/** | |
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/throwIfAborted} | |
*/ | |
}, | |
{ | |
key: "throwIfAborted", | |
value: function throwIfAborted() { | |
var aborted = this.aborted, | |
_this$reason = this.reason, | |
reason = _this$reason === void 0 ? "Aborted" : _this$reason; | |
if (!aborted) return; | |
throw reason; | |
}, | |
/** | |
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/timeout_static} | |
* @param {number} time The "active" time in milliseconds before the returned {@link AbortSignal} will abort. | |
* The value must be within range of 0 and {@link Number.MAX_SAFE_INTEGER}. | |
* @returns {AbortSignal} The signal will abort with its {@link AbortSignal.reason} property set to a `TimeoutError` {@link DOMException} on timeout, | |
* or an `AbortError` {@link DOMException} if the operation was user-triggered. | |
*/ | |
}, | |
], | |
[ | |
{ | |
key: "timeout", | |
value: function timeout(time) { | |
var controller = new AbortController(); | |
setTimeout(function () { | |
return controller.abort( | |
new DOMException( | |
"This signal is timeout in ".concat(time, "ms"), | |
"TimeoutError", | |
), | |
); | |
}, time); | |
return controller.signal; | |
}, | |
/** | |
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static} | |
* @param {Iterable<AbortSignal>} iterable An {@link Iterable} (such as an {@link Array}) of abort signals. | |
* @returns {AbortSignal} - **Already aborted**, if any of the abort signals given is already aborted. | |
* The returned {@link AbortSignal}'s reason will be already set to the `reason` of the first abort signal that was already aborted. | |
* - **Asynchronously aborted**, when any abort signal in `iterable` aborts. | |
* The `reason` will be set to the reason of the first abort signal that is aborted. | |
*/ | |
}, | |
{ | |
key: "any", | |
value: function any(iterable) { | |
var controller = new AbortController(); | |
/** | |
* @this AbortSignal | |
*/ | |
function abort() { | |
controller.abort(this.reason); | |
clean(); | |
} | |
function clean() { | |
var _iterator = _createForOfIteratorHelper(iterable), | |
_step; | |
try { | |
for (_iterator.s(); !(_step = _iterator.n()).done; ) { | |
var signal = _step.value; | |
signal.removeEventListener("abort", abort); | |
} | |
} catch (err) { | |
_iterator.e(err); | |
} finally { | |
_iterator.f(); | |
} | |
} | |
var _iterator2 = _createForOfIteratorHelper(iterable), | |
_step2; | |
try { | |
for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { | |
var signal = _step2.value; | |
if (signal.aborted) { | |
controller.abort(signal.reason); | |
break; | |
} else signal.addEventListener("abort", abort); | |
} | |
} catch (err) { | |
_iterator2.e(err); | |
} finally { | |
_iterator2.f(); | |
} | |
return controller.signal; | |
}, | |
}, | |
], | |
); | |
return AbortSignal; | |
})(Emitter); | |
var AbortController = /*#__PURE__*/ (function () { | |
function AbortController() { | |
_classCallCheck(this, AbortController); | |
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | |
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | |
Object.defineProperty(this, "signal", { | |
value: new AbortSignal(), | |
writable: true, | |
configurable: true, | |
}); | |
} | |
_createClass(AbortController, [ | |
{ | |
key: "abort", | |
value: function abort(reason) { | |
var event; | |
try { | |
event = new Event("abort"); | |
} catch (e) { | |
if (typeof document !== "undefined") { | |
if (!document.createEvent) { | |
// For Internet Explorer 8: | |
event = document.createEventObject(); | |
event.type = "abort"; | |
} else { | |
// For Internet Explorer 11: | |
event = document.createEvent("Event"); | |
event.initEvent("abort", false, false); | |
} | |
} else { | |
// Fallback where document isn't available: | |
event = { | |
type: "abort", | |
bubbles: false, | |
cancelable: false, | |
}; | |
} | |
} | |
var signalReason = reason; | |
if (signalReason === undefined) { | |
if (typeof document === "undefined") { | |
signalReason = new Error("This operation was aborted"); | |
signalReason.name = "AbortError"; | |
} else { | |
try { | |
signalReason = new DOMException( | |
"signal is aborted without reason", | |
); | |
signalReason.name = "AbortError"; | |
} catch (err) { | |
// IE 11 does not support calling the DOMException constructor, use a | |
// regular error object on it instead. | |
signalReason = new Error("This operation was aborted"); | |
signalReason.name = "AbortError"; | |
} | |
} | |
} | |
this.signal.reason = signalReason; | |
this.signal.dispatchEvent(event); | |
}, | |
}, | |
{ | |
key: "toString", | |
value: function toString() { | |
return "[object AbortController]"; | |
}, | |
}, | |
]); | |
return AbortController; | |
})(); | |
if (typeof Symbol !== "undefined" && Symbol.toStringTag) { | |
// These are necessary to make sure that we get correct output for: | |
// Object.prototype.toString.call(new AbortController()) | |
AbortController.prototype[Symbol.toStringTag] = "AbortController"; | |
AbortSignal.prototype[Symbol.toStringTag] = "AbortSignal"; | |
} | |
function polyfillNeeded(self) { | |
if (self.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) { | |
console.log( | |
"__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill", | |
); | |
return true; | |
} // Note that the "unfetch" minimal fetch polyfill defines fetch() without | |
// defining window.Request, and this polyfill need to work on top of unfetch | |
// so the below feature detection needs the !self.AbortController part. | |
// The Request.prototype check is also needed because Safari versions 11.1.2 | |
// up to and including 12.1.x has a window.AbortController present but still | |
// does NOT correctly implement abortable fetch: | |
// https://bugs.webkit.org/show_bug.cgi?id=174980#c2 | |
return ( | |
(typeof self.Request === "function" && | |
!self.Request.prototype.hasOwnProperty("signal")) || | |
!self.AbortController | |
); | |
} | |
(function (self) { | |
if (!polyfillNeeded(self)) return; | |
self.AbortController = AbortController; | |
self.AbortSignal = AbortSignal; | |
})(typeof self !== "undefined" ? self : window); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var globalThis = {}; | |
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } | |
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } | |
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } | |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | |
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | |
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | |
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } | |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | |
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } | |
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } | |
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); } | |
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } | |
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } } | |
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } | |
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } | |
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } | |
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } | |
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | |
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | |
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | |
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } | |
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } | |
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } | |
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } | |
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } | |
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | |
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n14 = 0, F = function F() {}; return { s: F, n: function n() { return _n14 >= r.length ? { done: !0 } : { done: !1, value: r[_n14++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } | |
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | |
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
var wo = Object.defineProperty, | |
ub = Object.defineProperties, | |
lb = Object.getOwnPropertyDescriptor, | |
fb = Object.getOwnPropertyDescriptors, | |
cb = Object.getOwnPropertyNames, | |
go = Object.getOwnPropertySymbols; | |
var na = Object.prototype.hasOwnProperty, | |
qf = Object.prototype.propertyIsEnumerable; | |
var Wn = function Wn(t, e) { | |
return (e = Symbol[t]) ? e : Symbol["for"]("Symbol." + t); | |
}, | |
Ae = Math.pow, | |
ra = function ra(t, e, r) { | |
return e in t ? wo(t, e, { | |
enumerable: !0, | |
configurable: !0, | |
writable: !0, | |
value: r | |
}) : t[e] = r; | |
}, | |
Ue = function Ue(t, e) { | |
for (var r in e || (e = {})) na.call(e, r) && ra(t, r, e[r]); | |
if (go) { | |
var _iterator = _createForOfIteratorHelper(go(e)), | |
_step; | |
try { | |
for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
var r = _step.value; | |
qf.call(e, r) && ra(t, r, e[r]); | |
} | |
} catch (err) { | |
_iterator.e(err); | |
} finally { | |
_iterator.f(); | |
} | |
} | |
return t; | |
}, | |
Xt = function Xt(t, e) { | |
return ub(t, fb(e)); | |
}; | |
var Uf = function Uf(t, e) { | |
var r = {}; | |
for (var n in t) na.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]); | |
if (t != null && go) { | |
var _iterator2 = _createForOfIteratorHelper(go(t)), | |
_step2; | |
try { | |
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | |
var n = _step2.value; | |
e.indexOf(n) < 0 && qf.call(t, n) && (r[n] = t[n]); | |
} | |
} catch (err) { | |
_iterator2.e(err); | |
} finally { | |
_iterator2.f(); | |
} | |
} | |
return r; | |
}; | |
var rt = function rt(t, e) { | |
return function () { | |
return t && (e = t(t = 0)), e; | |
}; | |
}; | |
var H = function H(t, e) { | |
return function () { | |
return e || t((e = { | |
exports: {} | |
}).exports, e), e.exports; | |
}; | |
}, | |
on = function on(t, e) { | |
for (var r in e) wo(t, r, { | |
get: e[r], | |
enumerable: !0 | |
}); | |
}, | |
hb = function hb(t, e, r, n) { | |
if (e && _typeof(e) == "object" || typeof e == "function") { | |
var _iterator3 = _createForOfIteratorHelper(cb(e)), | |
_step3; | |
try { | |
var _loop = function _loop() { | |
var i = _step3.value; | |
!na.call(t, i) && i !== r && wo(t, i, { | |
get: function get() { | |
return e[i]; | |
}, | |
enumerable: !(n = lb(e, i)) || n.enumerable | |
}); | |
}; | |
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { | |
_loop(); | |
} | |
} catch (err) { | |
_iterator3.e(err); | |
} finally { | |
_iterator3.f(); | |
} | |
} | |
return t; | |
}; | |
var Ie = function Ie(t) { | |
return hb(wo({}, "__esModule", { | |
value: !0 | |
}), t); | |
}; | |
var ke = function ke(t, e, r) { | |
return ra(t, _typeof(e) != "symbol" ? e + "" : e, r), r; | |
}, | |
ia = function ia(t, e, r) { | |
if (!e.has(t)) throw TypeError("Cannot " + r); | |
}; | |
var E = function E(t, e, r) { | |
return ia(t, e, "read from private field"), r ? r.call(t) : e.get(t); | |
}, | |
he = function he(t, e, r) { | |
if (e.has(t)) throw TypeError("Cannot add the same private member more than once"); | |
e instanceof WeakSet ? e.add(t) : e.set(t, r); | |
}, | |
ie = function ie(t, e, r, n) { | |
return ia(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r; | |
}; | |
var bo = function bo(t, e, r, n) { | |
return { | |
set _(i) { | |
ie(t, e, i, r); | |
}, | |
get _() { | |
return E(t, e, n); | |
} | |
}; | |
}, | |
J = function J(t, e, r) { | |
return ia(t, e, "access private method"), r; | |
}; | |
var Ee = function Ee(t, e, r) { | |
return new Promise(function (n, i) { | |
var s = function s(l) { | |
try { | |
a(r.next(l)); | |
} catch (c) { | |
i(c); | |
} | |
}, | |
o = function o(l) { | |
try { | |
a(r["throw"](l)); | |
} catch (c) { | |
i(c); | |
} | |
}, | |
a = function a(l) { | |
return l.done ? n(l.value) : Promise.resolve(l.value).then(s, o); | |
}; | |
a((r = r.apply(t, e)).next()); | |
}); | |
}, | |
et = function et(t, e) { | |
this[0] = t, this[1] = e; | |
}, | |
Rt = function Rt(t, e, r) { | |
var _n2 = function n(o, a, l, c) { | |
try { | |
var d = r[o](a), | |
h = (a = d.value) instanceof et, | |
m = d.done; | |
Promise.resolve(h ? a[0] : a).then(function (w) { | |
return h ? _n2(o === "return" ? o : "next", a[1] ? { | |
done: w.done, | |
value: w.value | |
} : w, l, c) : l({ | |
value: w, | |
done: m | |
}); | |
})["catch"](function (w) { | |
return _n2("throw", w, l, c); | |
}); | |
} catch (w) { | |
c(w); | |
} | |
}, | |
i = function i(o) { | |
return s[o] = function (a) { | |
return new Promise(function (l, c) { | |
return _n2(o, a, l, c); | |
}); | |
}; | |
}, | |
s = {}; | |
return r = r.apply(t, e), s[Wn("asyncIterator")] = function () { | |
return s; | |
}, i("next"), i("throw"), i("return"), s; | |
}, | |
Ot = function Ot(t) { | |
var e = t[Wn("asyncIterator")], | |
r = !1, | |
n, | |
i = {}; | |
return e == null ? (e = t[Wn("iterator")](), n = function n(s) { | |
return i[s] = function (o) { | |
return e[s](o); | |
}; | |
}) : (e = e.call(t), n = function n(s) { | |
return i[s] = function (o) { | |
if (r) { | |
if (r = !1, s === "throw") throw o; | |
return o; | |
} | |
return r = !0, { | |
done: !1, | |
value: new et(new Promise(function (a) { | |
var l = e[s](o); | |
if (!(l instanceof Object)) throw TypeError("Object expected"); | |
a(l); | |
}), 1) | |
}; | |
}; | |
}), i[Wn("iterator")] = function () { | |
return i; | |
}, n("next"), "throw" in e ? n("throw") : i["throw"] = function (s) { | |
throw s; | |
}, "return" in e && n("return"), i; | |
}, | |
gt = function gt(t, e, r) { | |
return (e = t[Wn("asyncIterator")]) ? e.call(t) : (t = t[Wn("iterator")](), e = {}, r = function r(n, i) { | |
return (i = t[n]) && (e[n] = function (s) { | |
return new Promise(function (o, a, l) { | |
return s = i.call(t, s), l = s.done, Promise.resolve(s.value).then(function (c) { | |
return o({ | |
value: c, | |
done: l | |
}); | |
}, a); | |
}); | |
}); | |
}, r("next"), r("return"), e); | |
}; | |
var P = rt(function () {}); | |
var L = {}; | |
on(L, { | |
_debugEnd: function _debugEnd() { | |
return Pc; | |
}, | |
_debugProcess: function _debugProcess() { | |
return Tc; | |
}, | |
_events: function _events() { | |
return $c; | |
}, | |
_eventsCount: function _eventsCount() { | |
return Hc; | |
}, | |
_exiting: function _exiting() { | |
return ac; | |
}, | |
_fatalExceptions: function _fatalExceptions() { | |
return Sc; | |
}, | |
_getActiveHandles: function _getActiveHandles() { | |
return cc; | |
}, | |
_getActiveRequests: function _getActiveRequests() { | |
return fc; | |
}, | |
_kill: function _kill() { | |
return dc; | |
}, | |
_linkedBinding: function _linkedBinding() { | |
return oc; | |
}, | |
_maxListeners: function _maxListeners() { | |
return Wc; | |
}, | |
_preload_modules: function _preload_modules() { | |
return Dc; | |
}, | |
_rawDebug: function _rawDebug() { | |
return nc; | |
}, | |
_startProfilerIdleNotifier: function _startProfilerIdleNotifier() { | |
return Rc; | |
}, | |
_stopProfilerIdleNotifier: function _stopProfilerIdleNotifier() { | |
return Oc; | |
}, | |
_tickCallback: function _tickCallback() { | |
return Ic; | |
}, | |
abort: function abort() { | |
return kc; | |
}, | |
addListener: function addListener() { | |
return Vc; | |
}, | |
allowedNodeEnvironmentFlags: function allowedNodeEnvironmentFlags() { | |
return _c; | |
}, | |
arch: function arch() { | |
return $f; | |
}, | |
argv: function argv() { | |
return zf; | |
}, | |
argv0: function argv0() { | |
return Uc; | |
}, | |
assert: function assert() { | |
return mc; | |
}, | |
binding: function binding() { | |
return Jf; | |
}, | |
browser: function browser() { | |
return rc; | |
}, | |
chdir: function chdir() { | |
return ec; | |
}, | |
config: function config() { | |
return uc; | |
}, | |
cpuUsage: function cpuUsage() { | |
return vo; | |
}, | |
cwd: function cwd() { | |
return Zf; | |
}, | |
debugPort: function debugPort() { | |
return qc; | |
}, | |
"default": function _default() { | |
return eh; | |
}, | |
dlopen: function dlopen() { | |
return lc; | |
}, | |
domain: function domain() { | |
return sc; | |
}, | |
emit: function emit() { | |
return Yc; | |
}, | |
emitWarning: function emitWarning() { | |
return Yf; | |
}, | |
env: function env() { | |
return Vf; | |
}, | |
execArgv: function execArgv() { | |
return Kf; | |
}, | |
execPath: function execPath() { | |
return Lc; | |
}, | |
exit: function exit() { | |
return wc; | |
}, | |
features: function features() { | |
return vc; | |
}, | |
hasUncaughtExceptionCaptureCallback: function hasUncaughtExceptionCaptureCallback() { | |
return Ac; | |
}, | |
hrtime: function hrtime() { | |
return mo; | |
}, | |
kill: function kill() { | |
return gc; | |
}, | |
listeners: function listeners() { | |
return Zc; | |
}, | |
memoryUsage: function memoryUsage() { | |
return yc; | |
}, | |
moduleLoadList: function moduleLoadList() { | |
return ic; | |
}, | |
nextTick: function nextTick() { | |
return Ff; | |
}, | |
off: function off() { | |
return Kc; | |
}, | |
on: function on() { | |
return _r; | |
}, | |
once: function once() { | |
return zc; | |
}, | |
openStdin: function openStdin() { | |
return bc; | |
}, | |
pid: function pid() { | |
return Mc; | |
}, | |
platform: function platform() { | |
return Hf; | |
}, | |
ppid: function ppid() { | |
return Nc; | |
}, | |
prependListener: function prependListener() { | |
return Jc; | |
}, | |
prependOnceListener: function prependOnceListener() { | |
return Xc; | |
}, | |
reallyExit: function reallyExit() { | |
return hc; | |
}, | |
release: function release() { | |
return tc; | |
}, | |
removeAllListeners: function removeAllListeners() { | |
return Qc; | |
}, | |
removeListener: function removeListener() { | |
return Gc; | |
}, | |
resourceUsage: function resourceUsage() { | |
return pc; | |
}, | |
setSourceMapsEnabled: function setSourceMapsEnabled() { | |
return Fc; | |
}, | |
setUncaughtExceptionCaptureCallback: function setUncaughtExceptionCaptureCallback() { | |
return Ec; | |
}, | |
stderr: function stderr() { | |
return Bc; | |
}, | |
stdin: function stdin() { | |
return Cc; | |
}, | |
stdout: function stdout() { | |
return xc; | |
}, | |
title: function title() { | |
return Wf; | |
}, | |
umask: function umask() { | |
return Xf; | |
}, | |
uptime: function uptime() { | |
return jc; | |
}, | |
version: function version() { | |
return Gf; | |
}, | |
versions: function versions() { | |
return Qf; | |
} | |
}); | |
function aa(t) { | |
throw new Error("Node.js process " + t + " is not supported by JSPM core outside of Node.js"); | |
} | |
function db() { | |
!$n || !sn || ($n = !1, sn.length ? br = sn.concat(br) : _o = -1, br.length && Df()); | |
} | |
function Df() { | |
if (!$n) { | |
var t = setTimeout(db, 0); | |
$n = !0; | |
for (var e = br.length; e;) { | |
for (sn = br, br = []; ++_o < e;) sn && sn[_o].run(); | |
_o = -1, e = br.length; | |
} | |
sn = null, $n = !1, clearTimeout(t); | |
} | |
} | |
function Ff(t) { | |
var e = new Array(arguments.length - 1); | |
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; | |
br.push(new jf(t, e)), br.length === 1 && !$n && setTimeout(Df, 0); | |
} | |
function jf(t, e) { | |
this.fun = t, this.array = e; | |
} | |
function nt() {} | |
function oc(t) { | |
aa("_linkedBinding"); | |
} | |
function lc(t) { | |
aa("dlopen"); | |
} | |
function fc() { | |
return []; | |
} | |
function cc() { | |
return []; | |
} | |
function mc(t, e) { | |
if (!t) throw new Error(e || "assertion error"); | |
} | |
function Ac() { | |
return !1; | |
} | |
function jc() { | |
return Mr.now() / 1e3; | |
} | |
function mo(t) { | |
var e = Math.floor((Date.now() - Mr.now()) * .001), | |
r = Mr.now() * .001, | |
n = Math.floor(r) + e, | |
i = Math.floor(r % 1 * 1e9); | |
return t && (n = n - t[0], i = i - t[1], i < 0 && (n--, i += sa)), [n, i]; | |
} | |
function _r() { | |
return eh; | |
} | |
function Zc(t) { | |
return []; | |
} | |
var br, | |
$n, | |
sn, | |
_o, | |
Wf, | |
$f, | |
Hf, | |
Vf, | |
zf, | |
Kf, | |
Gf, | |
Qf, | |
Yf, | |
Jf, | |
Xf, | |
Zf, | |
ec, | |
tc, | |
rc, | |
nc, | |
ic, | |
sc, | |
ac, | |
uc, | |
hc, | |
dc, | |
vo, | |
pc, | |
yc, | |
gc, | |
wc, | |
bc, | |
_c, | |
vc, | |
Sc, | |
Ec, | |
Ic, | |
Tc, | |
Pc, | |
Rc, | |
Oc, | |
xc, | |
Bc, | |
Cc, | |
kc, | |
Mc, | |
Nc, | |
Lc, | |
qc, | |
Uc, | |
Dc, | |
Fc, | |
Mr, | |
oa, | |
sa, | |
Wc, | |
$c, | |
Hc, | |
Vc, | |
zc, | |
Kc, | |
Gc, | |
Qc, | |
Yc, | |
Jc, | |
Xc, | |
eh, | |
th = rt(function () { | |
P(); | |
O(); | |
R(); | |
br = [], $n = !1, _o = -1; | |
jf.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
Wf = "browser", $f = "x64", Hf = "browser", Vf = { | |
PATH: "/usr/bin", | |
LANG: typeof navigator != "undefined" ? navigator.language + ".UTF-8" : void 0, | |
PWD: "/", | |
HOME: "/home", | |
TMP: "/tmp" | |
}, zf = ["/usr/bin/node"], Kf = [], Gf = "v16.8.0", Qf = {}, Yf = function Yf(t, e) { | |
console.warn((e ? e + ": " : "") + t); | |
}, Jf = function Jf(t) { | |
aa("binding"); | |
}, Xf = function Xf(t) { | |
return 0; | |
}, Zf = function Zf() { | |
return "/"; | |
}, ec = function ec(t) {}, tc = { | |
name: "node", | |
sourceUrl: "", | |
headersUrl: "", | |
libUrl: "" | |
}; | |
rc = !0, nc = nt, ic = []; | |
sc = {}, ac = !1, uc = {}; | |
hc = nt, dc = nt, vo = function vo() { | |
return {}; | |
}, pc = vo, yc = vo, gc = nt, wc = nt, bc = nt, _c = {}; | |
vc = { | |
inspector: !1, | |
debug: !1, | |
uv: !1, | |
ipv6: !1, | |
tls_alpn: !1, | |
tls_sni: !1, | |
tls_ocsp: !1, | |
tls: !1, | |
cached_builtins: !0 | |
}, Sc = nt, Ec = nt; | |
Ic = nt, Tc = nt, Pc = nt, Rc = nt, Oc = nt, xc = void 0, Bc = void 0, Cc = void 0, kc = nt, Mc = 2, Nc = 1, Lc = "/bin/usr/node", qc = 9229, Uc = "node", Dc = [], Fc = nt, Mr = { | |
now: typeof performance != "undefined" ? performance.now.bind(performance) : void 0, | |
timing: typeof performance != "undefined" ? performance.timing : void 0 | |
}; | |
Mr.now === void 0 && (oa = Date.now(), Mr.timing && Mr.timing.navigationStart && (oa = Mr.timing.navigationStart), Mr.now = function () { | |
return Date.now() - oa; | |
}); | |
sa = 1e9; | |
mo.bigint = function (t) { | |
var e = mo(t); | |
return typeof BigInt == "undefined" ? e[0] * sa + e[1] : BigInt(e[0] * sa) + BigInt(e[1]); | |
}; | |
Wc = 10, $c = {}, Hc = 0; | |
Vc = _r, zc = _r, Kc = _r, Gc = _r, Qc = _r, Yc = nt, Jc = _r, Xc = _r; | |
eh = { | |
version: Gf, | |
versions: Qf, | |
arch: $f, | |
platform: Hf, | |
browser: rc, | |
release: tc, | |
_rawDebug: nc, | |
moduleLoadList: ic, | |
binding: Jf, | |
_linkedBinding: oc, | |
_events: $c, | |
_eventsCount: Hc, | |
_maxListeners: Wc, | |
on: _r, | |
addListener: Vc, | |
once: zc, | |
off: Kc, | |
removeListener: Gc, | |
removeAllListeners: Qc, | |
emit: Yc, | |
prependListener: Jc, | |
prependOnceListener: Xc, | |
listeners: Zc, | |
domain: sc, | |
_exiting: ac, | |
config: uc, | |
dlopen: lc, | |
uptime: jc, | |
_getActiveRequests: fc, | |
_getActiveHandles: cc, | |
reallyExit: hc, | |
_kill: dc, | |
cpuUsage: vo, | |
resourceUsage: pc, | |
memoryUsage: yc, | |
kill: gc, | |
exit: wc, | |
openStdin: bc, | |
allowedNodeEnvironmentFlags: _c, | |
assert: mc, | |
features: vc, | |
_fatalExceptions: Sc, | |
setUncaughtExceptionCaptureCallback: Ec, | |
hasUncaughtExceptionCaptureCallback: Ac, | |
emitWarning: Yf, | |
nextTick: Ff, | |
_tickCallback: Ic, | |
_debugProcess: Tc, | |
_debugEnd: Pc, | |
_startProfilerIdleNotifier: Rc, | |
_stopProfilerIdleNotifier: Oc, | |
stdout: xc, | |
stdin: Cc, | |
stderr: Bc, | |
abort: kc, | |
umask: Xf, | |
chdir: ec, | |
cwd: Zf, | |
env: Vf, | |
title: Wf, | |
argv: zf, | |
execArgv: Kf, | |
pid: Mc, | |
ppid: Nc, | |
execPath: Lc, | |
debugPort: qc, | |
hrtime: mo, | |
argv0: Uc, | |
_preload_modules: Dc, | |
setSourceMapsEnabled: Fc | |
}; | |
}); | |
var R = rt(function () { | |
th(); | |
}); | |
function pb() { | |
if (rh) return Pi; | |
rh = !0, Pi.byteLength = a, Pi.toByteArray = c, Pi.fromByteArray = m; | |
for (var t = [], e = [], r = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, s = n.length; i < s; ++i) t[i] = n[i], e[n.charCodeAt(i)] = i; | |
e[45] = 62, e[95] = 63; | |
function o(w) { | |
var T = w.length; | |
if (T % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); | |
var v = w.indexOf("="); | |
v === -1 && (v = T); | |
var b = v === T ? 0 : 4 - v % 4; | |
return [v, b]; | |
} | |
function a(w) { | |
var T = o(w), | |
v = T[0], | |
b = T[1]; | |
return (v + b) * 3 / 4 - b; | |
} | |
function l(w, T, v) { | |
return (T + v) * 3 / 4 - v; | |
} | |
function c(w) { | |
var T, | |
v = o(w), | |
b = v[0], | |
p = v[1], | |
_ = new r(l(w, b, p)), | |
x = 0, | |
I = p > 0 ? b - 4 : b, | |
y; | |
for (y = 0; y < I; y += 4) T = e[w.charCodeAt(y)] << 18 | e[w.charCodeAt(y + 1)] << 12 | e[w.charCodeAt(y + 2)] << 6 | e[w.charCodeAt(y + 3)], _[x++] = T >> 16 & 255, _[x++] = T >> 8 & 255, _[x++] = T & 255; | |
return p === 2 && (T = e[w.charCodeAt(y)] << 2 | e[w.charCodeAt(y + 1)] >> 4, _[x++] = T & 255), p === 1 && (T = e[w.charCodeAt(y)] << 10 | e[w.charCodeAt(y + 1)] << 4 | e[w.charCodeAt(y + 2)] >> 2, _[x++] = T >> 8 & 255, _[x++] = T & 255), _; | |
} | |
function d(w) { | |
return t[w >> 18 & 63] + t[w >> 12 & 63] + t[w >> 6 & 63] + t[w & 63]; | |
} | |
function h(w, T, v) { | |
for (var b, p = [], _ = T; _ < v; _ += 3) b = (w[_] << 16 & 16711680) + (w[_ + 1] << 8 & 65280) + (w[_ + 2] & 255), p.push(d(b)); | |
return p.join(""); | |
} | |
function m(w) { | |
for (var T, v = w.length, b = v % 3, p = [], _ = 16383, x = 0, I = v - b; x < I; x += _) p.push(h(w, x, x + _ > I ? I : x + _)); | |
return b === 1 ? (T = w[v - 1], p.push(t[T >> 2] + t[T << 4 & 63] + "==")) : b === 2 && (T = (w[v - 2] << 8) + w[v - 1], p.push(t[T >> 10] + t[T >> 4 & 63] + t[T << 2 & 63] + "=")), p.join(""); | |
} | |
return Pi; | |
} | |
function yb() { | |
if (nh) return So; | |
nh = !0; | |
return So.read = function (t, e, r, n, i) { | |
var s, | |
o, | |
a = i * 8 - n - 1, | |
l = (1 << a) - 1, | |
c = l >> 1, | |
d = -7, | |
h = r ? i - 1 : 0, | |
m = r ? -1 : 1, | |
w = t[e + h]; | |
for (h += m, s = w & (1 << -d) - 1, w >>= -d, d += a; d > 0; s = s * 256 + t[e + h], h += m, d -= 8); | |
for (o = s & (1 << -d) - 1, s >>= -d, d += n; d > 0; o = o * 256 + t[e + h], h += m, d -= 8); | |
if (s === 0) s = 1 - c;else { | |
if (s === l) return o ? NaN : (w ? -1 : 1) * (1 / 0); | |
o = o + Math.pow(2, n), s = s - c; | |
} | |
return (w ? -1 : 1) * o * Math.pow(2, s - n); | |
}, So.write = function (t, e, r, n, i, s) { | |
var o, | |
a, | |
l, | |
c = s * 8 - i - 1, | |
d = (1 << c) - 1, | |
h = d >> 1, | |
m = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, | |
w = n ? 0 : s - 1, | |
T = n ? 1 : -1, | |
v = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0; | |
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, o = d) : (o = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -o)) < 1 && (o--, l *= 2), o + h >= 1 ? e += m / l : e += m * Math.pow(2, 1 - h), e * l >= 2 && (o++, l /= 2), o + h >= d ? (a = 0, o = d) : o + h >= 1 ? (a = (e * l - 1) * Math.pow(2, i), o = o + h) : (a = e * Math.pow(2, h - 1) * Math.pow(2, i), o = 0)); i >= 8; t[r + w] = a & 255, w += T, a /= 256, i -= 8); | |
for (o = o << i | a, c += i; c > 0; t[r + w] = o & 255, w += T, o /= 256, c -= 8); | |
t[r + w - T] |= v * 128; | |
}, So; | |
} | |
function Eo() { | |
if (ih) return an; | |
ih = !0; | |
var t = pb(), | |
e = yb(), | |
r = typeof Symbol == "function" && typeof Symbol["for"] == "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; | |
an.Buffer = o, an.SlowBuffer = p, an.INSPECT_MAX_BYTES = 50; | |
var n = 2147483647; | |
an.kMaxLength = n, o.TYPED_ARRAY_SUPPORT = i(), !o.TYPED_ARRAY_SUPPORT && typeof console != "undefined" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); | |
function i() { | |
try { | |
var g = new Uint8Array(1), | |
u = { | |
foo: function foo() { | |
return 42; | |
} | |
}; | |
return Object.setPrototypeOf(u, Uint8Array.prototype), Object.setPrototypeOf(g, u), g.foo() === 42; | |
} catch (g) { | |
return !1; | |
} | |
} | |
Object.defineProperty(o.prototype, "parent", { | |
enumerable: !0, | |
get: function get() { | |
if (o.isBuffer(this)) return this.buffer; | |
} | |
}), Object.defineProperty(o.prototype, "offset", { | |
enumerable: !0, | |
get: function get() { | |
if (o.isBuffer(this)) return this.byteOffset; | |
} | |
}); | |
function s(g) { | |
if (g > n) throw new RangeError('The value "' + g + '" is invalid for option "size"'); | |
var u = new Uint8Array(g); | |
return Object.setPrototypeOf(u, o.prototype), u; | |
} | |
function o(g, u, f) { | |
if (typeof g == "number") { | |
if (typeof u == "string") throw new TypeError('The "string" argument must be of type string. Received type number'); | |
return d(g); | |
} | |
return a(g, u, f); | |
} | |
o.poolSize = 8192; | |
function a(g, u, f) { | |
if (typeof g == "string") return h(g, u); | |
if (ArrayBuffer.isView(g)) return w(g); | |
if (g == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + _typeof(g)); | |
if (Pt(g, ArrayBuffer) || g && Pt(g.buffer, ArrayBuffer) || typeof SharedArrayBuffer != "undefined" && (Pt(g, SharedArrayBuffer) || g && Pt(g.buffer, SharedArrayBuffer))) return T(g, u, f); | |
if (typeof g == "number") throw new TypeError('The "value" argument must not be of type number. Received type number'); | |
var S = g.valueOf && g.valueOf(); | |
if (S != null && S !== g) return o.from(S, u, f); | |
var k = v(g); | |
if (k) return k; | |
if (typeof Symbol != "undefined" && Symbol.toPrimitive != null && typeof g[Symbol.toPrimitive] == "function") return o.from(g[Symbol.toPrimitive]("string"), u, f); | |
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + _typeof(g)); | |
} | |
o.from = function (g, u, f) { | |
return a(g, u, f); | |
}, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array); | |
function l(g) { | |
if (typeof g != "number") throw new TypeError('"size" argument must be of type number'); | |
if (g < 0) throw new RangeError('The value "' + g + '" is invalid for option "size"'); | |
} | |
function c(g, u, f) { | |
return l(g), g <= 0 ? s(g) : u !== void 0 ? typeof f == "string" ? s(g).fill(u, f) : s(g).fill(u) : s(g); | |
} | |
o.alloc = function (g, u, f) { | |
return c(g, u, f); | |
}; | |
function d(g) { | |
return l(g), s(g < 0 ? 0 : b(g) | 0); | |
} | |
o.allocUnsafe = function (g) { | |
return d(g); | |
}, o.allocUnsafeSlow = function (g) { | |
return d(g); | |
}; | |
function h(g, u) { | |
if ((typeof u != "string" || u === "") && (u = "utf8"), !o.isEncoding(u)) throw new TypeError("Unknown encoding: " + u); | |
var f = _(g, u) | 0, | |
S = s(f), | |
k = S.write(g, u); | |
return k !== f && (S = S.slice(0, k)), S; | |
} | |
function m(g) { | |
var u = g.length < 0 ? 0 : b(g.length) | 0, | |
f = s(u); | |
for (var S = 0; S < u; S += 1) f[S] = g[S] & 255; | |
return f; | |
} | |
function w(g) { | |
if (Pt(g, Uint8Array)) { | |
var u = new Uint8Array(g); | |
return T(u.buffer, u.byteOffset, u.byteLength); | |
} | |
return m(g); | |
} | |
function T(g, u, f) { | |
if (u < 0 || g.byteLength < u) throw new RangeError('"offset" is outside of buffer bounds'); | |
if (g.byteLength < u + (f || 0)) throw new RangeError('"length" is outside of buffer bounds'); | |
var S; | |
return u === void 0 && f === void 0 ? S = new Uint8Array(g) : f === void 0 ? S = new Uint8Array(g, u) : S = new Uint8Array(g, u, f), Object.setPrototypeOf(S, o.prototype), S; | |
} | |
function v(g) { | |
if (o.isBuffer(g)) { | |
var u = b(g.length) | 0, | |
f = s(u); | |
return f.length === 0 || g.copy(f, 0, 0, u), f; | |
} | |
if (g.length !== void 0) return typeof g.length != "number" || Ii(g.length) ? s(0) : m(g); | |
if (g.type === "Buffer" && Array.isArray(g.data)) return m(g.data); | |
} | |
function b(g) { | |
if (g >= n) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + n.toString(16) + " bytes"); | |
return g | 0; | |
} | |
function p(g) { | |
return +g != g && (g = 0), o.alloc(+g); | |
} | |
o.isBuffer = function (u) { | |
return u != null && u._isBuffer === !0 && u !== o.prototype; | |
}, o.compare = function (u, f) { | |
if (Pt(u, Uint8Array) && (u = o.from(u, u.offset, u.byteLength)), Pt(f, Uint8Array) && (f = o.from(f, f.offset, f.byteLength)), !o.isBuffer(u) || !o.isBuffer(f)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); | |
if (u === f) return 0; | |
var S = u.length, | |
k = f.length; | |
for (var N = 0, U = Math.min(S, k); N < U; ++N) if (u[N] !== f[N]) { | |
S = u[N], k = f[N]; | |
break; | |
} | |
return S < k ? -1 : k < S ? 1 : 0; | |
}, o.isEncoding = function (u) { | |
switch (String(u).toLowerCase()) { | |
case "hex": | |
case "utf8": | |
case "utf-8": | |
case "ascii": | |
case "latin1": | |
case "binary": | |
case "base64": | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return !0; | |
default: | |
return !1; | |
} | |
}, o.concat = function (u, f) { | |
if (!Array.isArray(u)) throw new TypeError('"list" argument must be an Array of Buffers'); | |
if (u.length === 0) return o.alloc(0); | |
var S; | |
if (f === void 0) for (f = 0, S = 0; S < u.length; ++S) f += u[S].length; | |
var k = o.allocUnsafe(f), | |
N = 0; | |
for (S = 0; S < u.length; ++S) { | |
var U = u[S]; | |
if (Pt(U, Uint8Array)) N + U.length > k.length ? (o.isBuffer(U) || (U = o.from(U)), U.copy(k, N)) : Uint8Array.prototype.set.call(k, U, N);else if (o.isBuffer(U)) U.copy(k, N);else throw new TypeError('"list" argument must be an Array of Buffers'); | |
N += U.length; | |
} | |
return k; | |
}; | |
function _(g, u) { | |
if (o.isBuffer(g)) return g.length; | |
if (ArrayBuffer.isView(g) || Pt(g, ArrayBuffer)) return g.byteLength; | |
if (typeof g != "string") throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + _typeof(g)); | |
var f = g.length, | |
S = arguments.length > 2 && arguments[2] === !0; | |
if (!S && f === 0) return 0; | |
var k = !1; | |
for (;;) switch (u) { | |
case "ascii": | |
case "latin1": | |
case "binary": | |
return f; | |
case "utf8": | |
case "utf-8": | |
return gr(g).length; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return f * 2; | |
case "hex": | |
return f >>> 1; | |
case "base64": | |
return ho(g).length; | |
default: | |
if (k) return S ? -1 : gr(g).length; | |
u = ("" + u).toLowerCase(), k = !0; | |
} | |
} | |
o.byteLength = _; | |
function x(g, u, f) { | |
var S = !1; | |
if ((u === void 0 || u < 0) && (u = 0), u > this.length || ((f === void 0 || f > this.length) && (f = this.length), f <= 0) || (f >>>= 0, u >>>= 0, f <= u)) return ""; | |
for (g || (g = "utf8");;) switch (g) { | |
case "hex": | |
return z(this, u, f); | |
case "utf8": | |
case "utf-8": | |
return V(this, u, f); | |
case "ascii": | |
return ue(this, u, f); | |
case "latin1": | |
case "binary": | |
return ee(this, u, f); | |
case "base64": | |
return j(this, u, f); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return le(this, u, f); | |
default: | |
if (S) throw new TypeError("Unknown encoding: " + g); | |
g = (g + "").toLowerCase(), S = !0; | |
} | |
} | |
o.prototype._isBuffer = !0; | |
function I(g, u, f) { | |
var S = g[u]; | |
g[u] = g[f], g[f] = S; | |
} | |
o.prototype.swap16 = function () { | |
var u = this.length; | |
if (u % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); | |
for (var f = 0; f < u; f += 2) I(this, f, f + 1); | |
return this; | |
}, o.prototype.swap32 = function () { | |
var u = this.length; | |
if (u % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); | |
for (var f = 0; f < u; f += 4) I(this, f, f + 3), I(this, f + 1, f + 2); | |
return this; | |
}, o.prototype.swap64 = function () { | |
var u = this.length; | |
if (u % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); | |
for (var f = 0; f < u; f += 8) I(this, f, f + 7), I(this, f + 1, f + 6), I(this, f + 2, f + 5), I(this, f + 3, f + 4); | |
return this; | |
}, o.prototype.toString = function () { | |
var u = this.length; | |
return u === 0 ? "" : arguments.length === 0 ? V(this, 0, u) : x.apply(this, arguments); | |
}, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function (u) { | |
if (!o.isBuffer(u)) throw new TypeError("Argument must be a Buffer"); | |
return this === u ? !0 : o.compare(this, u) === 0; | |
}, o.prototype.inspect = function () { | |
var u = "", | |
f = an.INSPECT_MAX_BYTES; | |
return u = this.toString("hex", 0, f).replace(/(.{2})/g, "$1 ").trim(), this.length > f && (u += " ... "), "<Buffer " + u + ">"; | |
}, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function (u, f, S, k, N) { | |
if (Pt(u, Uint8Array) && (u = o.from(u, u.offset, u.byteLength)), !o.isBuffer(u)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + _typeof(u)); | |
if (f === void 0 && (f = 0), S === void 0 && (S = u ? u.length : 0), k === void 0 && (k = 0), N === void 0 && (N = this.length), f < 0 || S > u.length || k < 0 || N > this.length) throw new RangeError("out of range index"); | |
if (k >= N && f >= S) return 0; | |
if (k >= N) return -1; | |
if (f >= S) return 1; | |
if (f >>>= 0, S >>>= 0, k >>>= 0, N >>>= 0, this === u) return 0; | |
var U = N - k, | |
C = S - f, | |
M = Math.min(U, C), | |
te = this.slice(k, N), | |
oe = u.slice(f, S); | |
for (var se = 0; se < M; ++se) if (te[se] !== oe[se]) { | |
U = te[se], C = oe[se]; | |
break; | |
} | |
return U < C ? -1 : C < U ? 1 : 0; | |
}; | |
function y(g, u, f, S, k) { | |
if (g.length === 0) return -1; | |
if (typeof f == "string" ? (S = f, f = 0) : f > 2147483647 ? f = 2147483647 : f < -2147483648 && (f = -2147483648), f = +f, Ii(f) && (f = k ? 0 : g.length - 1), f < 0 && (f = g.length + f), f >= g.length) { | |
if (k) return -1; | |
f = g.length - 1; | |
} else if (f < 0) if (k) f = 0;else return -1; | |
if (typeof u == "string" && (u = o.from(u, S)), o.isBuffer(u)) return u.length === 0 ? -1 : B(g, u, f, S, k); | |
if (typeof u == "number") return u = u & 255, typeof Uint8Array.prototype.indexOf == "function" ? k ? Uint8Array.prototype.indexOf.call(g, u, f) : Uint8Array.prototype.lastIndexOf.call(g, u, f) : B(g, [u], f, S, k); | |
throw new TypeError("val must be string, number or Buffer"); | |
} | |
function B(g, u, f, S, k) { | |
var N = 1, | |
U = g.length, | |
C = u.length; | |
if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) { | |
if (g.length < 2 || u.length < 2) return -1; | |
N = 2, U /= 2, C /= 2, f /= 2; | |
} | |
function M(oe, se) { | |
return N === 1 ? oe[se] : oe.readUInt16BE(se * N); | |
} | |
var te; | |
if (k) { | |
var oe = -1; | |
for (te = f; te < U; te++) if (M(g, te) === M(u, oe === -1 ? 0 : te - oe)) { | |
if (oe === -1 && (oe = te), te - oe + 1 === C) return oe * N; | |
} else oe !== -1 && (te -= te - oe), oe = -1; | |
} else for (f + C > U && (f = U - C), te = f; te >= 0; te--) { | |
var _oe = !0; | |
for (var se = 0; se < C; se++) if (M(g, te + se) !== M(u, se)) { | |
_oe = !1; | |
break; | |
} | |
if (_oe) return te; | |
} | |
return -1; | |
} | |
o.prototype.includes = function (u, f, S) { | |
return this.indexOf(u, f, S) !== -1; | |
}, o.prototype.indexOf = function (u, f, S) { | |
return y(this, u, f, S, !0); | |
}, o.prototype.lastIndexOf = function (u, f, S) { | |
return y(this, u, f, S, !1); | |
}; | |
function A(g, u, f, S) { | |
f = Number(f) || 0; | |
var k = g.length - f; | |
S ? (S = Number(S), S > k && (S = k)) : S = k; | |
var N = u.length; | |
S > N / 2 && (S = N / 2); | |
var U; | |
for (U = 0; U < S; ++U) { | |
var C = parseInt(u.substr(U * 2, 2), 16); | |
if (Ii(C)) return U; | |
g[f + U] = C; | |
} | |
return U; | |
} | |
function q(g, u, f, S) { | |
return Dn(gr(u, g.length - f), g, f, S); | |
} | |
function $(g, u, f, S) { | |
return Dn(wr(u), g, f, S); | |
} | |
function F(g, u, f, S) { | |
return Dn(ho(u), g, f, S); | |
} | |
function Z(g, u, f, S) { | |
return Dn(Ai(u, g.length - f), g, f, S); | |
} | |
o.prototype.write = function (u, f, S, k) { | |
if (f === void 0) k = "utf8", S = this.length, f = 0;else if (S === void 0 && typeof f == "string") k = f, S = this.length, f = 0;else if (isFinite(f)) f = f >>> 0, isFinite(S) ? (S = S >>> 0, k === void 0 && (k = "utf8")) : (k = S, S = void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); | |
var N = this.length - f; | |
if ((S === void 0 || S > N) && (S = N), u.length > 0 && (S < 0 || f < 0) || f > this.length) throw new RangeError("Attempt to write outside buffer bounds"); | |
k || (k = "utf8"); | |
var U = !1; | |
for (;;) switch (k) { | |
case "hex": | |
return A(this, u, f, S); | |
case "utf8": | |
case "utf-8": | |
return q(this, u, f, S); | |
case "ascii": | |
case "latin1": | |
case "binary": | |
return $(this, u, f, S); | |
case "base64": | |
return F(this, u, f, S); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return Z(this, u, f, S); | |
default: | |
if (U) throw new TypeError("Unknown encoding: " + k); | |
k = ("" + k).toLowerCase(), U = !0; | |
} | |
}, o.prototype.toJSON = function () { | |
return { | |
type: "Buffer", | |
data: Array.prototype.slice.call(this._arr || this, 0) | |
}; | |
}; | |
function j(g, u, f) { | |
return u === 0 && f === g.length ? t.fromByteArray(g) : t.fromByteArray(g.slice(u, f)); | |
} | |
function V(g, u, f) { | |
f = Math.min(g.length, f); | |
var S = [], | |
k = u; | |
for (; k < f;) { | |
var N = g[k], | |
U = null, | |
C = N > 239 ? 4 : N > 223 ? 3 : N > 191 ? 2 : 1; | |
if (k + C <= f) { | |
var M = void 0, | |
te = void 0, | |
oe = void 0, | |
se = void 0; | |
switch (C) { | |
case 1: | |
N < 128 && (U = N); | |
break; | |
case 2: | |
M = g[k + 1], (M & 192) === 128 && (se = (N & 31) << 6 | M & 63, se > 127 && (U = se)); | |
break; | |
case 3: | |
M = g[k + 1], te = g[k + 2], (M & 192) === 128 && (te & 192) === 128 && (se = (N & 15) << 12 | (M & 63) << 6 | te & 63, se > 2047 && (se < 55296 || se > 57343) && (U = se)); | |
break; | |
case 4: | |
M = g[k + 1], te = g[k + 2], oe = g[k + 3], (M & 192) === 128 && (te & 192) === 128 && (oe & 192) === 128 && (se = (N & 15) << 18 | (M & 63) << 12 | (te & 63) << 6 | oe & 63, se > 65535 && se < 1114112 && (U = se)); | |
} | |
} | |
U === null ? (U = 65533, C = 1) : U > 65535 && (U -= 65536, S.push(U >>> 10 & 1023 | 55296), U = 56320 | U & 1023), S.push(U), k += C; | |
} | |
return ne(S); | |
} | |
var G = 4096; | |
function ne(g) { | |
var u = g.length; | |
if (u <= G) return String.fromCharCode.apply(String, g); | |
var f = "", | |
S = 0; | |
for (; S < u;) f += String.fromCharCode.apply(String, g.slice(S, S += G)); | |
return f; | |
} | |
function ue(g, u, f) { | |
var S = ""; | |
f = Math.min(g.length, f); | |
for (var k = u; k < f; ++k) S += String.fromCharCode(g[k] & 127); | |
return S; | |
} | |
function ee(g, u, f) { | |
var S = ""; | |
f = Math.min(g.length, f); | |
for (var k = u; k < f; ++k) S += String.fromCharCode(g[k]); | |
return S; | |
} | |
function z(g, u, f) { | |
var S = g.length; | |
(!u || u < 0) && (u = 0), (!f || f < 0 || f > S) && (f = S); | |
var k = ""; | |
for (var N = u; N < f; ++N) k += Ks[g[N]]; | |
return k; | |
} | |
function le(g, u, f) { | |
var S = g.slice(u, f), | |
k = ""; | |
for (var N = 0; N < S.length - 1; N += 2) k += String.fromCharCode(S[N] + S[N + 1] * 256); | |
return k; | |
} | |
o.prototype.slice = function (u, f) { | |
var S = this.length; | |
u = ~~u, f = f === void 0 ? S : ~~f, u < 0 ? (u += S, u < 0 && (u = 0)) : u > S && (u = S), f < 0 ? (f += S, f < 0 && (f = 0)) : f > S && (f = S), f < u && (f = u); | |
var k = this.subarray(u, f); | |
return Object.setPrototypeOf(k, o.prototype), k; | |
}; | |
function Q(g, u, f) { | |
if (g % 1 !== 0 || g < 0) throw new RangeError("offset is not uint"); | |
if (g + u > f) throw new RangeError("Trying to access beyond buffer length"); | |
} | |
o.prototype.readUintLE = o.prototype.readUIntLE = function (u, f, S) { | |
u = u >>> 0, f = f >>> 0, S || Q(u, f, this.length); | |
var k = this[u], | |
N = 1, | |
U = 0; | |
for (; ++U < f && (N *= 256);) k += this[u + U] * N; | |
return k; | |
}, o.prototype.readUintBE = o.prototype.readUIntBE = function (u, f, S) { | |
u = u >>> 0, f = f >>> 0, S || Q(u, f, this.length); | |
var k = this[u + --f], | |
N = 1; | |
for (; f > 0 && (N *= 256);) k += this[u + --f] * N; | |
return k; | |
}, o.prototype.readUint8 = o.prototype.readUInt8 = function (u, f) { | |
return u = u >>> 0, f || Q(u, 1, this.length), this[u]; | |
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 2, this.length), this[u] | this[u + 1] << 8; | |
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 2, this.length), this[u] << 8 | this[u + 1]; | |
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), (this[u] | this[u + 1] << 8 | this[u + 2] << 16) + this[u + 3] * 16777216; | |
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), this[u] * 16777216 + (this[u + 1] << 16 | this[u + 2] << 8 | this[u + 3]); | |
}, o.prototype.readBigUInt64LE = qt(function (u) { | |
u = u >>> 0, qe(u, "offset"); | |
var f = this[u], | |
S = this[u + 7]; | |
(f === void 0 || S === void 0) && Lt(u, this.length - 8); | |
var k = f + this[++u] * Ae(2, 8) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 24), | |
N = this[++u] + this[++u] * Ae(2, 8) + this[++u] * Ae(2, 16) + S * Ae(2, 24); | |
return BigInt(k) + (BigInt(N) << BigInt(32)); | |
}), o.prototype.readBigUInt64BE = qt(function (u) { | |
u = u >>> 0, qe(u, "offset"); | |
var f = this[u], | |
S = this[u + 7]; | |
(f === void 0 || S === void 0) && Lt(u, this.length - 8); | |
var k = f * Ae(2, 24) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 8) + this[++u], | |
N = this[++u] * Ae(2, 24) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 8) + S; | |
return (BigInt(k) << BigInt(32)) + BigInt(N); | |
}), o.prototype.readIntLE = function (u, f, S) { | |
u = u >>> 0, f = f >>> 0, S || Q(u, f, this.length); | |
var k = this[u], | |
N = 1, | |
U = 0; | |
for (; ++U < f && (N *= 256);) k += this[u + U] * N; | |
return N *= 128, k >= N && (k -= Math.pow(2, 8 * f)), k; | |
}, o.prototype.readIntBE = function (u, f, S) { | |
u = u >>> 0, f = f >>> 0, S || Q(u, f, this.length); | |
var k = f, | |
N = 1, | |
U = this[u + --k]; | |
for (; k > 0 && (N *= 256);) U += this[u + --k] * N; | |
return N *= 128, U >= N && (U -= Math.pow(2, 8 * f)), U; | |
}, o.prototype.readInt8 = function (u, f) { | |
return u = u >>> 0, f || Q(u, 1, this.length), this[u] & 128 ? (255 - this[u] + 1) * -1 : this[u]; | |
}, o.prototype.readInt16LE = function (u, f) { | |
u = u >>> 0, f || Q(u, 2, this.length); | |
var S = this[u] | this[u + 1] << 8; | |
return S & 32768 ? S | 4294901760 : S; | |
}, o.prototype.readInt16BE = function (u, f) { | |
u = u >>> 0, f || Q(u, 2, this.length); | |
var S = this[u + 1] | this[u] << 8; | |
return S & 32768 ? S | 4294901760 : S; | |
}, o.prototype.readInt32LE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), this[u] | this[u + 1] << 8 | this[u + 2] << 16 | this[u + 3] << 24; | |
}, o.prototype.readInt32BE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), this[u] << 24 | this[u + 1] << 16 | this[u + 2] << 8 | this[u + 3]; | |
}, o.prototype.readBigInt64LE = qt(function (u) { | |
u = u >>> 0, qe(u, "offset"); | |
var f = this[u], | |
S = this[u + 7]; | |
(f === void 0 || S === void 0) && Lt(u, this.length - 8); | |
var k = this[u + 4] + this[u + 5] * Ae(2, 8) + this[u + 6] * Ae(2, 16) + (S << 24); | |
return (BigInt(k) << BigInt(32)) + BigInt(f + this[++u] * Ae(2, 8) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 24)); | |
}), o.prototype.readBigInt64BE = qt(function (u) { | |
u = u >>> 0, qe(u, "offset"); | |
var f = this[u], | |
S = this[u + 7]; | |
(f === void 0 || S === void 0) && Lt(u, this.length - 8); | |
var k = (f << 24) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 8) + this[++u]; | |
return (BigInt(k) << BigInt(32)) + BigInt(this[++u] * Ae(2, 24) + this[++u] * Ae(2, 16) + this[++u] * Ae(2, 8) + S); | |
}), o.prototype.readFloatLE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), e.read(this, u, !0, 23, 4); | |
}, o.prototype.readFloatBE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 4, this.length), e.read(this, u, !1, 23, 4); | |
}, o.prototype.readDoubleLE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 8, this.length), e.read(this, u, !0, 52, 8); | |
}, o.prototype.readDoubleBE = function (u, f) { | |
return u = u >>> 0, f || Q(u, 8, this.length), e.read(this, u, !1, 52, 8); | |
}; | |
function X(g, u, f, S, k, N) { | |
if (!o.isBuffer(g)) throw new TypeError('"buffer" argument must be a Buffer instance'); | |
if (u > k || u < N) throw new RangeError('"value" argument is out of bounds'); | |
if (f + S > g.length) throw new RangeError("Index out of range"); | |
} | |
o.prototype.writeUintLE = o.prototype.writeUIntLE = function (u, f, S, k) { | |
if (u = +u, f = f >>> 0, S = S >>> 0, !k) { | |
var C = Math.pow(2, 8 * S) - 1; | |
X(this, u, f, S, C, 0); | |
} | |
var N = 1, | |
U = 0; | |
for (this[f] = u & 255; ++U < S && (N *= 256);) this[f + U] = u / N & 255; | |
return f + S; | |
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function (u, f, S, k) { | |
if (u = +u, f = f >>> 0, S = S >>> 0, !k) { | |
var C = Math.pow(2, 8 * S) - 1; | |
X(this, u, f, S, C, 0); | |
} | |
var N = S - 1, | |
U = 1; | |
for (this[f + N] = u & 255; --N >= 0 && (U *= 256);) this[f + N] = u / U & 255; | |
return f + S; | |
}, o.prototype.writeUint8 = o.prototype.writeUInt8 = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 1, 255, 0), this[f] = u & 255, f + 1; | |
}, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 2, 65535, 0), this[f] = u & 255, this[f + 1] = u >>> 8, f + 2; | |
}, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 2, 65535, 0), this[f] = u >>> 8, this[f + 1] = u & 255, f + 2; | |
}, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 4, 4294967295, 0), this[f + 3] = u >>> 24, this[f + 2] = u >>> 16, this[f + 1] = u >>> 8, this[f] = u & 255, f + 4; | |
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 4, 4294967295, 0), this[f] = u >>> 24, this[f + 1] = u >>> 16, this[f + 2] = u >>> 8, this[f + 3] = u & 255, f + 4; | |
}; | |
function _e(g, u, f, S, k) { | |
$e(u, S, k, g, f, 7); | |
var N = Number(u & BigInt(4294967295)); | |
g[f++] = N, N = N >> 8, g[f++] = N, N = N >> 8, g[f++] = N, N = N >> 8, g[f++] = N; | |
var U = Number(u >> BigInt(32) & BigInt(4294967295)); | |
return g[f++] = U, U = U >> 8, g[f++] = U, U = U >> 8, g[f++] = U, U = U >> 8, g[f++] = U, f; | |
} | |
function Y(g, u, f, S, k) { | |
$e(u, S, k, g, f, 7); | |
var N = Number(u & BigInt(4294967295)); | |
g[f + 7] = N, N = N >> 8, g[f + 6] = N, N = N >> 8, g[f + 5] = N, N = N >> 8, g[f + 4] = N; | |
var U = Number(u >> BigInt(32) & BigInt(4294967295)); | |
return g[f + 3] = U, U = U >> 8, g[f + 2] = U, U = U >> 8, g[f + 1] = U, U = U >> 8, g[f] = U, f + 8; | |
} | |
o.prototype.writeBigUInt64LE = qt(function (u) { | |
var f = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | |
return _e(this, u, f, BigInt(0), BigInt("0xffffffffffffffff")); | |
}), o.prototype.writeBigUInt64BE = qt(function (u) { | |
var f = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | |
return Y(this, u, f, BigInt(0), BigInt("0xffffffffffffffff")); | |
}), o.prototype.writeIntLE = function (u, f, S, k) { | |
if (u = +u, f = f >>> 0, !k) { | |
var M = Math.pow(2, 8 * S - 1); | |
X(this, u, f, S, M - 1, -M); | |
} | |
var N = 0, | |
U = 1, | |
C = 0; | |
for (this[f] = u & 255; ++N < S && (U *= 256);) u < 0 && C === 0 && this[f + N - 1] !== 0 && (C = 1), this[f + N] = (u / U >> 0) - C & 255; | |
return f + S; | |
}, o.prototype.writeIntBE = function (u, f, S, k) { | |
if (u = +u, f = f >>> 0, !k) { | |
var M = Math.pow(2, 8 * S - 1); | |
X(this, u, f, S, M - 1, -M); | |
} | |
var N = S - 1, | |
U = 1, | |
C = 0; | |
for (this[f + N] = u & 255; --N >= 0 && (U *= 256);) u < 0 && C === 0 && this[f + N + 1] !== 0 && (C = 1), this[f + N] = (u / U >> 0) - C & 255; | |
return f + S; | |
}, o.prototype.writeInt8 = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 1, 127, -128), u < 0 && (u = 255 + u + 1), this[f] = u & 255, f + 1; | |
}, o.prototype.writeInt16LE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 2, 32767, -32768), this[f] = u & 255, this[f + 1] = u >>> 8, f + 2; | |
}, o.prototype.writeInt16BE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 2, 32767, -32768), this[f] = u >>> 8, this[f + 1] = u & 255, f + 2; | |
}, o.prototype.writeInt32LE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 4, 2147483647, -2147483648), this[f] = u & 255, this[f + 1] = u >>> 8, this[f + 2] = u >>> 16, this[f + 3] = u >>> 24, f + 4; | |
}, o.prototype.writeInt32BE = function (u, f, S) { | |
return u = +u, f = f >>> 0, S || X(this, u, f, 4, 2147483647, -2147483648), u < 0 && (u = 4294967295 + u + 1), this[f] = u >>> 24, this[f + 1] = u >>> 16, this[f + 2] = u >>> 8, this[f + 3] = u & 255, f + 4; | |
}, o.prototype.writeBigInt64LE = qt(function (u) { | |
var f = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | |
return _e(this, u, f, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); | |
}), o.prototype.writeBigInt64BE = qt(function (u) { | |
var f = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | |
return Y(this, u, f, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); | |
}); | |
function re(g, u, f, S, k, N) { | |
if (f + S > g.length) throw new RangeError("Index out of range"); | |
if (f < 0) throw new RangeError("Index out of range"); | |
} | |
function ge(g, u, f, S, k) { | |
return u = +u, f = f >>> 0, k || re(g, u, f, 4), e.write(g, u, f, S, 23, 4), f + 4; | |
} | |
o.prototype.writeFloatLE = function (u, f, S) { | |
return ge(this, u, f, !0, S); | |
}, o.prototype.writeFloatBE = function (u, f, S) { | |
return ge(this, u, f, !1, S); | |
}; | |
function ve(g, u, f, S, k) { | |
return u = +u, f = f >>> 0, k || re(g, u, f, 8), e.write(g, u, f, S, 52, 8), f + 8; | |
} | |
o.prototype.writeDoubleLE = function (u, f, S) { | |
return ve(this, u, f, !0, S); | |
}, o.prototype.writeDoubleBE = function (u, f, S) { | |
return ve(this, u, f, !1, S); | |
}, o.prototype.copy = function (u, f, S, k) { | |
if (!o.isBuffer(u)) throw new TypeError("argument should be a Buffer"); | |
if (S || (S = 0), !k && k !== 0 && (k = this.length), f >= u.length && (f = u.length), f || (f = 0), k > 0 && k < S && (k = S), k === S || u.length === 0 || this.length === 0) return 0; | |
if (f < 0) throw new RangeError("targetStart out of bounds"); | |
if (S < 0 || S >= this.length) throw new RangeError("Index out of range"); | |
if (k < 0) throw new RangeError("sourceEnd out of bounds"); | |
k > this.length && (k = this.length), u.length - f < k - S && (k = u.length - f + S); | |
var N = k - S; | |
return this === u && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(f, S, k) : Uint8Array.prototype.set.call(u, this.subarray(S, k), f), N; | |
}, o.prototype.fill = function (u, f, S, k) { | |
if (typeof u == "string") { | |
if (typeof f == "string" ? (k = f, f = 0, S = this.length) : typeof S == "string" && (k = S, S = this.length), k !== void 0 && typeof k != "string") throw new TypeError("encoding must be a string"); | |
if (typeof k == "string" && !o.isEncoding(k)) throw new TypeError("Unknown encoding: " + k); | |
if (u.length === 1) { | |
var U = u.charCodeAt(0); | |
(k === "utf8" && U < 128 || k === "latin1") && (u = U); | |
} | |
} else typeof u == "number" ? u = u & 255 : typeof u == "boolean" && (u = Number(u)); | |
if (f < 0 || this.length < f || this.length < S) throw new RangeError("Out of range index"); | |
if (S <= f) return this; | |
f = f >>> 0, S = S === void 0 ? this.length : S >>> 0, u || (u = 0); | |
var N; | |
if (typeof u == "number") for (N = f; N < S; ++N) this[N] = u;else { | |
var _U = o.isBuffer(u) ? u : o.from(u, k), | |
C = _U.length; | |
if (C === 0) throw new TypeError('The value "' + u + '" is invalid for argument "value"'); | |
for (N = 0; N < S - f; ++N) this[N + f] = _U[N % C]; | |
} | |
return this; | |
}; | |
var me = {}; | |
function Me(g, u, f) { | |
me[g] = /*#__PURE__*/function (_f2) { | |
function _class() { | |
var _this; | |
_classCallCheck(this, _class); | |
_this = _callSuper(this, _class), Object.defineProperty(_assertThisInitialized(_this), "message", { | |
value: u.apply(_assertThisInitialized(_this), arguments), | |
writable: !0, | |
configurable: !0 | |
}), _this.name = "".concat(_this.name, " [").concat(g, "]"), _this.stack, delete _this.name; | |
return _this; | |
} | |
_inherits(_class, _f2); | |
return _createClass(_class, [{ | |
key: "code", | |
get: function get() { | |
return g; | |
}, | |
set: function set(k) { | |
Object.defineProperty(this, "code", { | |
configurable: !0, | |
enumerable: !0, | |
value: k, | |
writable: !0 | |
}); | |
} | |
}, { | |
key: "toString", | |
value: function toString() { | |
return "".concat(this.name, " [").concat(g, "]: ").concat(this.message); | |
} | |
}]); | |
}(f); | |
} | |
Me("ERR_BUFFER_OUT_OF_BOUNDS", function (g) { | |
return g ? "".concat(g, " is outside of buffer bounds") : "Attempt to access memory outside buffer bounds"; | |
}, RangeError), Me("ERR_INVALID_ARG_TYPE", function (g, u) { | |
return "The \"".concat(g, "\" argument must be of type number. Received type ").concat(_typeof(u)); | |
}, TypeError), Me("ERR_OUT_OF_RANGE", function (g, u, f) { | |
var S = "The value of \"".concat(g, "\" is out of range."), | |
k = f; | |
return Number.isInteger(f) && Math.abs(f) > Ae(2, 32) ? k = Te(String(f)) : typeof f == "bigint" && (k = String(f), (f > Ae(BigInt(2), BigInt(32)) || f < -Ae(BigInt(2), BigInt(32))) && (k = Te(k)), k += "n"), S += " It must be ".concat(u, ". Received ").concat(k), S; | |
}, RangeError); | |
function Te(g) { | |
var u = "", | |
f = g.length, | |
S = g[0] === "-" ? 1 : 0; | |
for (; f >= S + 4; f -= 3) u = "_".concat(g.slice(f - 3, f)).concat(u); | |
return "".concat(g.slice(0, f)).concat(u); | |
} | |
function Re(g, u, f) { | |
qe(u, "offset"), (g[u] === void 0 || g[u + f] === void 0) && Lt(u, g.length - (f + 1)); | |
} | |
function $e(g, u, f, S, k, N) { | |
if (g > f || g < u) { | |
var U = typeof u == "bigint" ? "n" : "", | |
C; | |
throw u === 0 || u === BigInt(0) ? C = ">= 0".concat(U, " and < 2").concat(U, " ** ").concat((N + 1) * 8).concat(U) : C = ">= -(2".concat(U, " ** ").concat((N + 1) * 8 - 1).concat(U, ") and < 2 ** ").concat((N + 1) * 8 - 1).concat(U), new me.ERR_OUT_OF_RANGE("value", C, g); | |
} | |
Re(S, k, N); | |
} | |
function qe(g, u) { | |
if (typeof g != "number") throw new me.ERR_INVALID_ARG_TYPE(u, "number", g); | |
} | |
function Lt(g, u, f) { | |
throw Math.floor(g) !== g ? (qe(g, f), new me.ERR_OUT_OF_RANGE("offset", "an integer", g)) : u < 0 ? new me.ERR_BUFFER_OUT_OF_BOUNDS() : new me.ERR_OUT_OF_RANGE("offset", ">= 0 and <= ".concat(u), g); | |
} | |
var Ve = /[^+/0-9A-Za-z-_]/g; | |
function Ye(g) { | |
if (g = g.split("=")[0], g = g.trim().replace(Ve, ""), g.length < 2) return ""; | |
for (; g.length % 4 !== 0;) g = g + "="; | |
return g; | |
} | |
function gr(g, u) { | |
u = u || 1 / 0; | |
var f, | |
S = g.length, | |
k = null, | |
N = []; | |
for (var U = 0; U < S; ++U) { | |
if (f = g.charCodeAt(U), f > 55295 && f < 57344) { | |
if (!k) { | |
if (f > 56319) { | |
(u -= 3) > -1 && N.push(239, 191, 189); | |
continue; | |
} else if (U + 1 === S) { | |
(u -= 3) > -1 && N.push(239, 191, 189); | |
continue; | |
} | |
k = f; | |
continue; | |
} | |
if (f < 56320) { | |
(u -= 3) > -1 && N.push(239, 191, 189), k = f; | |
continue; | |
} | |
f = (k - 55296 << 10 | f - 56320) + 65536; | |
} else k && (u -= 3) > -1 && N.push(239, 191, 189); | |
if (k = null, f < 128) { | |
if ((u -= 1) < 0) break; | |
N.push(f); | |
} else if (f < 2048) { | |
if ((u -= 2) < 0) break; | |
N.push(f >> 6 | 192, f & 63 | 128); | |
} else if (f < 65536) { | |
if ((u -= 3) < 0) break; | |
N.push(f >> 12 | 224, f >> 6 & 63 | 128, f & 63 | 128); | |
} else if (f < 1114112) { | |
if ((u -= 4) < 0) break; | |
N.push(f >> 18 | 240, f >> 12 & 63 | 128, f >> 6 & 63 | 128, f & 63 | 128); | |
} else throw new Error("Invalid code point"); | |
} | |
return N; | |
} | |
function wr(g) { | |
var u = []; | |
for (var f = 0; f < g.length; ++f) u.push(g.charCodeAt(f) & 255); | |
return u; | |
} | |
function Ai(g, u) { | |
var f, | |
S, | |
k, | |
N = []; | |
for (var U = 0; U < g.length && !((u -= 2) < 0); ++U) f = g.charCodeAt(U), S = f >> 8, k = f % 256, N.push(k), N.push(S); | |
return N; | |
} | |
function ho(g) { | |
return t.toByteArray(Ye(g)); | |
} | |
function Dn(g, u, f, S) { | |
var k; | |
for (k = 0; k < S && !(k + f >= u.length || k >= g.length); ++k) u[k + f] = g[k]; | |
return k; | |
} | |
function Pt(g, u) { | |
return g instanceof u || g != null && g.constructor != null && g.constructor.name != null && g.constructor.name === u.name; | |
} | |
function Ii(g) { | |
return g !== g; | |
} | |
var Ks = function () { | |
var g = "0123456789abcdef", | |
u = new Array(256); | |
for (var f = 0; f < 16; ++f) { | |
var S = f * 16; | |
for (var k = 0; k < 16; ++k) u[S + k] = g[f] + g[k]; | |
} | |
return u; | |
}(); | |
function qt(g) { | |
return typeof BigInt == "undefined" ? Gs : g; | |
} | |
function Gs() { | |
throw new Error("BigInt not supported"); | |
} | |
return an; | |
} | |
var Pi, | |
rh, | |
So, | |
nh, | |
an, | |
ih, | |
Ao = rt(function () { | |
P(); | |
O(); | |
R(); | |
Pi = {}, rh = !1; | |
So = {}, nh = !1; | |
an = {}, ih = !1; | |
}); | |
var Je = {}; | |
on(Je, { | |
Buffer: function Buffer() { | |
return W; | |
}, | |
INSPECT_MAX_BYTES: function INSPECT_MAX_BYTES() { | |
return gb; | |
}, | |
"default": function _default() { | |
return Nr; | |
}, | |
kMaxLength: function kMaxLength() { | |
return wb; | |
} | |
}); | |
var Nr, | |
W, | |
gb, | |
wb, | |
ze = rt(function () { | |
P(); | |
O(); | |
R(); | |
Ao(); | |
Nr = Eo(); | |
Nr.Buffer; | |
Nr.SlowBuffer; | |
Nr.INSPECT_MAX_BYTES; | |
Nr.kMaxLength; | |
W = Nr.Buffer, gb = Nr.INSPECT_MAX_BYTES, wb = Nr.kMaxLength; | |
}); | |
var O = rt(function () { | |
ze(); | |
}); | |
var oh = H(function (ua) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(ua, "__esModule", { | |
value: !0 | |
}); | |
var bb = function () { | |
function t(e) { | |
this.aliasToTopic = {}, this.max = e; | |
} | |
return t.prototype.put = function (e, r) { | |
return r === 0 || r > this.max ? !1 : (this.aliasToTopic[r] = e, this.length = Object.keys(this.aliasToTopic).length, !0); | |
}, t.prototype.getTopicByAlias = function (e) { | |
return this.aliasToTopic[e]; | |
}, t.prototype.clear = function () { | |
this.aliasToTopic = {}; | |
}, t; | |
}(); | |
ua["default"] = bb; | |
}); | |
var Ne = H(function (ER, sh) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
sh.exports = { | |
ArrayIsArray: function ArrayIsArray(t) { | |
return Array.isArray(t); | |
}, | |
ArrayPrototypeIncludes: function ArrayPrototypeIncludes(t, e) { | |
return t.includes(e); | |
}, | |
ArrayPrototypeIndexOf: function ArrayPrototypeIndexOf(t, e) { | |
return t.indexOf(e); | |
}, | |
ArrayPrototypeJoin: function ArrayPrototypeJoin(t, e) { | |
return t.join(e); | |
}, | |
ArrayPrototypeMap: function ArrayPrototypeMap(t, e) { | |
return t.map(e); | |
}, | |
ArrayPrototypePop: function ArrayPrototypePop(t, e) { | |
return t.pop(e); | |
}, | |
ArrayPrototypePush: function ArrayPrototypePush(t, e) { | |
return t.push(e); | |
}, | |
ArrayPrototypeSlice: function ArrayPrototypeSlice(t, e, r) { | |
return t.slice(e, r); | |
}, | |
Error: Error, | |
FunctionPrototypeCall: function FunctionPrototypeCall(t, e) { | |
for (var _len = arguments.length, r = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | |
r[_key - 2] = arguments[_key]; | |
} | |
return t.call.apply(t, [e].concat(r)); | |
}, | |
FunctionPrototypeSymbolHasInstance: function FunctionPrototypeSymbolHasInstance(t, e) { | |
return Function.prototype[Symbol.hasInstance].call(t, e); | |
}, | |
MathFloor: Math.floor, | |
Number: Number, | |
NumberIsInteger: Number.isInteger, | |
NumberIsNaN: Number.isNaN, | |
NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER, | |
NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER, | |
NumberParseInt: Number.parseInt, | |
ObjectDefineProperties: function ObjectDefineProperties(t, e) { | |
return Object.defineProperties(t, e); | |
}, | |
ObjectDefineProperty: function ObjectDefineProperty(t, e, r) { | |
return Object.defineProperty(t, e, r); | |
}, | |
ObjectGetOwnPropertyDescriptor: function ObjectGetOwnPropertyDescriptor(t, e) { | |
return Object.getOwnPropertyDescriptor(t, e); | |
}, | |
ObjectKeys: function ObjectKeys(t) { | |
return Object.keys(t); | |
}, | |
ObjectSetPrototypeOf: function ObjectSetPrototypeOf(t, e) { | |
return Object.setPrototypeOf(t, e); | |
}, | |
Promise: Promise, | |
PromisePrototypeCatch: function PromisePrototypeCatch(t, e) { | |
return t["catch"](e); | |
}, | |
PromisePrototypeThen: function PromisePrototypeThen(t, e, r) { | |
return t.then(e, r); | |
}, | |
PromiseReject: function PromiseReject(t) { | |
return Promise.reject(t); | |
}, | |
PromiseResolve: function PromiseResolve(t) { | |
return Promise.resolve(t); | |
}, | |
ReflectApply: Reflect.apply, | |
RegExpPrototypeTest: function RegExpPrototypeTest(t, e) { | |
return t.test(e); | |
}, | |
SafeSet: Set, | |
String: String, | |
StringPrototypeSlice: function StringPrototypeSlice(t, e, r) { | |
return t.slice(e, r); | |
}, | |
StringPrototypeToLowerCase: function StringPrototypeToLowerCase(t) { | |
return t.toLowerCase(); | |
}, | |
StringPrototypeToUpperCase: function StringPrototypeToUpperCase(t) { | |
return t.toUpperCase(); | |
}, | |
StringPrototypeTrim: function StringPrototypeTrim(t) { | |
return t.trim(); | |
}, | |
Symbol: Symbol, | |
SymbolFor: Symbol["for"], | |
SymbolAsyncIterator: Symbol.asyncIterator, | |
SymbolHasInstance: Symbol.hasInstance, | |
SymbolIterator: Symbol.iterator, | |
SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), | |
SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), | |
TypedArrayPrototypeSet: function TypedArrayPrototypeSet(t, e, r) { | |
return t.set(e, r); | |
}, | |
Boolean: Boolean, | |
Uint8Array: Uint8Array | |
}; | |
}); | |
var Hn = H(function (xR, Io) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _ref = typeof self != "undefined" ? self : typeof window != "undefined" ? window : void 0, | |
ah = _ref.AbortController, | |
_b = _ref.AbortSignal; | |
Io.exports = ah; | |
Io.exports.AbortSignal = _b; | |
Io.exports["default"] = ah; | |
}); | |
var Lr = {}; | |
on(Lr, { | |
EventEmitter: function EventEmitter() { | |
return vb; | |
}, | |
"default": function _default() { | |
return Ri; | |
}, | |
defaultMaxListeners: function defaultMaxListeners() { | |
return Sb; | |
}, | |
init: function init() { | |
return Eb; | |
}, | |
listenerCount: function listenerCount() { | |
return Ab; | |
}, | |
on: function on() { | |
return Ib; | |
}, | |
once: function once() { | |
return Tb; | |
} | |
}); | |
function mb() { | |
if (uh) return To; | |
uh = !0; | |
var t = (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) == "object" ? Reflect : null, | |
e = t && typeof t.apply == "function" ? t.apply : function (y, B, A) { | |
return Function.prototype.apply.call(y, B, A); | |
}, | |
r; | |
t && typeof t.ownKeys == "function" ? r = t.ownKeys : Object.getOwnPropertySymbols ? r = function r(y) { | |
return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y)); | |
} : r = function r(y) { | |
return Object.getOwnPropertyNames(y); | |
}; | |
function n(I) { | |
console && console.warn && console.warn(I); | |
} | |
var i = Number.isNaN || function (y) { | |
return y !== y; | |
}; | |
function s() { | |
s.init.call(this); | |
} | |
To = s, To.once = p, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0; | |
var o = 10; | |
function a(I) { | |
if (typeof I != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + _typeof(I)); | |
} | |
Object.defineProperty(s, "defaultMaxListeners", { | |
enumerable: !0, | |
get: function get() { | |
return o; | |
}, | |
set: function set(I) { | |
if (typeof I != "number" || I < 0 || i(I)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + I + "."); | |
o = I; | |
} | |
}), s.init = function () { | |
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; | |
}, s.prototype.setMaxListeners = function (y) { | |
if (typeof y != "number" || y < 0 || i(y)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + y + "."); | |
return this._maxListeners = y, this; | |
}; | |
function l(I) { | |
return I._maxListeners === void 0 ? s.defaultMaxListeners : I._maxListeners; | |
} | |
s.prototype.getMaxListeners = function () { | |
return l(this); | |
}, s.prototype.emit = function (y) { | |
for (var B = [], A = 1; A < arguments.length; A++) B.push(arguments[A]); | |
var q = y === "error", | |
$ = this._events; | |
if ($ !== void 0) q = q && $.error === void 0;else if (!q) return !1; | |
if (q) { | |
var F; | |
if (B.length > 0 && (F = B[0]), F instanceof Error) throw F; | |
var Z = new Error("Unhandled error." + (F ? " (" + F.message + ")" : "")); | |
throw Z.context = F, Z; | |
} | |
var j = $[y]; | |
if (j === void 0) return !1; | |
if (typeof j == "function") e(j, this, B);else for (var V = j.length, G = T(j, V), A = 0; A < V; ++A) e(G[A], this, B); | |
return !0; | |
}; | |
function c(I, y, B, A) { | |
var q, $, F; | |
if (a(B), $ = I._events, $ === void 0 ? ($ = I._events = Object.create(null), I._eventsCount = 0) : ($.newListener !== void 0 && (I.emit("newListener", y, B.listener ? B.listener : B), $ = I._events), F = $[y]), F === void 0) F = $[y] = B, ++I._eventsCount;else if (typeof F == "function" ? F = $[y] = A ? [B, F] : [F, B] : A ? F.unshift(B) : F.push(B), q = l(I), q > 0 && F.length > q && !F.warned) { | |
F.warned = !0; | |
var Z = new Error("Possible EventEmitter memory leak detected. " + F.length + " " + String(y) + " listeners added. Use emitter.setMaxListeners() to increase limit"); | |
Z.name = "MaxListenersExceededWarning", Z.emitter = I, Z.type = y, Z.count = F.length, n(Z); | |
} | |
return I; | |
} | |
s.prototype.addListener = function (y, B) { | |
return c(this, y, B, !1); | |
}, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function (y, B) { | |
return c(this, y, B, !0); | |
}; | |
function d() { | |
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); | |
} | |
function h(I, y, B) { | |
var A = { | |
fired: !1, | |
wrapFn: void 0, | |
target: I, | |
type: y, | |
listener: B | |
}, | |
q = d.bind(A); | |
return q.listener = B, A.wrapFn = q, q; | |
} | |
s.prototype.once = function (y, B) { | |
return a(B), this.on(y, h(this, y, B)), this; | |
}, s.prototype.prependOnceListener = function (y, B) { | |
return a(B), this.prependListener(y, h(this, y, B)), this; | |
}, s.prototype.removeListener = function (y, B) { | |
var A, q, $, F, Z; | |
if (a(B), q = this._events, q === void 0) return this; | |
if (A = q[y], A === void 0) return this; | |
if (A === B || A.listener === B) --this._eventsCount === 0 ? this._events = Object.create(null) : (delete q[y], q.removeListener && this.emit("removeListener", y, A.listener || B));else if (typeof A != "function") { | |
for ($ = -1, F = A.length - 1; F >= 0; F--) if (A[F] === B || A[F].listener === B) { | |
Z = A[F].listener, $ = F; | |
break; | |
} | |
if ($ < 0) return this; | |
$ === 0 ? A.shift() : v(A, $), A.length === 1 && (q[y] = A[0]), q.removeListener !== void 0 && this.emit("removeListener", y, Z || B); | |
} | |
return this; | |
}, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function (y) { | |
var B, A, q; | |
if (A = this._events, A === void 0) return this; | |
if (A.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : A[y] !== void 0 && (--this._eventsCount === 0 ? this._events = Object.create(null) : delete A[y]), this; | |
if (arguments.length === 0) { | |
var $ = Object.keys(A), | |
F; | |
for (q = 0; q < $.length; ++q) F = $[q], F !== "removeListener" && this.removeAllListeners(F); | |
return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this; | |
} | |
if (B = A[y], typeof B == "function") this.removeListener(y, B);else if (B !== void 0) for (q = B.length - 1; q >= 0; q--) this.removeListener(y, B[q]); | |
return this; | |
}; | |
function m(I, y, B) { | |
var A = I._events; | |
if (A === void 0) return []; | |
var q = A[y]; | |
return q === void 0 ? [] : typeof q == "function" ? B ? [q.listener || q] : [q] : B ? b(q) : T(q, q.length); | |
} | |
s.prototype.listeners = function (y) { | |
return m(this, y, !0); | |
}, s.prototype.rawListeners = function (y) { | |
return m(this, y, !1); | |
}, s.listenerCount = function (I, y) { | |
return typeof I.listenerCount == "function" ? I.listenerCount(y) : w.call(I, y); | |
}, s.prototype.listenerCount = w; | |
function w(I) { | |
var y = this._events; | |
if (y !== void 0) { | |
var B = y[I]; | |
if (typeof B == "function") return 1; | |
if (B !== void 0) return B.length; | |
} | |
return 0; | |
} | |
s.prototype.eventNames = function () { | |
return this._eventsCount > 0 ? r(this._events) : []; | |
}; | |
function T(I, y) { | |
for (var B = new Array(y), A = 0; A < y; ++A) B[A] = I[A]; | |
return B; | |
} | |
function v(I, y) { | |
for (; y + 1 < I.length; y++) I[y] = I[y + 1]; | |
I.pop(); | |
} | |
function b(I) { | |
for (var y = new Array(I.length), B = 0; B < y.length; ++B) y[B] = I[B].listener || I[B]; | |
return y; | |
} | |
function p(I, y) { | |
return new Promise(function (B, A) { | |
function q(F) { | |
I.removeListener(y, $), A(F); | |
} | |
function $() { | |
typeof I.removeListener == "function" && I.removeListener("error", q), B([].slice.call(arguments)); | |
} | |
x(I, y, $, { | |
once: !0 | |
}), y !== "error" && _(I, q, { | |
once: !0 | |
}); | |
}); | |
} | |
function _(I, y, B) { | |
typeof I.on == "function" && x(I, "error", y, B); | |
} | |
function x(I, y, B, A) { | |
if (typeof I.on == "function") A.once ? I.once(y, B) : I.on(y, B);else if (typeof I.addEventListener == "function") I.addEventListener(y, function q($) { | |
A.once && I.removeEventListener(y, q), B($); | |
});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + _typeof(I)); | |
} | |
return To; | |
} | |
var To, | |
uh, | |
Ri, | |
vb, | |
Sb, | |
Eb, | |
Ab, | |
Ib, | |
Tb, | |
qr = rt(function () { | |
P(); | |
O(); | |
R(); | |
To = {}, uh = !1; | |
Ri = mb(); | |
Ri.once; | |
Ri.once = function (t, e) { | |
return new Promise(function (r, n) { | |
function i() { | |
for (var _len2 = arguments.length, o = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
o[_key2] = arguments[_key2]; | |
} | |
s !== void 0 && t.removeListener("error", s), r(o); | |
} | |
var s; | |
e !== "error" && (s = function s(o) { | |
t.removeListener(name, i), n(o); | |
}, t.once("error", s)), t.once(e, i); | |
}); | |
}; | |
Ri.on = function (t, e) { | |
var r = [], | |
n = [], | |
i = null, | |
s = !1, | |
o = _defineProperty({ | |
next: function next() { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { | |
var d, h; | |
return _regeneratorRuntime().wrap(function _callee$(_context) { | |
while (1) switch (_context.prev = _context.next) { | |
case 0: | |
d = r.shift(); | |
if (!d) { | |
_context.next = 3; | |
break; | |
} | |
return _context.abrupt("return", createIterResult(d, !1)); | |
case 3: | |
if (!i) { | |
_context.next = 6; | |
break; | |
} | |
h = Promise.reject(i); | |
return _context.abrupt("return", (i = null, h)); | |
case 6: | |
return _context.abrupt("return", s ? createIterResult(void 0, !0) : new Promise(function (h, m) { | |
return n.push({ | |
resolve: h, | |
reject: m | |
}); | |
})); | |
case 7: | |
case "end": | |
return _context.stop(); | |
} | |
}, _callee); | |
})); | |
}, | |
"return": function _return() { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { | |
var _i2, _n3, d; | |
return _regeneratorRuntime().wrap(function _callee2$(_context2) { | |
while (1) switch (_context2.prev = _context2.next) { | |
case 0: | |
t.removeListener(e, a), t.removeListener("error", l), s = !0; | |
for (_i2 = 0, _n3 = n; _i2 < _n3.length; _i2++) { | |
d = _n3[_i2]; | |
d.resolve(createIterResult(void 0, !0)); | |
} | |
return _context2.abrupt("return", createIterResult(void 0, !0)); | |
case 3: | |
case "end": | |
return _context2.stop(); | |
} | |
}, _callee2); | |
})); | |
}, | |
"throw": function _throw(d) { | |
i = d, t.removeListener(e, a), t.removeListener("error", l); | |
} | |
}, Symbol.asyncIterator, function () { | |
return this; | |
}); | |
return t.on(e, a), t.on("error", l), o; | |
function a() { | |
var h = n.shift(); | |
for (var _len3 = arguments.length, d = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
d[_key3] = arguments[_key3]; | |
} | |
h ? h.resolve(createIterResult(d, !1)) : r.push(d); | |
} | |
function l(d) { | |
s = !0; | |
var h = n.shift(); | |
h ? h.reject(d) : i = d, o["return"](); | |
} | |
}; | |
var _Ri = Ri; | |
vb = _Ri.EventEmitter; | |
Sb = _Ri.defaultMaxListeners; | |
Eb = _Ri.init; | |
Ab = _Ri.listenerCount; | |
Ib = _Ri.on; | |
Tb = _Ri.once; | |
}); | |
var it = H(function (HR, fa) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var Pb = (ze(), Ie(Je)), | |
_Ne = Ne(), | |
Rb = _Ne.kResistStopPropagation, | |
Ob = _Ne.SymbolDispose, | |
xb = globalThis.AbortSignal || Hn().AbortSignal, | |
Bb = globalThis.AbortController || Hn().AbortController, | |
Cb = Object.getPrototypeOf(function () { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { | |
return _regeneratorRuntime().wrap(function _callee3$(_context3) { | |
while (1) switch (_context3.prev = _context3.next) { | |
case 0: | |
case "end": | |
return _context3.stop(); | |
} | |
}, _callee3); | |
})); | |
}).constructor, | |
lh = globalThis.Blob || Pb.Blob, | |
kb = typeof lh != "undefined" ? function (e) { | |
return e instanceof lh; | |
} : function (e) { | |
return !1; | |
}, | |
fh = function fh(t, e) { | |
if (t !== void 0 && (t === null || _typeof(t) != "object" || !("aborted" in t))) throw new ERR_INVALID_ARG_TYPE(e, "AbortSignal", t); | |
}, | |
Mb = function Mb(t, e) { | |
if (typeof t != "function") throw new ERR_INVALID_ARG_TYPE(e, "Function", t); | |
}, | |
la = /*#__PURE__*/function (_Error) { | |
function la(e) { | |
var _this2; | |
_classCallCheck(this, la); | |
if (!Array.isArray(e)) throw new TypeError("Expected input to be an Array, got ".concat(_typeof(e))); | |
var r = ""; | |
for (var n = 0; n < e.length; n++) r += " ".concat(e[n].stack, "\n"); | |
_this2 = _callSuper(this, la, [r]), _this2.name = "AggregateError", _this2.errors = e; | |
return _this2; | |
} | |
_inherits(la, _Error); | |
return _createClass(la); | |
}(/*#__PURE__*/_wrapNativeSuper(Error)); | |
fa.exports = { | |
AggregateError: la, | |
kEmptyObject: Object.freeze({}), | |
once: function once(t) { | |
var e = !1; | |
return function () { | |
for (var _len4 = arguments.length, r = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | |
r[_key4] = arguments[_key4]; | |
} | |
e || (e = !0, t.apply(this, r)); | |
}; | |
}, | |
createDeferredPromise: function createDeferredPromise() { | |
var t, e; | |
return { | |
promise: new Promise(function (n, i) { | |
t = n, e = i; | |
}), | |
resolve: t, | |
reject: e | |
}; | |
}, | |
promisify: function promisify(t) { | |
return new Promise(function (e, r) { | |
t(function (n) { | |
for (var _len5 = arguments.length, i = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { | |
i[_key5 - 1] = arguments[_key5]; | |
} | |
return n ? r(n) : e.apply(void 0, i); | |
}); | |
}); | |
}, | |
debuglog: function debuglog() { | |
return function () {}; | |
}, | |
format: function format(t) { | |
for (var _len6 = arguments.length, e = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) { | |
e[_key6 - 1] = arguments[_key6]; | |
} | |
return t.replace(/%([sdifj])/g, function () { | |
for (var _len7 = arguments.length, _ref2 = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | |
_ref2[_key7] = arguments[_key7]; | |
} | |
var r = _ref2[0], | |
n = _ref2[1]; | |
var i = e.shift(); | |
return n === "f" ? i.toFixed(6) : n === "j" ? JSON.stringify(i) : n === "s" && _typeof(i) == "object" ? "".concat(i.constructor !== Object ? i.constructor.name : "", " {}").trim() : i.toString(); | |
}); | |
}, | |
inspect: function inspect(t) { | |
switch (_typeof(t)) { | |
case "string": | |
if (t.includes("'")) if (t.includes('"')) { | |
if (!t.includes("`") && !t.includes("${")) return "`".concat(t, "`"); | |
} else return "\"".concat(t, "\""); | |
return "'".concat(t, "'"); | |
case "number": | |
return isNaN(t) ? "NaN" : Object.is(t, -0) ? String(t) : t; | |
case "bigint": | |
return "".concat(String(t), "n"); | |
case "boolean": | |
case "undefined": | |
return String(t); | |
case "object": | |
return "{}"; | |
} | |
}, | |
types: { | |
isAsyncFunction: function isAsyncFunction(t) { | |
return t instanceof Cb; | |
}, | |
isArrayBufferView: function isArrayBufferView(t) { | |
return ArrayBuffer.isView(t); | |
} | |
}, | |
isBlob: kb, | |
deprecate: function deprecate(t, e) { | |
return t; | |
}, | |
addAbortListener: (qr(), Ie(Lr)).addAbortListener || function (e, r) { | |
if (e === void 0) throw new ERR_INVALID_ARG_TYPE("signal", "AbortSignal", e); | |
fh(e, "signal"), Mb(r, "listener"); | |
var n; | |
return e.aborted ? queueMicrotask(function () { | |
return r(); | |
}) : (e.addEventListener("abort", r, _defineProperty({ | |
__proto__: null, | |
once: !0 | |
}, Rb, !0)), n = function n() { | |
e.removeEventListener("abort", r); | |
}), _defineProperty({ | |
__proto__: null | |
}, Ob, function () { | |
var i; | |
(i = n) === null || i === void 0 || i(); | |
}); | |
}, | |
AbortSignalAny: xb.any || function (e) { | |
if (e.length === 1) return e[0]; | |
var r = new Bb(), | |
n = function n() { | |
return r.abort(); | |
}; | |
return e.forEach(function (i) { | |
fh(i, "signals"), i.addEventListener("abort", n, { | |
once: !0 | |
}); | |
}), r.signal.addEventListener("abort", function () { | |
e.forEach(function (i) { | |
return i.removeEventListener("abort", n); | |
}); | |
}, { | |
once: !0 | |
}), r.signal; | |
} | |
}; | |
fa.exports.promisify.custom = Symbol["for"]("nodejs.util.promisify.custom"); | |
}); | |
var ft = H(function (XR, dh) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _it = it(), | |
Nb = _it.format, | |
Po = _it.inspect, | |
Lb = _it.AggregateError, | |
qb = globalThis.AggregateError || Lb, | |
Ub = Symbol("kIsNodeError"), | |
Db = ["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"], | |
Fb = /^([A-Z][a-z0-9]*)+$/, | |
jb = "__node_internal_", | |
Ro = {}; | |
function un(t, e) { | |
if (!t) throw new Ro.ERR_INTERNAL_ASSERTION(e); | |
} | |
function ch(t) { | |
var e = "", | |
r = t.length, | |
n = t[0] === "-" ? 1 : 0; | |
for (; r >= n + 4; r -= 3) e = "_".concat(t.slice(r - 3, r)).concat(e); | |
return "".concat(t.slice(0, r)).concat(e); | |
} | |
function Wb(t, e, r) { | |
if (typeof e == "function") return un(e.length <= r.length, "Code: ".concat(t, "; The provided arguments length (").concat(r.length, ") does not match the required ones (").concat(e.length, ").")), e.apply(void 0, _toConsumableArray(r)); | |
var n = (e.match(/%[dfijoOs]/g) || []).length; | |
return un(n === r.length, "Code: ".concat(t, "; The provided arguments length (").concat(r.length, ") does not match the required ones (").concat(n, ").")), r.length === 0 ? e : Nb.apply(void 0, [e].concat(_toConsumableArray(r))); | |
} | |
function tt(t, e, r) { | |
r || (r = Error); | |
var n = /*#__PURE__*/function (_r2) { | |
function n() { | |
_classCallCheck(this, n); | |
for (var _len8 = arguments.length, s = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { | |
s[_key8] = arguments[_key8]; | |
} | |
return _callSuper(this, n, [Wb(t, e, s)]); | |
} | |
_inherits(n, _r2); | |
return _createClass(n, [{ | |
key: "toString", | |
value: function toString() { | |
return "".concat(this.name, " [").concat(t, "]: ").concat(this.message); | |
} | |
}]); | |
}(r); | |
Object.defineProperties(n.prototype, { | |
name: { | |
value: r.name, | |
writable: !0, | |
enumerable: !1, | |
configurable: !0 | |
}, | |
toString: { | |
value: function value() { | |
return "".concat(this.name, " [").concat(t, "]: ").concat(this.message); | |
}, | |
writable: !0, | |
enumerable: !1, | |
configurable: !0 | |
} | |
}), n.prototype.code = t, n.prototype[Ub] = !0, Ro[t] = n; | |
} | |
function hh(t) { | |
var e = jb + t.name; | |
return Object.defineProperty(t, "name", { | |
value: e | |
}), t; | |
} | |
function $b(t, e) { | |
if (t && e && t !== e) { | |
if (Array.isArray(e.errors)) return e.errors.push(t), e; | |
var r = new qb([e, t], e.message); | |
return r.code = e.code, r; | |
} | |
return t || e; | |
} | |
var ca = /*#__PURE__*/function (_Error2) { | |
function ca() { | |
var _this3; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "The operation was aborted"; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0; | |
_classCallCheck(this, ca); | |
if (r !== void 0 && _typeof(r) != "object") throw new Ro.ERR_INVALID_ARG_TYPE("options", "Object", r); | |
_this3 = _callSuper(this, ca, [e, r]), _this3.code = "ABORT_ERR", _this3.name = "AbortError"; | |
return _this3; | |
} | |
_inherits(ca, _Error2); | |
return _createClass(ca); | |
}(/*#__PURE__*/_wrapNativeSuper(Error)); | |
tt("ERR_ASSERTION", "%s", Error); | |
tt("ERR_INVALID_ARG_TYPE", function (t, e, r) { | |
un(typeof t == "string", "'name' must be a string"), Array.isArray(e) || (e = [e]); | |
var n = "The "; | |
t.endsWith(" argument") ? n += "".concat(t, " ") : n += "\"".concat(t, "\" ").concat(t.includes(".") ? "property" : "argument", " "), n += "must be "; | |
var i = [], | |
s = [], | |
o = []; | |
var _iterator4 = _createForOfIteratorHelper(e), | |
_step4; | |
try { | |
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { | |
var _l7 = _step4.value; | |
un(typeof _l7 == "string", "All expected entries have to be of type string"), Db.includes(_l7) ? i.push(_l7.toLowerCase()) : Fb.test(_l7) ? s.push(_l7) : (un(_l7 !== "object", 'The value "object" should be written as "Object"'), o.push(_l7)); | |
} | |
} catch (err) { | |
_iterator4.e(err); | |
} finally { | |
_iterator4.f(); | |
} | |
if (s.length > 0) { | |
var l = i.indexOf("object"); | |
l !== -1 && (i.splice(i, l, 1), s.push("Object")); | |
} | |
if (i.length > 0) { | |
switch (i.length) { | |
case 1: | |
n += "of type ".concat(i[0]); | |
break; | |
case 2: | |
n += "one of type ".concat(i[0], " or ").concat(i[1]); | |
break; | |
default: | |
{ | |
var _l2 = i.pop(); | |
n += "one of type ".concat(i.join(", "), ", or ").concat(_l2); | |
} | |
} | |
(s.length > 0 || o.length > 0) && (n += " or "); | |
} | |
if (s.length > 0) { | |
switch (s.length) { | |
case 1: | |
n += "an instance of ".concat(s[0]); | |
break; | |
case 2: | |
n += "an instance of ".concat(s[0], " or ").concat(s[1]); | |
break; | |
default: | |
{ | |
var _l3 = s.pop(); | |
n += "an instance of ".concat(s.join(", "), ", or ").concat(_l3); | |
} | |
} | |
o.length > 0 && (n += " or "); | |
} | |
switch (o.length) { | |
case 0: | |
break; | |
case 1: | |
o[0].toLowerCase() !== o[0] && (n += "an "), n += "".concat(o[0]); | |
break; | |
case 2: | |
n += "one of ".concat(o[0], " or ").concat(o[1]); | |
break; | |
default: | |
{ | |
var _l4 = o.pop(); | |
n += "one of ".concat(o.join(", "), ", or ").concat(_l4); | |
} | |
} | |
if (r == null) n += ". Received ".concat(r);else if (typeof r == "function" && r.name) n += ". Received function ".concat(r.name);else if (_typeof(r) == "object") { | |
var a; | |
if ((a = r.constructor) !== null && a !== void 0 && a.name) n += ". Received an instance of ".concat(r.constructor.name);else { | |
var _l5 = Po(r, { | |
depth: -1 | |
}); | |
n += ". Received ".concat(_l5); | |
} | |
} else { | |
var _l6 = Po(r, { | |
colors: !1 | |
}); | |
_l6.length > 25 && (_l6 = "".concat(_l6.slice(0, 25), "...")), n += ". Received type ".concat(_typeof(r), " (").concat(_l6, ")"); | |
} | |
return n; | |
}, TypeError); | |
tt("ERR_INVALID_ARG_VALUE", function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "is invalid"; | |
var n = Po(e); | |
return n.length > 128 && (n = n.slice(0, 128) + "..."), "The ".concat(t.includes(".") ? "property" : "argument", " '").concat(t, "' ").concat(r, ". Received ").concat(n); | |
}, TypeError); | |
tt("ERR_INVALID_RETURN_VALUE", function (t, e, r) { | |
var n; | |
var i = r != null && (n = r.constructor) !== null && n !== void 0 && n.name ? "instance of ".concat(r.constructor.name) : "type ".concat(_typeof(r)); | |
return "Expected ".concat(t, " to be returned from the \"").concat(e, "\" function but got ").concat(i, "."); | |
}, TypeError); | |
tt("ERR_MISSING_ARGS", function () { | |
for (var _len9 = arguments.length, t = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { | |
t[_key9] = arguments[_key9]; | |
} | |
un(t.length > 0, "At least one arg needs to be specified"); | |
var e, | |
r = t.length; | |
switch (t = (Array.isArray(t) ? t : [t]).map(function (n) { | |
return "\"".concat(n, "\""); | |
}).join(" or "), r) { | |
case 1: | |
e += "The ".concat(t[0], " argument"); | |
break; | |
case 2: | |
e += "The ".concat(t[0], " and ").concat(t[1], " arguments"); | |
break; | |
default: | |
{ | |
var n = t.pop(); | |
e += "The ".concat(t.join(", "), ", and ").concat(n, " arguments"); | |
} | |
break; | |
} | |
return "".concat(e, " must be specified"); | |
}, TypeError); | |
tt("ERR_OUT_OF_RANGE", function (t, e, r) { | |
un(e, 'Missing "range" argument'); | |
var n; | |
return Number.isInteger(r) && Math.abs(r) > Ae(2, 32) ? n = ch(String(r)) : typeof r == "bigint" ? (n = String(r), (r > Ae(2, 32) || r < -Ae(2, 32)) && (n = ch(n)), n += "n") : n = Po(r), "The value of \"".concat(t, "\" is out of range. It must be ").concat(e, ". Received ").concat(n); | |
}, RangeError); | |
tt("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); | |
tt("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); | |
tt("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); | |
tt("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); | |
tt("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); | |
tt("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); | |
tt("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); | |
tt("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); | |
tt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); | |
tt("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); | |
tt("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); | |
dh.exports = { | |
AbortError: ca, | |
aggregateTwoErrors: hh($b), | |
hideStackFrames: hh, | |
codes: Ro | |
}; | |
}); | |
var zn = H(function (sO, Eh) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne2 = Ne(), | |
da = _Ne2.ArrayIsArray, | |
wh = _Ne2.ArrayPrototypeIncludes, | |
bh = _Ne2.ArrayPrototypeJoin, | |
Hb = _Ne2.ArrayPrototypeMap, | |
pa = _Ne2.NumberIsInteger, | |
Vb = _Ne2.NumberIsNaN, | |
zb = _Ne2.NumberMAX_SAFE_INTEGER, | |
Kb = _Ne2.NumberMIN_SAFE_INTEGER, | |
Gb = _Ne2.NumberParseInt, | |
Qb = _Ne2.ObjectPrototypeHasOwnProperty, | |
_h = _Ne2.RegExpPrototypeExec, | |
Yb = _Ne2.String, | |
Jb = _Ne2.StringPrototypeToUpperCase, | |
Xb = _Ne2.StringPrototypeTrim, | |
_ft = ft(), | |
xt = _ft.hideStackFrames, | |
_ft$codes = _ft.codes, | |
Zb = _ft$codes.ERR_SOCKET_BAD_PORT, | |
ot = _ft$codes.ERR_INVALID_ARG_TYPE, | |
Vn = _ft$codes.ERR_INVALID_ARG_VALUE, | |
ln = _ft$codes.ERR_OUT_OF_RANGE, | |
ph = _ft$codes.ERR_UNKNOWN_SIGNAL, | |
_it2 = it(), | |
e_ = _it2.normalizeEncoding, | |
_it$types = it().types, | |
t_ = _it$types.isAsyncFunction, | |
r_ = _it$types.isArrayBufferView, | |
yh = {}; | |
function n_(t) { | |
return t === (t | 0); | |
} | |
function i_(t) { | |
return t === t >>> 0; | |
} | |
var o_ = /^[0-7]+$/, | |
s_ = "must be a 32-bit unsigned integer or an octal string"; | |
function a_(t, e, r) { | |
if (typeof t == "undefined" && (t = r), typeof t == "string") { | |
if (_h(o_, t) === null) throw new Vn(e, t, s_); | |
t = Gb(t, 8); | |
} | |
return mh(t, e), t; | |
} | |
var u_ = xt(function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Kb; | |
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : zb; | |
if (typeof t != "number") throw new ot(e, "number", t); | |
if (!pa(t)) throw new ln(e, "an integer", t); | |
if (t < r || t > n) throw new ln(e, ">= ".concat(r, " && <= ").concat(n), t); | |
}), | |
l_ = xt(function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -2147483648; | |
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2147483647; | |
if (typeof t != "number") throw new ot(e, "number", t); | |
if (!pa(t)) throw new ln(e, "an integer", t); | |
if (t < r || t > n) throw new ln(e, ">= ".concat(r, " && <= ").concat(n), t); | |
}), | |
mh = xt(function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1; | |
if (typeof t != "number") throw new ot(e, "number", t); | |
if (!pa(t)) throw new ln(e, "an integer", t); | |
var n = r ? 1 : 0, | |
i = 4294967295; | |
if (t < n || t > i) throw new ln(e, ">= ".concat(n, " && <= ").concat(i), t); | |
}); | |
function ya(t, e) { | |
if (typeof t != "string") throw new ot(e, "string", t); | |
} | |
function f_(t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : void 0; | |
var n = arguments.length > 3 ? arguments[3] : undefined; | |
if (typeof t != "number") throw new ot(e, "number", t); | |
if (r != null && t < r || n != null && t > n || (r != null || n != null) && Vb(t)) throw new ln(e, "".concat(r != null ? ">= ".concat(r) : "").concat(r != null && n != null ? " && " : "").concat(n != null ? "<= ".concat(n) : ""), t); | |
} | |
var c_ = xt(function (t, e, r) { | |
if (!wh(r, t)) { | |
var i = "must be one of: " + bh(Hb(r, function (s) { | |
return typeof s == "string" ? "'".concat(s, "'") : Yb(s); | |
}), ", "); | |
throw new Vn(e, t, i); | |
} | |
}); | |
function vh(t, e) { | |
if (typeof t != "boolean") throw new ot(e, "boolean", t); | |
} | |
function ha(t, e, r) { | |
return t == null || !Qb(t, e) ? r : t[e]; | |
} | |
var h_ = xt(function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | |
var n = ha(r, "allowArray", !1), | |
i = ha(r, "allowFunction", !1); | |
if (!ha(r, "nullable", !1) && t === null || !n && da(t) || _typeof(t) != "object" && (!i || typeof t != "function")) throw new ot(e, "Object", t); | |
}), | |
d_ = xt(function (t, e) { | |
if (t != null && _typeof(t) != "object" && typeof t != "function") throw new ot(e, "a dictionary", t); | |
}), | |
Oo = xt(function (t, e) { | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | |
if (!da(t)) throw new ot(e, "Array", t); | |
if (t.length < r) { | |
var n = "must be longer than ".concat(r); | |
throw new Vn(e, t, n); | |
} | |
}); | |
function p_(t, e) { | |
Oo(t, e); | |
for (var r = 0; r < t.length; r++) ya(t[r], "".concat(e, "[").concat(r, "]")); | |
} | |
function y_(t, e) { | |
Oo(t, e); | |
for (var r = 0; r < t.length; r++) vh(t[r], "".concat(e, "[").concat(r, "]")); | |
} | |
function g_(t, e) { | |
Oo(t, e); | |
for (var r = 0; r < t.length; r++) { | |
var n = t[r], | |
i = "".concat(e, "[").concat(r, "]"); | |
if (n == null) throw new ot(i, "AbortSignal", n); | |
Sh(n, i); | |
} | |
} | |
function w_(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "signal"; | |
if (ya(t, e), yh[t] === void 0) throw yh[Jb(t)] !== void 0 ? new ph(t + " (signals must use all capital letters)") : new ph(t); | |
} | |
var b_ = xt(function (t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "buffer"; | |
if (!r_(t)) throw new ot(e, ["Buffer", "TypedArray", "DataView"], t); | |
}); | |
function __(t, e) { | |
var r = e_(e), | |
n = t.length; | |
if (r === "hex" && n % 2 !== 0) throw new Vn("encoding", e, "is invalid for data of length ".concat(n)); | |
} | |
function m_(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Port"; | |
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0; | |
if (typeof t != "number" && typeof t != "string" || typeof t == "string" && Xb(t).length === 0 || +t !== +t >>> 0 || t > 65535 || t === 0 && !r) throw new Zb(e, t, r); | |
return t | 0; | |
} | |
var Sh = xt(function (t, e) { | |
if (t !== void 0 && (t === null || _typeof(t) != "object" || !("aborted" in t))) throw new ot(e, "AbortSignal", t); | |
}), | |
v_ = xt(function (t, e) { | |
if (typeof t != "function") throw new ot(e, "Function", t); | |
}), | |
S_ = xt(function (t, e) { | |
if (typeof t != "function" || t_(t)) throw new ot(e, "Function", t); | |
}), | |
E_ = xt(function (t, e) { | |
if (t !== void 0) throw new ot(e, "undefined", t); | |
}); | |
function A_(t, e, r) { | |
if (!wh(r, t)) throw new ot(e, "('".concat(bh(r, "|"), "')"), t); | |
} | |
var I_ = /^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/; | |
function gh(t, e) { | |
if (typeof t == "undefined" || !_h(I_, t)) throw new Vn(e, t, 'must be an array or string of format "</styles.css>; rel=preload; as=style"'); | |
} | |
function T_(t) { | |
if (typeof t == "string") return gh(t, "hints"), t; | |
if (da(t)) { | |
var _e2 = t.length, | |
r = ""; | |
if (_e2 === 0) return r; | |
for (var n = 0; n < _e2; n++) { | |
var i = t[n]; | |
gh(i, "hints"), r += i, n !== _e2 - 1 && (r += ", "); | |
} | |
return r; | |
} | |
throw new Vn("hints", t, 'must be an array or string of format "</styles.css>; rel=preload; as=style"'); | |
} | |
Eh.exports = { | |
isInt32: n_, | |
isUint32: i_, | |
parseFileMode: a_, | |
validateArray: Oo, | |
validateStringArray: p_, | |
validateBooleanArray: y_, | |
validateAbortSignalArray: g_, | |
validateBoolean: vh, | |
validateBuffer: b_, | |
validateDictionary: d_, | |
validateEncoding: __, | |
validateFunction: v_, | |
validateInt32: l_, | |
validateInteger: u_, | |
validateNumber: f_, | |
validateObject: h_, | |
validateOneOf: c_, | |
validatePlainFunction: S_, | |
validatePort: m_, | |
validateSignalName: w_, | |
validateString: ya, | |
validateUint32: mh, | |
validateUndefined: E_, | |
validateUnion: A_, | |
validateAbortSignal: Sh, | |
validateLinkHeaderValue: T_ | |
}; | |
}); | |
var Ur = H(function (dO, Ph) { | |
P(); | |
O(); | |
R(); | |
var De = Ph.exports = {}, | |
Zt, | |
er; | |
function ga() { | |
throw new Error("setTimeout has not been defined"); | |
} | |
function wa() { | |
throw new Error("clearTimeout has not been defined"); | |
} | |
(function () { | |
try { | |
typeof setTimeout == "function" ? Zt = setTimeout : Zt = ga; | |
} catch (t) { | |
Zt = ga; | |
} | |
try { | |
typeof clearTimeout == "function" ? er = clearTimeout : er = wa; | |
} catch (t) { | |
er = wa; | |
} | |
})(); | |
function Ah(t) { | |
if (Zt === setTimeout) return setTimeout(t, 0); | |
if ((Zt === ga || !Zt) && setTimeout) return Zt = setTimeout, setTimeout(t, 0); | |
try { | |
return Zt(t, 0); | |
} catch (e) { | |
try { | |
return Zt.call(null, t, 0); | |
} catch (r) { | |
return Zt.call(this, t, 0); | |
} | |
} | |
} | |
function P_(t) { | |
if (er === clearTimeout) return clearTimeout(t); | |
if ((er === wa || !er) && clearTimeout) return er = clearTimeout, clearTimeout(t); | |
try { | |
return er(t); | |
} catch (e) { | |
try { | |
return er.call(null, t); | |
} catch (r) { | |
return er.call(this, t); | |
} | |
} | |
} | |
var mr = [], | |
Kn = !1, | |
fn, | |
xo = -1; | |
function R_() { | |
!Kn || !fn || (Kn = !1, fn.length ? mr = fn.concat(mr) : xo = -1, mr.length && Ih()); | |
} | |
function Ih() { | |
if (!Kn) { | |
var t = Ah(R_); | |
Kn = !0; | |
for (var e = mr.length; e;) { | |
for (fn = mr, mr = []; ++xo < e;) fn && fn[xo].run(); | |
xo = -1, e = mr.length; | |
} | |
fn = null, Kn = !1, P_(t); | |
} | |
} | |
De.nextTick = function (t) { | |
var e = new Array(arguments.length - 1); | |
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; | |
mr.push(new Th(t, e)), mr.length === 1 && !Kn && Ah(Ih); | |
}; | |
function Th(t, e) { | |
this.fun = t, this.array = e; | |
} | |
Th.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
De.title = "browser"; | |
De.browser = !0; | |
De.env = {}; | |
De.argv = []; | |
De.version = ""; | |
De.versions = {}; | |
function vr() {} | |
De.on = vr; | |
De.addListener = vr; | |
De.once = vr; | |
De.off = vr; | |
De.removeListener = vr; | |
De.removeAllListeners = vr; | |
De.emit = vr; | |
De.prependListener = vr; | |
De.prependOnceListener = vr; | |
De.listeners = function (t) { | |
return []; | |
}; | |
De.binding = function (t) { | |
throw new Error("process.binding is not supported"); | |
}; | |
De.cwd = function () { | |
return "/"; | |
}; | |
De.chdir = function (t) { | |
throw new Error("process.chdir is not supported"); | |
}; | |
De.umask = function () { | |
return 0; | |
}; | |
}); | |
var rr = H(function (mO, Wh) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne3 = Ne(), | |
Rh = _Ne3.SymbolAsyncIterator, | |
Oh = _Ne3.SymbolIterator, | |
cn = _Ne3.SymbolFor, | |
xh = cn("nodejs.stream.destroyed"), | |
Bh = cn("nodejs.stream.errored"), | |
ba = cn("nodejs.stream.readable"), | |
_a = cn("nodejs.stream.writable"), | |
Ch = cn("nodejs.stream.disturbed"), | |
O_ = cn("nodejs.webstream.isClosedPromise"), | |
x_ = cn("nodejs.webstream.controllerErrorFunction"); | |
function Bo(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1; | |
var r; | |
return !!(t && typeof t.pipe == "function" && typeof t.on == "function" && (!e || typeof t.pause == "function" && typeof t.resume == "function") && (!t._writableState || ((r = t._readableState) === null || r === void 0 ? void 0 : r.readable) !== !1) && (!t._writableState || t._readableState)); | |
} | |
function Co(t) { | |
var e; | |
return !!(t && typeof t.write == "function" && typeof t.on == "function" && (!t._readableState || ((e = t._writableState) === null || e === void 0 ? void 0 : e.writable) !== !1)); | |
} | |
function B_(t) { | |
return !!(t && typeof t.pipe == "function" && t._readableState && typeof t.on == "function" && typeof t.write == "function"); | |
} | |
function tr(t) { | |
return t && (t._readableState || t._writableState || typeof t.write == "function" && typeof t.on == "function" || typeof t.pipe == "function" && typeof t.on == "function"); | |
} | |
function kh(t) { | |
return !!(t && !tr(t) && typeof t.pipeThrough == "function" && typeof t.getReader == "function" && typeof t.cancel == "function"); | |
} | |
function Mh(t) { | |
return !!(t && !tr(t) && typeof t.getWriter == "function" && typeof t.abort == "function"); | |
} | |
function Nh(t) { | |
return !!(t && !tr(t) && _typeof(t.readable) == "object" && _typeof(t.writable) == "object"); | |
} | |
function C_(t) { | |
return kh(t) || Mh(t) || Nh(t); | |
} | |
function k_(t, e) { | |
return t == null ? !1 : e === !0 ? typeof t[Rh] == "function" : e === !1 ? typeof t[Oh] == "function" : typeof t[Rh] == "function" || typeof t[Oh] == "function"; | |
} | |
function ko(t) { | |
if (!tr(t)) return null; | |
var e = t._writableState, | |
r = t._readableState, | |
n = e || r; | |
return !!(t.destroyed || t[xh] || n != null && n.destroyed); | |
} | |
function Lh(t) { | |
if (!Co(t)) return null; | |
if (t.writableEnded === !0) return !0; | |
var e = t._writableState; | |
return e != null && e.errored ? !1 : typeof (e == null ? void 0 : e.ended) != "boolean" ? null : e.ended; | |
} | |
function M_(t, e) { | |
if (!Co(t)) return null; | |
if (t.writableFinished === !0) return !0; | |
var r = t._writableState; | |
return r != null && r.errored ? !1 : typeof (r == null ? void 0 : r.finished) != "boolean" ? null : !!(r.finished || e === !1 && r.ended === !0 && r.length === 0); | |
} | |
function N_(t) { | |
if (!Bo(t)) return null; | |
if (t.readableEnded === !0) return !0; | |
var e = t._readableState; | |
return !e || e.errored ? !1 : typeof (e == null ? void 0 : e.ended) != "boolean" ? null : e.ended; | |
} | |
function qh(t, e) { | |
if (!Bo(t)) return null; | |
var r = t._readableState; | |
return r != null && r.errored ? !1 : typeof (r == null ? void 0 : r.endEmitted) != "boolean" ? null : !!(r.endEmitted || e === !1 && r.ended === !0 && r.length === 0); | |
} | |
function Uh(t) { | |
return t && t[ba] != null ? t[ba] : typeof (t == null ? void 0 : t.readable) != "boolean" ? null : ko(t) ? !1 : Bo(t) && t.readable && !qh(t); | |
} | |
function Dh(t) { | |
return t && t[_a] != null ? t[_a] : typeof (t == null ? void 0 : t.writable) != "boolean" ? null : ko(t) ? !1 : Co(t) && t.writable && !Lh(t); | |
} | |
function L_(t, e) { | |
return tr(t) ? ko(t) ? !0 : !((e == null ? void 0 : e.readable) !== !1 && Uh(t) || (e == null ? void 0 : e.writable) !== !1 && Dh(t)) : null; | |
} | |
function q_(t) { | |
var e, r; | |
return tr(t) ? t.writableErrored ? t.writableErrored : (e = (r = t._writableState) === null || r === void 0 ? void 0 : r.errored) !== null && e !== void 0 ? e : null : null; | |
} | |
function U_(t) { | |
var e, r; | |
return tr(t) ? t.readableErrored ? t.readableErrored : (e = (r = t._readableState) === null || r === void 0 ? void 0 : r.errored) !== null && e !== void 0 ? e : null : null; | |
} | |
function D_(t) { | |
if (!tr(t)) return null; | |
if (typeof t.closed == "boolean") return t.closed; | |
var e = t._writableState, | |
r = t._readableState; | |
return typeof (e == null ? void 0 : e.closed) == "boolean" || typeof (r == null ? void 0 : r.closed) == "boolean" ? (e == null ? void 0 : e.closed) || (r == null ? void 0 : r.closed) : typeof t._closed == "boolean" && Fh(t) ? t._closed : null; | |
} | |
function Fh(t) { | |
return typeof t._closed == "boolean" && typeof t._defaultKeepAlive == "boolean" && typeof t._removedConnection == "boolean" && typeof t._removedContLen == "boolean"; | |
} | |
function jh(t) { | |
return typeof t._sent100 == "boolean" && Fh(t); | |
} | |
function F_(t) { | |
var e; | |
return typeof t._consuming == "boolean" && typeof t._dumped == "boolean" && ((e = t.req) === null || e === void 0 ? void 0 : e.upgradeOrConnect) === void 0; | |
} | |
function j_(t) { | |
if (!tr(t)) return null; | |
var e = t._writableState, | |
r = t._readableState, | |
n = e || r; | |
return !n && jh(t) || !!(n && n.autoDestroy && n.emitClose && n.closed === !1); | |
} | |
function W_(t) { | |
var e; | |
return !!(t && ((e = t[Ch]) !== null && e !== void 0 ? e : t.readableDidRead || t.readableAborted)); | |
} | |
function $_(t) { | |
var e, r, n, i, s, o, a, l, c, d; | |
return !!(t && ((e = (r = (n = (i = (s = (o = t[Bh]) !== null && o !== void 0 ? o : t.readableErrored) !== null && s !== void 0 ? s : t.writableErrored) !== null && i !== void 0 ? i : (a = t._readableState) === null || a === void 0 ? void 0 : a.errorEmitted) !== null && n !== void 0 ? n : (l = t._writableState) === null || l === void 0 ? void 0 : l.errorEmitted) !== null && r !== void 0 ? r : (c = t._readableState) === null || c === void 0 ? void 0 : c.errored) !== null && e !== void 0 ? e : !((d = t._writableState) === null || d === void 0) && d.errored)); | |
} | |
Wh.exports = { | |
isDestroyed: ko, | |
kIsDestroyed: xh, | |
isDisturbed: W_, | |
kIsDisturbed: Ch, | |
isErrored: $_, | |
kIsErrored: Bh, | |
isReadable: Uh, | |
kIsReadable: ba, | |
kIsClosedPromise: O_, | |
kControllerErrorFunction: x_, | |
kIsWritable: _a, | |
isClosed: D_, | |
isDuplexNodeStream: B_, | |
isFinished: L_, | |
isIterable: k_, | |
isReadableNodeStream: Bo, | |
isReadableStream: kh, | |
isReadableEnded: N_, | |
isReadableFinished: qh, | |
isReadableErrored: U_, | |
isNodeStream: tr, | |
isWebStream: C_, | |
isWritable: Dh, | |
isWritableNodeStream: Co, | |
isWritableStream: Mh, | |
isWritableEnded: Lh, | |
isWritableFinished: M_, | |
isWritableErrored: q_, | |
isServerRequest: F_, | |
isServerResponse: jh, | |
willEmitClose: j_, | |
isTransformStream: Nh | |
}; | |
}); | |
var Sr = H(function (PO, Aa) { | |
P(); | |
O(); | |
R(); | |
var Dr = Ur(), | |
_ft2 = ft(), | |
Jh = _ft2.AbortError, | |
H_ = _ft2.codes, | |
V_ = H_.ERR_INVALID_ARG_TYPE, | |
$h = H_.ERR_STREAM_PREMATURE_CLOSE, | |
_it3 = it(), | |
va = _it3.kEmptyObject, | |
Sa = _it3.once, | |
_zn = zn(), | |
z_ = _zn.validateAbortSignal, | |
K_ = _zn.validateFunction, | |
G_ = _zn.validateObject, | |
Q_ = _zn.validateBoolean, | |
_Ne4 = Ne(), | |
Y_ = _Ne4.Promise, | |
J_ = _Ne4.PromisePrototypeThen, | |
Xh = _Ne4.SymbolDispose, | |
_rr = rr(), | |
X_ = _rr.isClosed, | |
Hh = _rr.isReadable, | |
ma = _rr.isReadableNodeStream, | |
Z_ = _rr.isReadableStream, | |
Vh = _rr.isReadableFinished, | |
zh = _rr.isReadableErrored, | |
Kh = _rr.isWritable, | |
Gh = _rr.isWritableNodeStream, | |
em = _rr.isWritableStream, | |
Qh = _rr.isWritableFinished, | |
Yh = _rr.isWritableErrored, | |
tm = _rr.isNodeStream, | |
rm = _rr.willEmitClose, | |
nm = _rr.kIsClosedPromise, | |
Gn; | |
function im(t) { | |
return t.setHeader && typeof t.abort == "function"; | |
} | |
var Ea = function Ea() {}; | |
function Zh(t, e, r) { | |
var n, i; | |
if (arguments.length === 2 ? (r = e, e = va) : e == null ? e = va : G_(e, "options"), K_(r, "callback"), z_(e.signal, "options.signal"), r = Sa(r), Z_(t) || em(t)) return om(t, e, r); | |
if (!tm(t)) throw new V_("stream", ["ReadableStream", "WritableStream", "Stream"], t); | |
var s = (n = e.readable) !== null && n !== void 0 ? n : ma(t), | |
o = (i = e.writable) !== null && i !== void 0 ? i : Gh(t), | |
a = t._writableState, | |
l = t._readableState, | |
c = function c() { | |
t.writable || m(); | |
}, | |
d = rm(t) && ma(t) === s && Gh(t) === o, | |
h = Qh(t, !1), | |
m = function m() { | |
h = !0, t.destroyed && (d = !1), !(d && (!t.readable || s)) && (!s || w) && r.call(t); | |
}, | |
w = Vh(t, !1), | |
T = function T() { | |
w = !0, t.destroyed && (d = !1), !(d && (!t.writable || o)) && (!o || h) && r.call(t); | |
}, | |
v = function v(y) { | |
r.call(t, y); | |
}, | |
b = X_(t), | |
p = function p() { | |
b = !0; | |
var y = Yh(t) || zh(t); | |
if (y && typeof y != "boolean") return r.call(t, y); | |
if (s && !w && ma(t, !0) && !Vh(t, !1)) return r.call(t, new $h()); | |
if (o && !h && !Qh(t, !1)) return r.call(t, new $h()); | |
r.call(t); | |
}, | |
_ = function _() { | |
b = !0; | |
var y = Yh(t) || zh(t); | |
if (y && typeof y != "boolean") return r.call(t, y); | |
r.call(t); | |
}, | |
x = function x() { | |
t.req.on("finish", m); | |
}; | |
im(t) ? (t.on("complete", m), d || t.on("abort", p), t.req ? x() : t.on("request", x)) : o && !a && (t.on("end", c), t.on("close", c)), !d && typeof t.aborted == "boolean" && t.on("aborted", p), t.on("end", T), t.on("finish", m), e.error !== !1 && t.on("error", v), t.on("close", p), b ? Dr.nextTick(p) : a != null && a.errorEmitted || l != null && l.errorEmitted ? d || Dr.nextTick(_) : (!s && (!d || Hh(t)) && (h || Kh(t) === !1) || !o && (!d || Kh(t)) && (w || Hh(t) === !1) || l && t.req && t.aborted) && Dr.nextTick(_); | |
var I = function I() { | |
r = Ea, t.removeListener("aborted", p), t.removeListener("complete", m), t.removeListener("abort", p), t.removeListener("request", x), t.req && t.req.removeListener("finish", m), t.removeListener("end", c), t.removeListener("close", c), t.removeListener("finish", m), t.removeListener("end", T), t.removeListener("error", v), t.removeListener("close", p); | |
}; | |
if (e.signal && !b) { | |
var y = function y() { | |
var B = r; | |
I(), B.call(t, new Jh(void 0, { | |
cause: e.signal.reason | |
})); | |
}; | |
if (e.signal.aborted) Dr.nextTick(y);else { | |
Gn = Gn || it().addAbortListener; | |
var B = Gn(e.signal, y), | |
A = r; | |
r = Sa(function () { | |
for (var _len10 = arguments.length, q = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { | |
q[_key10] = arguments[_key10]; | |
} | |
B[Xh](), A.apply(t, q); | |
}); | |
} | |
} | |
return I; | |
} | |
function om(t, e, r) { | |
var n = !1, | |
i = Ea; | |
if (e.signal) if (i = function i() { | |
n = !0, r.call(t, new Jh(void 0, { | |
cause: e.signal.reason | |
})); | |
}, e.signal.aborted) Dr.nextTick(i);else { | |
Gn = Gn || it().addAbortListener; | |
var o = Gn(e.signal, i), | |
a = r; | |
r = Sa(function () { | |
for (var _len11 = arguments.length, l = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { | |
l[_key11] = arguments[_key11]; | |
} | |
o[Xh](), a.apply(t, l); | |
}); | |
} | |
var s = function s() { | |
for (var _len12 = arguments.length, o = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { | |
o[_key12] = arguments[_key12]; | |
} | |
n || Dr.nextTick(function () { | |
return r.apply(t, o); | |
}); | |
}; | |
return J_(t[nm].promise, s, s), Ea; | |
} | |
function sm(t, e) { | |
var r; | |
var n = !1; | |
return e === null && (e = va), (r = e) !== null && r !== void 0 && r.cleanup && (Q_(e.cleanup, "cleanup"), n = e.cleanup), new Y_(function (i, s) { | |
var o = Zh(t, e, function (a) { | |
n && o(), a ? s(a) : i(); | |
}); | |
}); | |
} | |
Aa.exports = Zh; | |
Aa.exports.finished = sm; | |
}); | |
var hn = H(function (MO, ad) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var nr = Ur(), | |
_ft3 = ft(), | |
am = _ft3.aggregateTwoErrors, | |
um = _ft3.codes.ERR_MULTIPLE_CALLBACK, | |
lm = _ft3.AbortError, | |
_Ne5 = Ne(), | |
rd = _Ne5.Symbol, | |
_rr2 = rr(), | |
fm = _rr2.kIsDestroyed, | |
cm = _rr2.isDestroyed, | |
hm = _rr2.isFinished, | |
dm = _rr2.isServerRequest, | |
nd = rd("kDestroy"), | |
Ia = rd("kConstruct"); | |
function id(t, e, r) { | |
t && (t.stack, e && !e.errored && (e.errored = t), r && !r.errored && (r.errored = t)); | |
} | |
function pm(t, e) { | |
var r = this._readableState, | |
n = this._writableState, | |
i = n || r; | |
return n != null && n.destroyed || r != null && r.destroyed ? (typeof e == "function" && e(), this) : (id(t, n, r), n && (n.destroyed = !0), r && (r.destroyed = !0), i.constructed ? ed(this, t, e) : this.once(nd, function (s) { | |
ed(this, am(s, t), e); | |
}), this); | |
} | |
function ed(t, e, r) { | |
var n = !1; | |
function i(s) { | |
if (n) return; | |
n = !0; | |
var o = t._readableState, | |
a = t._writableState; | |
id(s, a, o), a && (a.closed = !0), o && (o.closed = !0), typeof r == "function" && r(s), s ? nr.nextTick(ym, t, s) : nr.nextTick(od, t); | |
} | |
try { | |
t._destroy(e || null, i); | |
} catch (s) { | |
i(s); | |
} | |
} | |
function ym(t, e) { | |
Ta(t, e), od(t); | |
} | |
function od(t) { | |
var e = t._readableState, | |
r = t._writableState; | |
r && (r.closeEmitted = !0), e && (e.closeEmitted = !0), (r != null && r.emitClose || e != null && e.emitClose) && t.emit("close"); | |
} | |
function Ta(t, e) { | |
var r = t._readableState, | |
n = t._writableState; | |
n != null && n.errorEmitted || r != null && r.errorEmitted || (n && (n.errorEmitted = !0), r && (r.errorEmitted = !0), t.emit("error", e)); | |
} | |
function gm() { | |
var t = this._readableState, | |
e = this._writableState; | |
t && (t.constructed = !0, t.closed = !1, t.closeEmitted = !1, t.destroyed = !1, t.errored = null, t.errorEmitted = !1, t.reading = !1, t.ended = t.readable === !1, t.endEmitted = t.readable === !1), e && (e.constructed = !0, e.destroyed = !1, e.closed = !1, e.closeEmitted = !1, e.errored = null, e.errorEmitted = !1, e.finalCalled = !1, e.prefinished = !1, e.ended = e.writable === !1, e.ending = e.writable === !1, e.finished = e.writable === !1); | |
} | |
function Pa(t, e, r) { | |
var n = t._readableState, | |
i = t._writableState; | |
if (i != null && i.destroyed || n != null && n.destroyed) return this; | |
n != null && n.autoDestroy || i != null && i.autoDestroy ? t.destroy(e) : e && (e.stack, i && !i.errored && (i.errored = e), n && !n.errored && (n.errored = e), r ? nr.nextTick(Ta, t, e) : Ta(t, e)); | |
} | |
function wm(t, e) { | |
if (typeof t._construct != "function") return; | |
var r = t._readableState, | |
n = t._writableState; | |
r && (r.constructed = !1), n && (n.constructed = !1), t.once(Ia, e), !(t.listenerCount(Ia) > 1) && nr.nextTick(bm, t); | |
} | |
function bm(t) { | |
var e = !1; | |
function r(n) { | |
if (e) { | |
Pa(t, n != null ? n : new um()); | |
return; | |
} | |
e = !0; | |
var i = t._readableState, | |
s = t._writableState, | |
o = s || i; | |
i && (i.constructed = !0), s && (s.constructed = !0), o.destroyed ? t.emit(nd, n) : n ? Pa(t, n, !0) : nr.nextTick(_m, t); | |
} | |
try { | |
t._construct(function (n) { | |
nr.nextTick(r, n); | |
}); | |
} catch (n) { | |
nr.nextTick(r, n); | |
} | |
} | |
function _m(t) { | |
t.emit(Ia); | |
} | |
function td(t) { | |
return (t == null ? void 0 : t.setHeader) && typeof t.abort == "function"; | |
} | |
function sd(t) { | |
t.emit("close"); | |
} | |
function mm(t, e) { | |
t.emit("error", e), nr.nextTick(sd, t); | |
} | |
function vm(t, e) { | |
!t || cm(t) || (!e && !hm(t) && (e = new lm()), dm(t) ? (t.socket = null, t.destroy(e)) : td(t) ? t.abort() : td(t.req) ? t.req.abort() : typeof t.destroy == "function" ? t.destroy(e) : typeof t.close == "function" ? t.close() : e ? nr.nextTick(mm, t, e) : nr.nextTick(sd, t), t.destroyed || (t[fm] = !0)); | |
} | |
ad.exports = { | |
construct: wm, | |
destroyer: vm, | |
destroy: pm, | |
undestroy: gm, | |
errorOrDestroy: Pa | |
}; | |
}); | |
var Lo = H(function (jO, ld) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne6 = Ne(), | |
Sm = _Ne6.ArrayIsArray, | |
ud = _Ne6.ObjectSetPrototypeOf, | |
_ref4 = (qr(), Ie(Lr)), | |
Mo = _ref4.EventEmitter; | |
function No(t) { | |
Mo.call(this, t); | |
} | |
ud(No.prototype, Mo.prototype); | |
ud(No, Mo); | |
No.prototype.pipe = function (t, e) { | |
var r = this; | |
function n(d) { | |
t.writable && t.write(d) === !1 && r.pause && r.pause(); | |
} | |
r.on("data", n); | |
function i() { | |
r.readable && r.resume && r.resume(); | |
} | |
t.on("drain", i), !t._isStdio && (!e || e.end !== !1) && (r.on("end", o), r.on("close", a)); | |
var s = !1; | |
function o() { | |
s || (s = !0, t.end()); | |
} | |
function a() { | |
s || (s = !0, typeof t.destroy == "function" && t.destroy()); | |
} | |
function l(d) { | |
c(), Mo.listenerCount(this, "error") === 0 && this.emit("error", d); | |
} | |
Ra(r, "error", l), Ra(t, "error", l); | |
function c() { | |
r.removeListener("data", n), t.removeListener("drain", i), r.removeListener("end", o), r.removeListener("close", a), r.removeListener("error", l), t.removeListener("error", l), r.removeListener("end", c), r.removeListener("close", c), t.removeListener("close", c); | |
} | |
return r.on("end", c), r.on("close", c), t.on("close", c), t.emit("pipe", r), t; | |
}; | |
function Ra(t, e, r) { | |
if (typeof t.prependListener == "function") return t.prependListener(e, r); | |
!t._events || !t._events[e] ? t.on(e, r) : Sm(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]]; | |
} | |
ld.exports = { | |
Stream: No, | |
prependListener: Ra | |
}; | |
}); | |
var Oi = H(function (GO, qo) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne7 = Ne(), | |
Em = _Ne7.SymbolDispose, | |
_ft4 = ft(), | |
fd = _ft4.AbortError, | |
Am = _ft4.codes, | |
_rr3 = rr(), | |
cd = _rr3.isNodeStream, | |
Im = _rr3.isWebStream, | |
Tm = _rr3.kControllerErrorFunction, | |
Pm = Sr(), | |
hd = Am.ERR_INVALID_ARG_TYPE, | |
Oa, | |
Rm = function Rm(t, e) { | |
if (_typeof(t) != "object" || !("aborted" in t)) throw new hd(e, "AbortSignal", t); | |
}; | |
qo.exports.addAbortSignal = function (e, r) { | |
if (Rm(e, "signal"), !cd(r) && !Im(r)) throw new hd("stream", ["ReadableStream", "WritableStream", "Stream"], r); | |
return qo.exports.addAbortSignalNoValidate(e, r); | |
}; | |
qo.exports.addAbortSignalNoValidate = function (t, e) { | |
if (_typeof(t) != "object" || !("aborted" in t)) return e; | |
var r = cd(e) ? function () { | |
e.destroy(new fd(void 0, { | |
cause: t.reason | |
})); | |
} : function () { | |
e[Tm](new fd(void 0, { | |
cause: t.reason | |
})); | |
}; | |
if (t.aborted) r();else { | |
Oa = Oa || it().addAbortListener; | |
var n = Oa(t, r); | |
Pm(e, n[Em]); | |
} | |
return e; | |
}; | |
}); | |
var yd = H(function (rx, pd) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne8 = Ne(), | |
dd = _Ne8.StringPrototypeSlice, | |
Om = _Ne8.SymbolIterator, | |
Uo = _Ne8.TypedArrayPrototypeSet, | |
xm = _Ne8.Uint8Array, | |
_ref5 = (ze(), Ie(Je)), | |
xa = _ref5.Buffer, | |
_it4 = it(), | |
Bm = _it4.inspect; | |
pd.exports = /*#__PURE__*/function () { | |
function _class2() { | |
_classCallCheck(this, _class2); | |
this.head = null, this.tail = null, this.length = 0; | |
} | |
return _createClass(_class2, [{ | |
key: "push", | |
value: function push(e) { | |
var r = { | |
data: e, | |
next: null | |
}; | |
this.length > 0 ? this.tail.next = r : this.head = r, this.tail = r, ++this.length; | |
} | |
}, { | |
key: "unshift", | |
value: function unshift(e) { | |
var r = { | |
data: e, | |
next: this.head | |
}; | |
this.length === 0 && (this.tail = r), this.head = r, ++this.length; | |
} | |
}, { | |
key: "shift", | |
value: function shift() { | |
if (this.length === 0) return; | |
var e = this.head.data; | |
return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, e; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
this.head = this.tail = null, this.length = 0; | |
} | |
}, { | |
key: "join", | |
value: function join(e) { | |
if (this.length === 0) return ""; | |
var r = this.head, | |
n = "" + r.data; | |
for (; (r = r.next) !== null;) n += e + r.data; | |
return n; | |
} | |
}, { | |
key: "concat", | |
value: function concat(e) { | |
if (this.length === 0) return xa.alloc(0); | |
var r = xa.allocUnsafe(e >>> 0), | |
n = this.head, | |
i = 0; | |
for (; n;) Uo(r, n.data, i), i += n.data.length, n = n.next; | |
return r; | |
} | |
}, { | |
key: "consume", | |
value: function consume(e, r) { | |
var n = this.head.data; | |
if (e < n.length) { | |
var i = n.slice(0, e); | |
return this.head.data = n.slice(e), i; | |
} | |
return e === n.length ? this.shift() : r ? this._getString(e) : this._getBuffer(e); | |
} | |
}, { | |
key: "first", | |
value: function first() { | |
return this.head.data; | |
} | |
}, { | |
key: Om, | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function value() { | |
var _e3; | |
return _regeneratorRuntime().wrap(function value$(_context4) { | |
while (1) switch (_context4.prev = _context4.next) { | |
case 0: | |
_e3 = this.head; | |
case 1: | |
if (!_e3) { | |
_context4.next = 7; | |
break; | |
} | |
_context4.next = 4; | |
return _e3.data; | |
case 4: | |
_e3 = _e3.next; | |
_context4.next = 1; | |
break; | |
case 7: | |
case "end": | |
return _context4.stop(); | |
} | |
}, value, this); | |
}) | |
}, { | |
key: "_getString", | |
value: function _getString(e) { | |
var r = "", | |
n = this.head, | |
i = 0; | |
do { | |
var s = n.data; | |
if (e > s.length) r += s, e -= s.length;else { | |
e === s.length ? (r += s, ++i, n.next ? this.head = n.next : this.head = this.tail = null) : (r += dd(s, 0, e), this.head = n, n.data = dd(s, e)); | |
break; | |
} | |
++i; | |
} while ((n = n.next) !== null); | |
return this.length -= i, r; | |
} | |
}, { | |
key: "_getBuffer", | |
value: function _getBuffer(e) { | |
var r = xa.allocUnsafe(e), | |
n = e, | |
i = this.head, | |
s = 0; | |
do { | |
var o = i.data; | |
if (e > o.length) Uo(r, o, n - e), e -= o.length;else { | |
e === o.length ? (Uo(r, o, n - e), ++s, i.next ? this.head = i.next : this.head = this.tail = null) : (Uo(r, new xm(o.buffer, o.byteOffset, e), n - e), this.head = i, i.data = o.slice(e)); | |
break; | |
} | |
++s; | |
} while ((i = i.next) !== null); | |
return this.length -= s, r; | |
} | |
}, { | |
key: Symbol["for"]("nodejs.util.inspect.custom"), | |
value: function value(e, r) { | |
return Bm(this, Xt(Ue({}, r), { | |
depth: 0, | |
customInspect: !1 | |
})); | |
} | |
}]); | |
}(); | |
}); | |
var xi = H(function (fx, _d) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne9 = Ne(), | |
Cm = _Ne9.MathFloor, | |
km = _Ne9.NumberIsInteger, | |
_zn2 = zn(), | |
Mm = _zn2.validateInteger, | |
Nm = ft().codes.ERR_INVALID_ARG_VALUE, | |
gd = 16 * 1024, | |
wd = 16; | |
function Lm(t, e, r) { | |
return t.highWaterMark != null ? t.highWaterMark : e ? t[r] : null; | |
} | |
function bd(t) { | |
return t ? wd : gd; | |
} | |
function qm(t, e) { | |
Mm(e, "value", 0), t ? wd = e : gd = e; | |
} | |
function Um(t, e, r, n) { | |
var i = Lm(e, n, r); | |
if (i != null) { | |
if (!km(i) || i < 0) { | |
var s = n ? "options.".concat(r) : "options.highWaterMark"; | |
throw new Nm(s, i); | |
} | |
return Cm(i); | |
} | |
return bd(t.objectMode); | |
} | |
_d.exports = { | |
getHighWaterMark: Um, | |
getDefaultHighWaterMark: bd, | |
setDefaultHighWaterMark: qm | |
}; | |
}); | |
function Dm() { | |
if (md) return Bi; | |
md = !0; | |
var t = Eo(), | |
e = t.Buffer; | |
function r(i, s) { | |
for (var o in i) s[o] = i[o]; | |
} | |
e.from && e.alloc && e.allocUnsafe && e.allocUnsafeSlow ? Bi = t : (r(t, Bi), Bi.Buffer = n); | |
function n(i, s, o) { | |
return e(i, s, o); | |
} | |
return n.prototype = Object.create(e.prototype), r(e, n), n.from = function (i, s, o) { | |
if (typeof i == "number") throw new TypeError("Argument must not be a number"); | |
return e(i, s, o); | |
}, n.alloc = function (i, s, o) { | |
if (typeof i != "number") throw new TypeError("Argument must be a number"); | |
var a = e(i); | |
return s !== void 0 ? typeof o == "string" ? a.fill(s, o) : a.fill(s) : a.fill(0), a; | |
}, n.allocUnsafe = function (i) { | |
if (typeof i != "number") throw new TypeError("Argument must be a number"); | |
return e(i); | |
}, n.allocUnsafeSlow = function (i) { | |
if (typeof i != "number") throw new TypeError("Argument must be a number"); | |
return t.SlowBuffer(i); | |
}, Bi; | |
} | |
function Fm() { | |
if (vd) return Ba; | |
vd = !0; | |
var t = Dm().Buffer, | |
e = t.isEncoding || function (p) { | |
switch (p = "" + p, p && p.toLowerCase()) { | |
case "hex": | |
case "utf8": | |
case "utf-8": | |
case "ascii": | |
case "binary": | |
case "base64": | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
case "raw": | |
return !0; | |
default: | |
return !1; | |
} | |
}; | |
function r(p) { | |
if (!p) return "utf8"; | |
for (var _;;) switch (p) { | |
case "utf8": | |
case "utf-8": | |
return "utf8"; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return "utf16le"; | |
case "latin1": | |
case "binary": | |
return "latin1"; | |
case "base64": | |
case "ascii": | |
case "hex": | |
return p; | |
default: | |
if (_) return; | |
p = ("" + p).toLowerCase(), _ = !0; | |
} | |
} | |
function n(p) { | |
var _ = r(p); | |
if (typeof _ != "string" && (t.isEncoding === e || !e(p))) throw new Error("Unknown encoding: " + p); | |
return _ || p; | |
} | |
Ba.StringDecoder = i; | |
function i(p) { | |
this.encoding = n(p); | |
var _; | |
switch (this.encoding) { | |
case "utf16le": | |
this.text = h, this.end = m, _ = 4; | |
break; | |
case "utf8": | |
this.fillLast = l, _ = 4; | |
break; | |
case "base64": | |
this.text = w, this.end = T, _ = 3; | |
break; | |
default: | |
this.write = v, this.end = b; | |
return; | |
} | |
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(_); | |
} | |
i.prototype.write = function (p) { | |
if (p.length === 0) return ""; | |
var _, x; | |
if (this.lastNeed) { | |
if (_ = this.fillLast(p), _ === void 0) return ""; | |
x = this.lastNeed, this.lastNeed = 0; | |
} else x = 0; | |
return x < p.length ? _ ? _ + this.text(p, x) : this.text(p, x) : _ || ""; | |
}, i.prototype.end = d, i.prototype.text = c, i.prototype.fillLast = function (p) { | |
if (this.lastNeed <= p.length) return p.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); | |
p.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, p.length), this.lastNeed -= p.length; | |
}; | |
function s(p) { | |
return p <= 127 ? 0 : p >> 5 === 6 ? 2 : p >> 4 === 14 ? 3 : p >> 3 === 30 ? 4 : p >> 6 === 2 ? -1 : -2; | |
} | |
function o(p, _, x) { | |
var I = _.length - 1; | |
if (I < x) return 0; | |
var y = s(_[I]); | |
return y >= 0 ? (y > 0 && (p.lastNeed = y - 1), y) : --I < x || y === -2 ? 0 : (y = s(_[I]), y >= 0 ? (y > 0 && (p.lastNeed = y - 2), y) : --I < x || y === -2 ? 0 : (y = s(_[I]), y >= 0 ? (y > 0 && (y === 2 ? y = 0 : p.lastNeed = y - 3), y) : 0)); | |
} | |
function a(p, _, x) { | |
if ((_[0] & 192) !== 128) return p.lastNeed = 0, "\uFFFD"; | |
if (p.lastNeed > 1 && _.length > 1) { | |
if ((_[1] & 192) !== 128) return p.lastNeed = 1, "\uFFFD"; | |
if (p.lastNeed > 2 && _.length > 2 && (_[2] & 192) !== 128) return p.lastNeed = 2, "\uFFFD"; | |
} | |
} | |
function l(p) { | |
var _ = this.lastTotal - this.lastNeed, | |
x = a(this, p); | |
if (x !== void 0) return x; | |
if (this.lastNeed <= p.length) return p.copy(this.lastChar, _, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); | |
p.copy(this.lastChar, _, 0, p.length), this.lastNeed -= p.length; | |
} | |
function c(p, _) { | |
var x = o(this, p, _); | |
if (!this.lastNeed) return p.toString("utf8", _); | |
this.lastTotal = x; | |
var I = p.length - (x - this.lastNeed); | |
return p.copy(this.lastChar, 0, I), p.toString("utf8", _, I); | |
} | |
function d(p) { | |
var _ = p && p.length ? this.write(p) : ""; | |
return this.lastNeed ? _ + "\uFFFD" : _; | |
} | |
function h(p, _) { | |
if ((p.length - _) % 2 === 0) { | |
var x = p.toString("utf16le", _); | |
if (x) { | |
var I = x.charCodeAt(x.length - 1); | |
if (I >= 55296 && I <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = p[p.length - 2], this.lastChar[1] = p[p.length - 1], x.slice(0, -1); | |
} | |
return x; | |
} | |
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = p[p.length - 1], p.toString("utf16le", _, p.length - 1); | |
} | |
function m(p) { | |
var _ = p && p.length ? this.write(p) : ""; | |
if (this.lastNeed) { | |
var x = this.lastTotal - this.lastNeed; | |
return _ + this.lastChar.toString("utf16le", 0, x); | |
} | |
return _; | |
} | |
function w(p, _) { | |
var x = (p.length - _) % 3; | |
return x === 0 ? p.toString("base64", _) : (this.lastNeed = 3 - x, this.lastTotal = 3, x === 1 ? this.lastChar[0] = p[p.length - 1] : (this.lastChar[0] = p[p.length - 2], this.lastChar[1] = p[p.length - 1]), p.toString("base64", _, p.length - x)); | |
} | |
function T(p) { | |
var _ = p && p.length ? this.write(p) : ""; | |
return this.lastNeed ? _ + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : _; | |
} | |
function v(p) { | |
return p.toString(this.encoding); | |
} | |
function b(p) { | |
return p && p.length ? this.write(p) : ""; | |
} | |
return Ba; | |
} | |
var Bi, | |
md, | |
Ba, | |
vd, | |
Do, | |
Sd, | |
Ed = rt(function () { | |
P(); | |
O(); | |
R(); | |
Ao(); | |
Bi = {}, md = !1; | |
Ba = {}, vd = !1; | |
Do = Fm(); | |
Do.StringDecoder; | |
Sd = Do.StringDecoder; | |
}); | |
var Ad = {}; | |
on(Ad, { | |
StringDecoder: function StringDecoder() { | |
return Sd; | |
}, | |
"default": function _default() { | |
return Do; | |
} | |
}); | |
var Id = rt(function () { | |
P(); | |
O(); | |
R(); | |
Ed(); | |
Ao(); | |
}); | |
var Ca = H(function (Mx, Od) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var Td = Ur(), | |
_Ne10 = Ne(), | |
jm = _Ne10.PromisePrototypeThen, | |
Pd = _Ne10.SymbolAsyncIterator, | |
Rd = _Ne10.SymbolIterator, | |
_ref6 = (ze(), Ie(Je)), | |
Wm = _ref6.Buffer, | |
_ft$codes2 = ft().codes, | |
$m = _ft$codes2.ERR_INVALID_ARG_TYPE, | |
Hm = _ft$codes2.ERR_STREAM_NULL_VALUES; | |
function Vm(t, e, r) { | |
var n; | |
if (typeof e == "string" || e instanceof Wm) return new t(Xt(Ue({ | |
objectMode: !0 | |
}, r), { | |
read: function read() { | |
this.push(e), this.push(null); | |
} | |
})); | |
var i; | |
if (e && e[Pd]) i = !0, n = e[Pd]();else if (e && e[Rd]) i = !1, n = e[Rd]();else throw new $m("iterable", ["Iterable"], e); | |
var s = new t(Ue({ | |
objectMode: !0, | |
highWaterMark: 1 | |
}, r)), | |
o = !1; | |
s._read = function () { | |
o || (o = !0, l()); | |
}, s._destroy = function (c, d) { | |
jm(a(c), function () { | |
return Td.nextTick(d, c); | |
}, function (h) { | |
return Td.nextTick(d, h || c); | |
}); | |
}; | |
function a(c) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { | |
var d, h, _yield$n$throw, m, w, _yield$n$return, _m2; | |
return _regeneratorRuntime().wrap(function _callee4$(_context5) { | |
while (1) switch (_context5.prev = _context5.next) { | |
case 0: | |
d = c != null, h = typeof n["throw"] == "function"; | |
if (!(d && h)) { | |
_context5.next = 11; | |
break; | |
} | |
_context5.next = 4; | |
return n["throw"](c); | |
case 4: | |
_yield$n$throw = _context5.sent; | |
m = _yield$n$throw.value; | |
w = _yield$n$throw.done; | |
_context5.next = 9; | |
return m; | |
case 9: | |
if (!w) { | |
_context5.next = 11; | |
break; | |
} | |
return _context5.abrupt("return"); | |
case 11: | |
if (!(typeof n["return"] == "function")) { | |
_context5.next = 18; | |
break; | |
} | |
_context5.next = 14; | |
return n["return"](); | |
case 14: | |
_yield$n$return = _context5.sent; | |
_m2 = _yield$n$return.value; | |
_context5.next = 18; | |
return _m2; | |
case 18: | |
case "end": | |
return _context5.stop(); | |
} | |
}, _callee4); | |
})); | |
} | |
function l() { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { | |
var _ref7, c, d, h; | |
return _regeneratorRuntime().wrap(function _callee5$(_context6) { | |
while (1) switch (_context6.prev = _context6.next) { | |
case 0: | |
_context6.prev = 0; | |
if (!i) { | |
_context6.next = 7; | |
break; | |
} | |
_context6.next = 4; | |
return n.next(); | |
case 4: | |
_context6.t0 = _context6.sent; | |
_context6.next = 8; | |
break; | |
case 7: | |
_context6.t0 = n.next(); | |
case 8: | |
_ref7 = _context6.t0; | |
c = _ref7.value; | |
d = _ref7.done; | |
if (!d) { | |
_context6.next = 15; | |
break; | |
} | |
s.push(null); | |
_context6.next = 28; | |
break; | |
case 15: | |
if (!(c && typeof c.then == "function")) { | |
_context6.next = 21; | |
break; | |
} | |
_context6.next = 18; | |
return c; | |
case 18: | |
_context6.t1 = _context6.sent; | |
_context6.next = 22; | |
break; | |
case 21: | |
_context6.t1 = c; | |
case 22: | |
h = _context6.t1; | |
if (!(h === null)) { | |
_context6.next = 25; | |
break; | |
} | |
throw o = !1, new Hm(); | |
case 25: | |
if (!s.push(h)) { | |
_context6.next = 27; | |
break; | |
} | |
return _context6.abrupt("continue", 34); | |
case 27: | |
o = !1; | |
case 28: | |
_context6.next = 33; | |
break; | |
case 30: | |
_context6.prev = 30; | |
_context6.t2 = _context6["catch"](0); | |
s.destroy(_context6.t2); | |
case 33: | |
return _context6.abrupt("break", 36); | |
case 34: | |
_context6.next = 0; | |
break; | |
case 36: | |
case "end": | |
return _context6.stop(); | |
} | |
}, _callee5, null, [[0, 30]]); | |
})); | |
} | |
return s; | |
} | |
Od.exports = Vm; | |
}); | |
var ki = H(function (Wx, Kd) { | |
P(); | |
O(); | |
R(); | |
var Dt = Ur(), | |
_Ne11 = Ne(), | |
zm = _Ne11.ArrayPrototypeIndexOf, | |
Km = _Ne11.NumberIsInteger, | |
Gm = _Ne11.NumberIsNaN, | |
Qm = _Ne11.NumberParseInt, | |
Fa = _Ne11.ObjectDefineProperties, | |
Ym = _Ne11.ObjectKeys, | |
Cd = _Ne11.ObjectSetPrototypeOf, | |
kd = _Ne11.Promise, | |
Jm = _Ne11.SafeSet, | |
Xm = _Ne11.SymbolAsyncDispose, | |
Zm = _Ne11.SymbolAsyncIterator, | |
ev = _Ne11.Symbol; | |
Kd.exports = pe; | |
pe.ReadableState = $o; | |
var _ref8 = (qr(), Ie(Lr)), | |
tv = _ref8.EventEmitter, | |
_Lo = Lo(), | |
Fr = _Lo.Stream, | |
rv = _Lo.prependListener, | |
_ref9 = (ze(), Ie(Je)), | |
ka = _ref9.Buffer, | |
_Oi = Oi(), | |
nv = _Oi.addAbortSignal, | |
Md = Sr(), | |
we = it().debuglog("stream", function (t) { | |
we = t; | |
}), | |
iv = yd(), | |
Jn = hn(), | |
_xi = xi(), | |
ov = _xi.getHighWaterMark, | |
sv = _xi.getDefaultHighWaterMark, | |
_ft5 = ft(), | |
xd = _ft5.aggregateTwoErrors, | |
_ft5$codes = _ft5.codes, | |
av = _ft5$codes.ERR_INVALID_ARG_TYPE, | |
uv = _ft5$codes.ERR_METHOD_NOT_IMPLEMENTED, | |
lv = _ft5$codes.ERR_OUT_OF_RANGE, | |
fv = _ft5$codes.ERR_STREAM_PUSH_AFTER_EOF, | |
cv = _ft5$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, | |
hv = _ft5.AbortError, | |
_zn3 = zn(), | |
dv = _zn3.validateObject, | |
dn = ev("kPaused"), | |
_ref10 = (Id(), Ie(Ad)), | |
Nd = _ref10.StringDecoder, | |
pv = Ca(); | |
Cd(pe.prototype, Fr.prototype); | |
Cd(pe, Fr); | |
var Ma = function Ma() {}, | |
Qn = Jn.errorOrDestroy, | |
Yn = 1, | |
yv = 2, | |
Ld = 4, | |
Ci = 8, | |
qd = 16, | |
Fo = 32, | |
jo = 64, | |
Ud = 128, | |
gv = 256, | |
wv = 512, | |
bv = 1024, | |
Ua = 2048, | |
Da = 4096, | |
_v = 8192, | |
mv = 16384, | |
vv = 32768, | |
Dd = 65536, | |
Sv = 1 << 17, | |
Ev = 1 << 18; | |
function Ke(t) { | |
return { | |
enumerable: !1, | |
get: function get() { | |
return (this.state & t) !== 0; | |
}, | |
set: function set(e) { | |
e ? this.state |= t : this.state &= ~t; | |
} | |
}; | |
} | |
Fa($o.prototype, { | |
objectMode: Ke(Yn), | |
ended: Ke(yv), | |
endEmitted: Ke(Ld), | |
reading: Ke(Ci), | |
constructed: Ke(qd), | |
sync: Ke(Fo), | |
needReadable: Ke(jo), | |
emittedReadable: Ke(Ud), | |
readableListening: Ke(gv), | |
resumeScheduled: Ke(wv), | |
errorEmitted: Ke(bv), | |
emitClose: Ke(Ua), | |
autoDestroy: Ke(Da), | |
destroyed: Ke(_v), | |
closed: Ke(mv), | |
closeEmitted: Ke(vv), | |
multiAwaitDrain: Ke(Dd), | |
readingMore: Ke(Sv), | |
dataEmitted: Ke(Ev) | |
}); | |
function $o(t, e, r) { | |
typeof r != "boolean" && (r = e instanceof ir()), this.state = Ua | Da | qd | Fo, t && t.objectMode && (this.state |= Yn), r && t && t.readableObjectMode && (this.state |= Yn), this.highWaterMark = t ? ov(this, t, "readableHighWaterMark", r) : sv(!1), this.buffer = new iv(), this.length = 0, this.pipes = [], this.flowing = null, this[dn] = null, t && t.emitClose === !1 && (this.state &= ~Ua), t && t.autoDestroy === !1 && (this.state &= ~Da), this.errored = null, this.defaultEncoding = t && t.defaultEncoding || "utf8", this.awaitDrainWriters = null, this.decoder = null, this.encoding = null, t && t.encoding && (this.decoder = new Nd(t.encoding), this.encoding = t.encoding); | |
} | |
function pe(t) { | |
var _this4 = this; | |
if (!(this instanceof pe)) return new pe(t); | |
var e = this instanceof ir(); | |
this._readableState = new $o(t, this, e), t && (typeof t.read == "function" && (this._read = t.read), typeof t.destroy == "function" && (this._destroy = t.destroy), typeof t.construct == "function" && (this._construct = t.construct), t.signal && !e && nv(t.signal, this)), Fr.call(this, t), Jn.construct(this, function () { | |
_this4._readableState.needReadable && Wo(_this4, _this4._readableState); | |
}); | |
} | |
pe.prototype.destroy = Jn.destroy; | |
pe.prototype._undestroy = Jn.undestroy; | |
pe.prototype._destroy = function (t, e) { | |
e(t); | |
}; | |
pe.prototype[tv.captureRejectionSymbol] = function (t) { | |
this.destroy(t); | |
}; | |
pe.prototype[Xm] = function () { | |
var _this5 = this; | |
var t; | |
return this.destroyed || (t = this.readableEnded ? null : new hv(), this.destroy(t)), new kd(function (e, r) { | |
return Md(_this5, function (n) { | |
return n && n !== t ? r(n) : e(null); | |
}); | |
}); | |
}; | |
pe.prototype.push = function (t, e) { | |
return Fd(this, t, e, !1); | |
}; | |
pe.prototype.unshift = function (t, e) { | |
return Fd(this, t, e, !0); | |
}; | |
function Fd(t, e, r, n) { | |
we("readableAddChunk", e); | |
var i = t._readableState, | |
s; | |
if (i.state & Yn || (typeof e == "string" ? (r = r || i.defaultEncoding, i.encoding !== r && (n && i.encoding ? e = ka.from(e, r).toString(i.encoding) : (e = ka.from(e, r), r = ""))) : e instanceof ka ? r = "" : Fr._isUint8Array(e) ? (e = Fr._uint8ArrayToBuffer(e), r = "") : e != null && (s = new av("chunk", ["string", "Buffer", "Uint8Array"], e))), s) Qn(t, s);else if (e === null) i.state &= ~Ci, Tv(t, i);else if (i.state & Yn || e && e.length > 0) { | |
if (n) { | |
if (i.state & Ld) Qn(t, new cv());else { | |
if (i.destroyed || i.errored) return !1; | |
Na(t, i, e, !0); | |
} | |
} else if (i.ended) Qn(t, new fv());else { | |
if (i.destroyed || i.errored) return !1; | |
i.state &= ~Ci, i.decoder && !r ? (e = i.decoder.write(e), i.objectMode || e.length !== 0 ? Na(t, i, e, !1) : Wo(t, i)) : Na(t, i, e, !1); | |
} | |
} else n || (i.state &= ~Ci, Wo(t, i)); | |
return !i.ended && (i.length < i.highWaterMark || i.length === 0); | |
} | |
function Na(t, e, r, n) { | |
e.flowing && e.length === 0 && !e.sync && t.listenerCount("data") > 0 ? (e.state & Dd ? e.awaitDrainWriters.clear() : e.awaitDrainWriters = null, e.dataEmitted = !0, t.emit("data", r)) : (e.length += e.objectMode ? 1 : r.length, n ? e.buffer.unshift(r) : e.buffer.push(r), e.state & jo && Ho(t)), Wo(t, e); | |
} | |
pe.prototype.isPaused = function () { | |
var t = this._readableState; | |
return t[dn] === !0 || t.flowing === !1; | |
}; | |
pe.prototype.setEncoding = function (t) { | |
var e = new Nd(t); | |
this._readableState.decoder = e, this._readableState.encoding = this._readableState.decoder.encoding; | |
var r = this._readableState.buffer, | |
n = ""; | |
var _iterator5 = _createForOfIteratorHelper(r), | |
_step5; | |
try { | |
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { | |
var i = _step5.value; | |
n += e.write(i); | |
} | |
} catch (err) { | |
_iterator5.e(err); | |
} finally { | |
_iterator5.f(); | |
} | |
return r.clear(), n !== "" && r.push(n), this._readableState.length = n.length, this; | |
}; | |
var Av = 1073741824; | |
function Iv(t) { | |
if (t > Av) throw new lv("size", "<= 1GiB", t); | |
return t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++, t; | |
} | |
function Bd(t, e) { | |
return t <= 0 || e.length === 0 && e.ended ? 0 : e.state & Yn ? 1 : Gm(t) ? e.flowing && e.length ? e.buffer.first().length : e.length : t <= e.length ? t : e.ended ? e.length : 0; | |
} | |
pe.prototype.read = function (t) { | |
we("read", t), t === void 0 ? t = NaN : Km(t) || (t = Qm(t, 10)); | |
var e = this._readableState, | |
r = t; | |
if (t > e.highWaterMark && (e.highWaterMark = Iv(t)), t !== 0 && (e.state &= ~Ud), t === 0 && e.needReadable && ((e.highWaterMark !== 0 ? e.length >= e.highWaterMark : e.length > 0) || e.ended)) return we("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? La(this) : Ho(this), null; | |
if (t = Bd(t, e), t === 0 && e.ended) return e.length === 0 && La(this), null; | |
var n = (e.state & jo) !== 0; | |
if (we("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, we("length less than watermark", n)), e.ended || e.reading || e.destroyed || e.errored || !e.constructed) n = !1, we("reading, ended or constructing", n);else if (n) { | |
we("do read"), e.state |= Ci | Fo, e.length === 0 && (e.state |= jo); | |
try { | |
this._read(e.highWaterMark); | |
} catch (s) { | |
Qn(this, s); | |
} | |
e.state &= ~Fo, e.reading || (t = Bd(r, e)); | |
} | |
var i; | |
return t > 0 ? i = Vd(t, e) : i = null, i === null ? (e.needReadable = e.length <= e.highWaterMark, t = 0) : (e.length -= t, e.multiAwaitDrain ? e.awaitDrainWriters.clear() : e.awaitDrainWriters = null), e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && La(this)), i !== null && !e.errorEmitted && !e.closeEmitted && (e.dataEmitted = !0, this.emit("data", i)), i; | |
}; | |
function Tv(t, e) { | |
if (we("onEofChunk"), !e.ended) { | |
if (e.decoder) { | |
var r = e.decoder.end(); | |
r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length); | |
} | |
e.ended = !0, e.sync ? Ho(t) : (e.needReadable = !1, e.emittedReadable = !0, jd(t)); | |
} | |
} | |
function Ho(t) { | |
var e = t._readableState; | |
we("emitReadable", e.needReadable, e.emittedReadable), e.needReadable = !1, e.emittedReadable || (we("emitReadable", e.flowing), e.emittedReadable = !0, Dt.nextTick(jd, t)); | |
} | |
function jd(t) { | |
var e = t._readableState; | |
we("emitReadable_", e.destroyed, e.length, e.ended), !e.destroyed && !e.errored && (e.length || e.ended) && (t.emit("readable"), e.emittedReadable = !1), e.needReadable = !e.flowing && !e.ended && e.length <= e.highWaterMark, $d(t); | |
} | |
function Wo(t, e) { | |
!e.readingMore && e.constructed && (e.readingMore = !0, Dt.nextTick(Pv, t, e)); | |
} | |
function Pv(t, e) { | |
for (; !e.reading && !e.ended && (e.length < e.highWaterMark || e.flowing && e.length === 0);) { | |
var r = e.length; | |
if (we("maybeReadMore read 0"), t.read(0), r === e.length) break; | |
} | |
e.readingMore = !1; | |
} | |
pe.prototype._read = function (t) { | |
throw new uv("_read()"); | |
}; | |
pe.prototype.pipe = function (t, e) { | |
var r = this, | |
n = this._readableState; | |
n.pipes.length === 1 && (n.multiAwaitDrain || (n.multiAwaitDrain = !0, n.awaitDrainWriters = new Jm(n.awaitDrainWriters ? [n.awaitDrainWriters] : []))), n.pipes.push(t), we("pipe count=%d opts=%j", n.pipes.length, e); | |
var s = (!e || e.end !== !1) && t !== Dt.stdout && t !== Dt.stderr ? a : b; | |
n.endEmitted ? Dt.nextTick(s) : r.once("end", s), t.on("unpipe", o); | |
function o(p, _) { | |
we("onunpipe"), p === r && _ && _.hasUnpiped === !1 && (_.hasUnpiped = !0, d()); | |
} | |
function a() { | |
we("onend"), t.end(); | |
} | |
var l, | |
c = !1; | |
function d() { | |
we("cleanup"), t.removeListener("close", T), t.removeListener("finish", v), l && t.removeListener("drain", l), t.removeListener("error", w), t.removeListener("unpipe", o), r.removeListener("end", a), r.removeListener("end", b), r.removeListener("data", m), c = !0, l && n.awaitDrainWriters && (!t._writableState || t._writableState.needDrain) && l(); | |
} | |
function h() { | |
c || (n.pipes.length === 1 && n.pipes[0] === t ? (we("false write response, pause", 0), n.awaitDrainWriters = t, n.multiAwaitDrain = !1) : n.pipes.length > 1 && n.pipes.includes(t) && (we("false write response, pause", n.awaitDrainWriters.size), n.awaitDrainWriters.add(t)), r.pause()), l || (l = Rv(r, t), t.on("drain", l)); | |
} | |
r.on("data", m); | |
function m(p) { | |
we("ondata"); | |
var _ = t.write(p); | |
we("dest.write", _), _ === !1 && h(); | |
} | |
function w(p) { | |
if (we("onerror", p), b(), t.removeListener("error", w), t.listenerCount("error") === 0) { | |
var _ = t._writableState || t._readableState; | |
_ && !_.errorEmitted ? Qn(t, p) : t.emit("error", p); | |
} | |
} | |
rv(t, "error", w); | |
function T() { | |
t.removeListener("finish", v), b(); | |
} | |
t.once("close", T); | |
function v() { | |
we("onfinish"), t.removeListener("close", T), b(); | |
} | |
t.once("finish", v); | |
function b() { | |
we("unpipe"), r.unpipe(t); | |
} | |
return t.emit("pipe", r), t.writableNeedDrain === !0 ? h() : n.flowing || (we("pipe resume"), r.resume()), t; | |
}; | |
function Rv(t, e) { | |
return function () { | |
var n = t._readableState; | |
n.awaitDrainWriters === e ? (we("pipeOnDrain", 1), n.awaitDrainWriters = null) : n.multiAwaitDrain && (we("pipeOnDrain", n.awaitDrainWriters.size), n.awaitDrainWriters["delete"](e)), (!n.awaitDrainWriters || n.awaitDrainWriters.size === 0) && t.listenerCount("data") && t.resume(); | |
}; | |
} | |
pe.prototype.unpipe = function (t) { | |
var e = this._readableState, | |
r = { | |
hasUnpiped: !1 | |
}; | |
if (e.pipes.length === 0) return this; | |
if (!t) { | |
var i = e.pipes; | |
e.pipes = [], this.pause(); | |
for (var s = 0; s < i.length; s++) i[s].emit("unpipe", this, { | |
hasUnpiped: !1 | |
}); | |
return this; | |
} | |
var n = zm(e.pipes, t); | |
return n === -1 ? this : (e.pipes.splice(n, 1), e.pipes.length === 0 && this.pause(), t.emit("unpipe", this, r), this); | |
}; | |
pe.prototype.on = function (t, e) { | |
var r = Fr.prototype.on.call(this, t, e), | |
n = this._readableState; | |
return t === "data" ? (n.readableListening = this.listenerCount("readable") > 0, n.flowing !== !1 && this.resume()) : t === "readable" && !n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.flowing = !1, n.emittedReadable = !1, we("on readable", n.length, n.reading), n.length ? Ho(this) : n.reading || Dt.nextTick(Ov, this)), r; | |
}; | |
pe.prototype.addListener = pe.prototype.on; | |
pe.prototype.removeListener = function (t, e) { | |
var r = Fr.prototype.removeListener.call(this, t, e); | |
return t === "readable" && Dt.nextTick(Wd, this), r; | |
}; | |
pe.prototype.off = pe.prototype.removeListener; | |
pe.prototype.removeAllListeners = function (t) { | |
var e = Fr.prototype.removeAllListeners.apply(this, arguments); | |
return (t === "readable" || t === void 0) && Dt.nextTick(Wd, this), e; | |
}; | |
function Wd(t) { | |
var e = t._readableState; | |
e.readableListening = t.listenerCount("readable") > 0, e.resumeScheduled && e[dn] === !1 ? e.flowing = !0 : t.listenerCount("data") > 0 ? t.resume() : e.readableListening || (e.flowing = null); | |
} | |
function Ov(t) { | |
we("readable nexttick read 0"), t.read(0); | |
} | |
pe.prototype.resume = function () { | |
var t = this._readableState; | |
return t.flowing || (we("resume"), t.flowing = !t.readableListening, xv(this, t)), t[dn] = !1, this; | |
}; | |
function xv(t, e) { | |
e.resumeScheduled || (e.resumeScheduled = !0, Dt.nextTick(Bv, t, e)); | |
} | |
function Bv(t, e) { | |
we("resume", e.reading), e.reading || t.read(0), e.resumeScheduled = !1, t.emit("resume"), $d(t), e.flowing && !e.reading && t.read(0); | |
} | |
pe.prototype.pause = function () { | |
return we("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (we("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState[dn] = !0, this; | |
}; | |
function $d(t) { | |
var e = t._readableState; | |
for (we("flow", e.flowing); e.flowing && t.read() !== null;); | |
} | |
pe.prototype.wrap = function (t) { | |
var _this6 = this; | |
var e = !1; | |
t.on("data", function (n) { | |
!_this6.push(n) && t.pause && (e = !0, t.pause()); | |
}), t.on("end", function () { | |
_this6.push(null); | |
}), t.on("error", function (n) { | |
Qn(_this6, n); | |
}), t.on("close", function () { | |
_this6.destroy(); | |
}), t.on("destroy", function () { | |
_this6.destroy(); | |
}), this._read = function () { | |
e && t.resume && (e = !1, t.resume()); | |
}; | |
var r = Ym(t); | |
for (var n = 1; n < r.length; n++) { | |
var i = r[n]; | |
this[i] === void 0 && typeof t[i] == "function" && (this[i] = t[i].bind(t)); | |
} | |
return this; | |
}; | |
pe.prototype[Zm] = function () { | |
return Hd(this); | |
}; | |
pe.prototype.iterator = function (t) { | |
return t !== void 0 && dv(t, "options"), Hd(this, t); | |
}; | |
function Hd(t, e) { | |
typeof t.read != "function" && (t = pe.wrap(t, { | |
objectMode: !0 | |
})); | |
var r = Cv(t, e); | |
return r.stream = t, r; | |
} | |
function Cv(t, e) { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() { | |
var r, n, i, s, o; | |
return _regeneratorRuntime().wrap(function _callee6$(_context7) { | |
while (1) switch (_context7.prev = _context7.next) { | |
case 0: | |
n = function _n4(o) { | |
this === t ? (r(), r = Ma) : r = o; | |
}; | |
r = Ma; | |
t.on("readable", n); | |
s = Md(t, { | |
writable: !1 | |
}, function (o) { | |
i = o ? xd(i, o) : null, r(), r = Ma; | |
}); | |
_context7.prev = 4; | |
case 5: | |
o = t.destroyed ? null : t.read(); | |
if (!(o !== null)) { | |
_context7.next = 11; | |
break; | |
} | |
_context7.next = 9; | |
return o; | |
case 9: | |
_context7.next = 17; | |
break; | |
case 11: | |
if (!i) { | |
_context7.next = 13; | |
break; | |
} | |
throw i; | |
case 13: | |
if (!(i === null)) { | |
_context7.next = 15; | |
break; | |
} | |
return _context7.abrupt("return"); | |
case 15: | |
_context7.next = 17; | |
return new et(new kd(n)); | |
case 17: | |
_context7.next = 5; | |
break; | |
case 19: | |
_context7.next = 24; | |
break; | |
case 21: | |
_context7.prev = 21; | |
_context7.t0 = _context7["catch"](4); | |
throw i = xd(i, _context7.t0), i; | |
case 24: | |
_context7.prev = 24; | |
(i || (e == null ? void 0 : e.destroyOnReturn) !== !1) && (i === void 0 || t._readableState.autoDestroy) ? Jn.destroyer(t, null) : (t.off("readable", n), s()); | |
return _context7.finish(24); | |
case 27: | |
case "end": | |
return _context7.stop(); | |
} | |
}, _callee6, null, [[4, 21, 24, 27]]); | |
})); | |
} | |
Fa(pe.prototype, { | |
readable: { | |
__proto__: null, | |
get: function get() { | |
var t = this._readableState; | |
return !!t && t.readable !== !1 && !t.destroyed && !t.errorEmitted && !t.endEmitted; | |
}, | |
set: function set(t) { | |
this._readableState && (this._readableState.readable = !!t); | |
} | |
}, | |
readableDidRead: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState.dataEmitted; | |
} | |
}, | |
readableAborted: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return !!(this._readableState.readable !== !1 && (this._readableState.destroyed || this._readableState.errored) && !this._readableState.endEmitted); | |
} | |
}, | |
readableHighWaterMark: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState.highWaterMark; | |
} | |
}, | |
readableBuffer: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState && this._readableState.buffer; | |
} | |
}, | |
readableFlowing: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState.flowing; | |
}, | |
set: function set(t) { | |
this._readableState && (this._readableState.flowing = t); | |
} | |
}, | |
readableLength: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState.length; | |
} | |
}, | |
readableObjectMode: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState ? this._readableState.objectMode : !1; | |
} | |
}, | |
readableEncoding: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState ? this._readableState.encoding : null; | |
} | |
}, | |
errored: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState ? this._readableState.errored : null; | |
} | |
}, | |
closed: { | |
__proto__: null, | |
get: function get() { | |
return this._readableState ? this._readableState.closed : !1; | |
} | |
}, | |
destroyed: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState ? this._readableState.destroyed : !1; | |
}, | |
set: function set(t) { | |
this._readableState && (this._readableState.destroyed = t); | |
} | |
}, | |
readableEnded: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._readableState ? this._readableState.endEmitted : !1; | |
} | |
} | |
}); | |
Fa($o.prototype, { | |
pipesCount: { | |
__proto__: null, | |
get: function get() { | |
return this.pipes.length; | |
} | |
}, | |
paused: { | |
__proto__: null, | |
get: function get() { | |
return this[dn] !== !1; | |
}, | |
set: function set(t) { | |
this[dn] = !!t; | |
} | |
} | |
}); | |
pe._fromList = Vd; | |
function Vd(t, e) { | |
if (e.length === 0) return null; | |
var r; | |
return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.first() : r = e.buffer.concat(e.length), e.buffer.clear()) : r = e.buffer.consume(t, e.decoder), r; | |
} | |
function La(t) { | |
var e = t._readableState; | |
we("endReadable", e.endEmitted), e.endEmitted || (e.ended = !0, Dt.nextTick(kv, e, t)); | |
} | |
function kv(t, e) { | |
if (we("endReadableNT", t.endEmitted, t.length), !t.errored && !t.closeEmitted && !t.endEmitted && t.length === 0) { | |
if (t.endEmitted = !0, e.emit("end"), e.writable && e.allowHalfOpen === !1) Dt.nextTick(Mv, e);else if (t.autoDestroy) { | |
var _r3 = e._writableState; | |
(!_r3 || _r3.autoDestroy && (_r3.finished || _r3.writable === !1)) && e.destroy(); | |
} | |
} | |
} | |
function Mv(t) { | |
t.writable && !t.writableEnded && !t.destroyed && t.end(); | |
} | |
pe.from = function (t, e) { | |
return pv(pe, t, e); | |
}; | |
var qa; | |
function zd() { | |
return qa === void 0 && (qa = {}), qa; | |
} | |
pe.fromWeb = function (t, e) { | |
return zd().newStreamReadableFromReadableStream(t, e); | |
}; | |
pe.toWeb = function (t, e) { | |
return zd().newReadableStreamFromStreamReadable(t, e); | |
}; | |
pe.wrap = function (t, e) { | |
var r, n; | |
return new pe(Xt(Ue({ | |
objectMode: (r = (n = t.readableObjectMode) !== null && n !== void 0 ? n : t.objectMode) !== null && r !== void 0 ? r : !0 | |
}, e), { | |
destroy: function destroy(i, s) { | |
Jn.destroyer(t, i), s(i); | |
} | |
})).wrap(t); | |
}; | |
}); | |
var Qo = H(function (Yx, op) { | |
P(); | |
O(); | |
R(); | |
var pn = Ur(), | |
_Ne12 = Ne(), | |
Yd = _Ne12.ArrayPrototypeSlice, | |
Nv = _Ne12.Error, | |
Jd = _Ne12.FunctionPrototypeSymbolHasInstance, | |
Xd = _Ne12.ObjectDefineProperty, | |
Lv = _Ne12.ObjectDefineProperties, | |
Zd = _Ne12.ObjectSetPrototypeOf, | |
qv = _Ne12.StringPrototypeToLowerCase, | |
Uv = _Ne12.Symbol, | |
Dv = _Ne12.SymbolHasInstance; | |
op.exports = Le; | |
Le.WritableState = Li; | |
var _ref11 = (qr(), Ie(Lr)), | |
Fv = _ref11.EventEmitter, | |
Mi = Lo().Stream, | |
_ref12 = (ze(), Ie(Je)), | |
Vo = _ref12.Buffer, | |
Go = hn(), | |
_Oi2 = Oi(), | |
jv = _Oi2.addAbortSignal, | |
_xi2 = xi(), | |
Wv = _xi2.getHighWaterMark, | |
$v = _xi2.getDefaultHighWaterMark, | |
_ft$codes3 = ft().codes, | |
Hv = _ft$codes3.ERR_INVALID_ARG_TYPE, | |
Vv = _ft$codes3.ERR_METHOD_NOT_IMPLEMENTED, | |
ep = _ft$codes3.ERR_MULTIPLE_CALLBACK, | |
zv = _ft$codes3.ERR_STREAM_CANNOT_PIPE, | |
Ni = _ft$codes3.ERR_STREAM_DESTROYED, | |
Kv = _ft$codes3.ERR_STREAM_ALREADY_FINISHED, | |
Gv = _ft$codes3.ERR_STREAM_NULL_VALUES, | |
Qv = _ft$codes3.ERR_STREAM_WRITE_AFTER_END, | |
tp = _ft$codes3.ERR_UNKNOWN_ENCODING, | |
Xn = Go.errorOrDestroy; | |
Zd(Le.prototype, Mi.prototype); | |
Zd(Le, Mi); | |
function $a() {} | |
var Zn = Uv("kOnFinished"); | |
function Li(t, e, r) { | |
typeof r != "boolean" && (r = e instanceof ir()), this.objectMode = !!(t && t.objectMode), r && (this.objectMode = this.objectMode || !!(t && t.writableObjectMode)), this.highWaterMark = t ? Wv(this, t, "writableHighWaterMark", r) : $v(!1), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; | |
var n = !!(t && t.decodeStrings === !1); | |
this.decodeStrings = !n, this.defaultEncoding = t && t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = Jv.bind(void 0, e), this.writecb = null, this.writelen = 0, this.afterWriteTickInfo = null, Ko(this), this.pendingcb = 0, this.constructed = !0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !t || t.emitClose !== !1, this.autoDestroy = !t || t.autoDestroy !== !1, this.errored = null, this.closed = !1, this.closeEmitted = !1, this[Zn] = []; | |
} | |
function Ko(t) { | |
t.buffered = [], t.bufferedIndex = 0, t.allBuffers = !0, t.allNoop = !0; | |
} | |
Li.prototype.getBuffer = function () { | |
return Yd(this.buffered, this.bufferedIndex); | |
}; | |
Xd(Li.prototype, "bufferedRequestCount", { | |
__proto__: null, | |
get: function get() { | |
return this.buffered.length - this.bufferedIndex; | |
} | |
}); | |
function Le(t) { | |
var _this7 = this; | |
var e = this instanceof ir(); | |
if (!e && !Jd(Le, this)) return new Le(t); | |
this._writableState = new Li(t, this, e), t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev), typeof t.destroy == "function" && (this._destroy = t.destroy), typeof t["final"] == "function" && (this._final = t["final"]), typeof t.construct == "function" && (this._construct = t.construct), t.signal && jv(t.signal, this)), Mi.call(this, t), Go.construct(this, function () { | |
var r = _this7._writableState; | |
r.writing || Va(_this7, r), za(_this7, r); | |
}); | |
} | |
Xd(Le, Dv, { | |
__proto__: null, | |
value: function value(t) { | |
return Jd(this, t) ? !0 : this !== Le ? !1 : t && t._writableState instanceof Li; | |
} | |
}); | |
Le.prototype.pipe = function () { | |
Xn(this, new zv()); | |
}; | |
function rp(t, e, r, n) { | |
var i = t._writableState; | |
if (typeof r == "function") n = r, r = i.defaultEncoding;else { | |
if (!r) r = i.defaultEncoding;else if (r !== "buffer" && !Vo.isEncoding(r)) throw new tp(r); | |
typeof n != "function" && (n = $a); | |
} | |
if (e === null) throw new Gv(); | |
if (!i.objectMode) if (typeof e == "string") i.decodeStrings !== !1 && (e = Vo.from(e, r), r = "buffer");else if (e instanceof Vo) r = "buffer";else if (Mi._isUint8Array(e)) e = Mi._uint8ArrayToBuffer(e), r = "buffer";else throw new Hv("chunk", ["string", "Buffer", "Uint8Array"], e); | |
var s; | |
return i.ending ? s = new Qv() : i.destroyed && (s = new Ni("write")), s ? (pn.nextTick(n, s), Xn(t, s, !0), s) : (i.pendingcb++, Yv(t, i, e, r, n)); | |
} | |
Le.prototype.write = function (t, e, r) { | |
return rp(this, t, e, r) === !0; | |
}; | |
Le.prototype.cork = function () { | |
this._writableState.corked++; | |
}; | |
Le.prototype.uncork = function () { | |
var t = this._writableState; | |
t.corked && (t.corked--, t.writing || Va(this, t)); | |
}; | |
Le.prototype.setDefaultEncoding = function (e) { | |
if (typeof e == "string" && (e = qv(e)), !Vo.isEncoding(e)) throw new tp(e); | |
return this._writableState.defaultEncoding = e, this; | |
}; | |
function Yv(t, e, r, n, i) { | |
var s = e.objectMode ? 1 : r.length; | |
e.length += s; | |
var o = e.length < e.highWaterMark; | |
return o || (e.needDrain = !0), e.writing || e.corked || e.errored || !e.constructed ? (e.buffered.push({ | |
chunk: r, | |
encoding: n, | |
callback: i | |
}), e.allBuffers && n !== "buffer" && (e.allBuffers = !1), e.allNoop && i !== $a && (e.allNoop = !1)) : (e.writelen = s, e.writecb = i, e.writing = !0, e.sync = !0, t._write(r, n, e.onwrite), e.sync = !1), o && !e.errored && !e.destroyed; | |
} | |
function Gd(t, e, r, n, i, s, o) { | |
e.writelen = n, e.writecb = o, e.writing = !0, e.sync = !0, e.destroyed ? e.onwrite(new Ni("write")) : r ? t._writev(i, e.onwrite) : t._write(i, s, e.onwrite), e.sync = !1; | |
} | |
function Qd(t, e, r, n) { | |
--e.pendingcb, n(r), Ha(e), Xn(t, r); | |
} | |
function Jv(t, e) { | |
var r = t._writableState, | |
n = r.sync, | |
i = r.writecb; | |
if (typeof i != "function") { | |
Xn(t, new ep()); | |
return; | |
} | |
r.writing = !1, r.writecb = null, r.length -= r.writelen, r.writelen = 0, e ? (e.stack, r.errored || (r.errored = e), t._readableState && !t._readableState.errored && (t._readableState.errored = e), n ? pn.nextTick(Qd, t, r, e, i) : Qd(t, r, e, i)) : (r.buffered.length > r.bufferedIndex && Va(t, r), n ? r.afterWriteTickInfo !== null && r.afterWriteTickInfo.cb === i ? r.afterWriteTickInfo.count++ : (r.afterWriteTickInfo = { | |
count: 1, | |
cb: i, | |
stream: t, | |
state: r | |
}, pn.nextTick(Xv, r.afterWriteTickInfo)) : np(t, r, 1, i)); | |
} | |
function Xv(_ref13) { | |
var t = _ref13.stream, | |
e = _ref13.state, | |
r = _ref13.count, | |
n = _ref13.cb; | |
return e.afterWriteTickInfo = null, np(t, e, r, n); | |
} | |
function np(t, e, r, n) { | |
for (!e.ending && !t.destroyed && e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain")); r-- > 0;) e.pendingcb--, n(); | |
e.destroyed && Ha(e), za(t, e); | |
} | |
function Ha(t) { | |
if (t.writing) return; | |
for (var i = t.bufferedIndex; i < t.buffered.length; ++i) { | |
var e; | |
var _t$buffered$i = t.buffered[i], | |
s = _t$buffered$i.chunk, | |
o = _t$buffered$i.callback, | |
a = t.objectMode ? 1 : s.length; | |
t.length -= a, o((e = t.errored) !== null && e !== void 0 ? e : new Ni("write")); | |
} | |
var r = t[Zn].splice(0); | |
for (var _i3 = 0; _i3 < r.length; _i3++) { | |
var n; | |
r[_i3]((n = t.errored) !== null && n !== void 0 ? n : new Ni("end")); | |
} | |
Ko(t); | |
} | |
function Va(t, e) { | |
if (e.corked || e.bufferProcessing || e.destroyed || !e.constructed) return; | |
var r = e.buffered, | |
n = e.bufferedIndex, | |
i = e.objectMode, | |
s = r.length - n; | |
if (!s) return; | |
var o = n; | |
if (e.bufferProcessing = !0, s > 1 && t._writev) { | |
e.pendingcb -= s - 1; | |
var a = e.allNoop ? $a : function (c) { | |
for (var d = o; d < r.length; ++d) r[d].callback(c); | |
}, | |
l = e.allNoop && o === 0 ? r : Yd(r, o); | |
l.allBuffers = e.allBuffers, Gd(t, e, !0, e.length, l, "", a), Ko(e); | |
} else { | |
do { | |
var _r$o = r[o], | |
_a2 = _r$o.chunk, | |
_l8 = _r$o.encoding, | |
c = _r$o.callback; | |
r[o++] = null; | |
var d = i ? 1 : _a2.length; | |
Gd(t, e, !1, d, _a2, _l8, c); | |
} while (o < r.length && !e.writing); | |
o === r.length ? Ko(e) : o > 256 ? (r.splice(0, o), e.bufferedIndex = 0) : e.bufferedIndex = o; | |
} | |
e.bufferProcessing = !1; | |
} | |
Le.prototype._write = function (t, e, r) { | |
if (this._writev) this._writev([{ | |
chunk: t, | |
encoding: e | |
}], r);else throw new Vv("_write()"); | |
}; | |
Le.prototype._writev = null; | |
Le.prototype.end = function (t, e, r) { | |
var n = this._writableState; | |
typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null); | |
var i; | |
if (t != null) { | |
var s = rp(this, t, e); | |
s instanceof Nv && (i = s); | |
} | |
return n.corked && (n.corked = 1, this.uncork()), i || (!n.errored && !n.ending ? (n.ending = !0, za(this, n, !0), n.ended = !0) : n.finished ? i = new Kv("end") : n.destroyed && (i = new Ni("end"))), typeof r == "function" && (i || n.finished ? pn.nextTick(r, i) : n[Zn].push(r)), this; | |
}; | |
function zo(t) { | |
return t.ending && !t.destroyed && t.constructed && t.length === 0 && !t.errored && t.buffered.length === 0 && !t.finished && !t.writing && !t.errorEmitted && !t.closeEmitted; | |
} | |
function Zv(t, e) { | |
var r = !1; | |
function n(i) { | |
if (r) { | |
Xn(t, i != null ? i : ep()); | |
return; | |
} | |
if (r = !0, e.pendingcb--, i) { | |
var s = e[Zn].splice(0); | |
for (var o = 0; o < s.length; o++) s[o](i); | |
Xn(t, i, e.sync); | |
} else zo(e) && (e.prefinished = !0, t.emit("prefinish"), e.pendingcb++, pn.nextTick(Wa, t, e)); | |
} | |
e.sync = !0, e.pendingcb++; | |
try { | |
t._final(n); | |
} catch (i) { | |
n(i); | |
} | |
e.sync = !1; | |
} | |
function e0(t, e) { | |
!e.prefinished && !e.finalCalled && (typeof t._final == "function" && !e.destroyed ? (e.finalCalled = !0, Zv(t, e)) : (e.prefinished = !0, t.emit("prefinish"))); | |
} | |
function za(t, e, r) { | |
zo(e) && (e0(t, e), e.pendingcb === 0 && (r ? (e.pendingcb++, pn.nextTick(function (n, i) { | |
zo(i) ? Wa(n, i) : i.pendingcb--; | |
}, t, e)) : zo(e) && (e.pendingcb++, Wa(t, e)))); | |
} | |
function Wa(t, e) { | |
e.pendingcb--, e.finished = !0; | |
var r = e[Zn].splice(0); | |
for (var n = 0; n < r.length; n++) r[n](); | |
if (t.emit("finish"), e.autoDestroy) { | |
var _n5 = t._readableState; | |
(!_n5 || _n5.autoDestroy && (_n5.endEmitted || _n5.readable === !1)) && t.destroy(); | |
} | |
} | |
Lv(Le.prototype, { | |
closed: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.closed : !1; | |
} | |
}, | |
destroyed: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.destroyed : !1; | |
}, | |
set: function set(t) { | |
this._writableState && (this._writableState.destroyed = t); | |
} | |
}, | |
writable: { | |
__proto__: null, | |
get: function get() { | |
var t = this._writableState; | |
return !!t && t.writable !== !1 && !t.destroyed && !t.errored && !t.ending && !t.ended; | |
}, | |
set: function set(t) { | |
this._writableState && (this._writableState.writable = !!t); | |
} | |
}, | |
writableFinished: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.finished : !1; | |
} | |
}, | |
writableObjectMode: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.objectMode : !1; | |
} | |
}, | |
writableBuffer: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState && this._writableState.getBuffer(); | |
} | |
}, | |
writableEnded: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.ending : !1; | |
} | |
}, | |
writableNeedDrain: { | |
__proto__: null, | |
get: function get() { | |
var t = this._writableState; | |
return t ? !t.destroyed && !t.ending && t.needDrain : !1; | |
} | |
}, | |
writableHighWaterMark: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState && this._writableState.highWaterMark; | |
} | |
}, | |
writableCorked: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState ? this._writableState.corked : 0; | |
} | |
}, | |
writableLength: { | |
__proto__: null, | |
get: function get() { | |
return this._writableState && this._writableState.length; | |
} | |
}, | |
errored: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return this._writableState ? this._writableState.errored : null; | |
} | |
}, | |
writableAborted: { | |
__proto__: null, | |
enumerable: !1, | |
get: function get() { | |
return !!(this._writableState.writable !== !1 && (this._writableState.destroyed || this._writableState.errored) && !this._writableState.finished); | |
} | |
} | |
}); | |
var t0 = Go.destroy; | |
Le.prototype.destroy = function (t, e) { | |
var r = this._writableState; | |
return !r.destroyed && (r.bufferedIndex < r.buffered.length || r[Zn].length) && pn.nextTick(Ha, r), t0.call(this, t, e), this; | |
}; | |
Le.prototype._undestroy = Go.undestroy; | |
Le.prototype._destroy = function (t, e) { | |
e(t); | |
}; | |
Le.prototype[Fv.captureRejectionSymbol] = function (t) { | |
this.destroy(t); | |
}; | |
var ja; | |
function ip() { | |
return ja === void 0 && (ja = {}), ja; | |
} | |
Le.fromWeb = function (t, e) { | |
return ip().newStreamWritableFromWritableStream(t, e); | |
}; | |
Le.toWeb = function (t) { | |
return ip().newWritableStreamFromStreamWritable(t); | |
}; | |
}); | |
var mp = H(function (nB, _p) { | |
P(); | |
O(); | |
R(); | |
var Ka = Ur(), | |
r0 = (ze(), Ie(Je)), | |
_rr4 = rr(), | |
n0 = _rr4.isReadable, | |
i0 = _rr4.isWritable, | |
sp = _rr4.isIterable, | |
o0 = _rr4.isNodeStream, | |
ap = _rr4.isReadableNodeStream, | |
up = _rr4.isWritableNodeStream, | |
s0 = _rr4.isDuplexNodeStream, | |
lp = _rr4.isReadableStream, | |
fp = _rr4.isWritableStream, | |
cp = Sr(), | |
_ft6 = ft(), | |
wp = _ft6.AbortError, | |
_ft6$codes = _ft6.codes, | |
a0 = _ft6$codes.ERR_INVALID_ARG_TYPE, | |
hp = _ft6$codes.ERR_INVALID_RETURN_VALUE, | |
_hn = hn(), | |
ti = _hn.destroyer, | |
u0 = ir(), | |
bp = ki(), | |
l0 = Qo(), | |
_it5 = it(), | |
dp = _it5.createDeferredPromise, | |
pp = Ca(), | |
yp = globalThis.Blob || r0.Blob, | |
f0 = typeof yp != "undefined" ? function (e) { | |
return e instanceof yp; | |
} : function (e) { | |
return !1; | |
}, | |
c0 = globalThis.AbortController || Hn().AbortController, | |
_Ne13 = Ne(), | |
gp = _Ne13.FunctionPrototypeCall, | |
jr = /*#__PURE__*/function (_u2) { | |
function jr(e) { | |
var _this8; | |
_classCallCheck(this, jr); | |
_this8 = _callSuper(this, jr, [e]), (e == null ? void 0 : e.readable) === !1 && (_this8._readableState.readable = !1, _this8._readableState.ended = !0, _this8._readableState.endEmitted = !0), (e == null ? void 0 : e.writable) === !1 && (_this8._writableState.writable = !1, _this8._writableState.ending = !0, _this8._writableState.ended = !0, _this8._writableState.finished = !0); | |
return _this8; | |
} | |
_inherits(jr, _u2); | |
return _createClass(jr); | |
}(u0); | |
_p.exports = function t(e, r) { | |
if (s0(e)) return e; | |
if (ap(e)) return ei({ | |
readable: e | |
}); | |
if (up(e)) return ei({ | |
writable: e | |
}); | |
if (o0(e)) return ei({ | |
writable: !1, | |
readable: !1 | |
}); | |
if (lp(e)) return ei({ | |
readable: bp.fromWeb(e) | |
}); | |
if (fp(e)) return ei({ | |
writable: l0.fromWeb(e) | |
}); | |
if (typeof e == "function") { | |
var _h2 = h0(e), | |
i = _h2.value, | |
s = _h2.write, | |
o = _h2["final"], | |
a = _h2.destroy; | |
if (sp(i)) return pp(jr, i, { | |
objectMode: !0, | |
write: s, | |
"final": o, | |
destroy: a | |
}); | |
var l = i == null ? void 0 : i.then; | |
if (typeof l == "function") { | |
var c, | |
d = gp(l, i, function (h) { | |
if (h != null) throw new hp("nully", "body", h); | |
}, function (h) { | |
ti(c, h); | |
}); | |
return c = new jr({ | |
objectMode: !0, | |
readable: !1, | |
write: s, | |
"final": function final(h) { | |
var _this9 = this; | |
o(function () { | |
return Ee(_this9, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { | |
return _regeneratorRuntime().wrap(function _callee7$(_context8) { | |
while (1) switch (_context8.prev = _context8.next) { | |
case 0: | |
_context8.prev = 0; | |
_context8.next = 3; | |
return d; | |
case 3: | |
Ka.nextTick(h, null); | |
_context8.next = 9; | |
break; | |
case 6: | |
_context8.prev = 6; | |
_context8.t0 = _context8["catch"](0); | |
Ka.nextTick(h, _context8.t0); | |
case 9: | |
case "end": | |
return _context8.stop(); | |
} | |
}, _callee7, null, [[0, 6]]); | |
})); | |
}); | |
}, | |
destroy: a | |
}); | |
} | |
throw new hp("Iterable, AsyncIterable or AsyncFunction", r, i); | |
} | |
if (f0(e)) return t(e.arrayBuffer()); | |
if (sp(e)) return pp(jr, e, { | |
objectMode: !0, | |
writable: !1 | |
}); | |
if (lp(e == null ? void 0 : e.readable) && fp(e == null ? void 0 : e.writable)) return jr.fromWeb(e); | |
if (_typeof(e == null ? void 0 : e.writable) == "object" || _typeof(e == null ? void 0 : e.readable) == "object") { | |
var _i4 = e != null && e.readable ? ap(e == null ? void 0 : e.readable) ? e == null ? void 0 : e.readable : t(e.readable) : void 0, | |
_s2 = e != null && e.writable ? up(e == null ? void 0 : e.writable) ? e == null ? void 0 : e.writable : t(e.writable) : void 0; | |
return ei({ | |
readable: _i4, | |
writable: _s2 | |
}); | |
} | |
var n = e == null ? void 0 : e.then; | |
if (typeof n == "function") { | |
var _i5; | |
return gp(n, e, function (s) { | |
s != null && _i5.push(s), _i5.push(null); | |
}, function (s) { | |
ti(_i5, s); | |
}), _i5 = new jr({ | |
objectMode: !0, | |
writable: !1, | |
read: function read() {} | |
}); | |
} | |
throw new a0(r, ["Blob", "ReadableStream", "WritableStream", "Stream", "Iterable", "AsyncIterable", "Function", "{ readable, writable } pair", "Promise"], e); | |
}; | |
function h0(t) { | |
var _dp = dp(), | |
e = _dp.promise, | |
r = _dp.resolve, | |
n = new c0(), | |
i = n.signal; | |
return { | |
value: t(function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { | |
var _dp2, o, _yield$et, a, l, c; | |
return _regeneratorRuntime().wrap(function _callee8$(_context9) { | |
while (1) switch (_context9.prev = _context9.next) { | |
case 0: | |
o = e; | |
e = null; | |
_context9.next = 4; | |
return new et(o); | |
case 4: | |
_yield$et = _context9.sent; | |
a = _yield$et.chunk; | |
l = _yield$et.done; | |
c = _yield$et.cb; | |
if (!(Ka.nextTick(c), l)) { | |
_context9.next = 10; | |
break; | |
} | |
return _context9.abrupt("return"); | |
case 10: | |
if (!i.aborted) { | |
_context9.next = 12; | |
break; | |
} | |
throw new wp(void 0, { | |
cause: i.reason | |
}); | |
case 12: | |
_dp2 = dp(), e = _dp2.promise, r = _dp2.resolve; | |
_context9.next = 15; | |
return a; | |
case 15: | |
_context9.next = 0; | |
break; | |
case 17: | |
case "end": | |
return _context9.stop(); | |
} | |
}, _callee8); | |
})); | |
}(), { | |
signal: i | |
}), | |
write: function write(o, a, l) { | |
var c = r; | |
r = null, c({ | |
chunk: o, | |
done: !1, | |
cb: l | |
}); | |
}, | |
"final": function final(o) { | |
var a = r; | |
r = null, a({ | |
done: !0, | |
cb: o | |
}); | |
}, | |
destroy: function destroy(o, a) { | |
n.abort(), a(o); | |
} | |
}; | |
} | |
function ei(t) { | |
var e = t.readable && typeof t.readable.read != "function" ? bp.wrap(t.readable) : t.readable, | |
r = t.writable, | |
n = !!n0(e), | |
i = !!i0(r), | |
s, | |
o, | |
a, | |
l, | |
c; | |
function d(h) { | |
var m = l; | |
l = null, m ? m(h) : h && c.destroy(h); | |
} | |
return c = new jr({ | |
readableObjectMode: !!(e != null && e.readableObjectMode), | |
writableObjectMode: !!(r != null && r.writableObjectMode), | |
readable: n, | |
writable: i | |
}), i && (cp(r, function (h) { | |
i = !1, h && ti(e, h), d(h); | |
}), c._write = function (h, m, w) { | |
r.write(h, m) ? w() : s = w; | |
}, c._final = function (h) { | |
r.end(), o = h; | |
}, r.on("drain", function () { | |
if (s) { | |
var h = s; | |
s = null, h(); | |
} | |
}), r.on("finish", function () { | |
if (o) { | |
var h = o; | |
o = null, h(); | |
} | |
})), n && (cp(e, function (h) { | |
n = !1, h && ti(e, h), d(h); | |
}), e.on("readable", function () { | |
if (a) { | |
var h = a; | |
a = null, h(); | |
} | |
}), e.on("end", function () { | |
c.push(null); | |
}), c._read = function () { | |
for (;;) { | |
var h = e.read(); | |
if (h === null) { | |
a = c._read; | |
return; | |
} | |
if (!c.push(h)) return; | |
} | |
}), c._destroy = function (h, m) { | |
!h && l !== null && (h = new wp()), a = null, s = null, o = null, l === null ? m(h) : (l = m, ti(r, h), ti(e, h)); | |
}, c; | |
} | |
}); | |
var ir = H(function (cB, Ep) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne14 = Ne(), | |
d0 = _Ne14.ObjectDefineProperties, | |
Er = _Ne14.ObjectGetOwnPropertyDescriptor, | |
p0 = _Ne14.ObjectKeys, | |
vp = _Ne14.ObjectSetPrototypeOf; | |
Ep.exports = Ft; | |
var Ya = ki(), | |
Bt = Qo(); | |
vp(Ft.prototype, Ya.prototype); | |
vp(Ft, Ya); | |
{ | |
var t = p0(Bt.prototype); | |
for (var _e4 = 0; _e4 < t.length; _e4++) { | |
var _r4 = t[_e4]; | |
Ft.prototype[_r4] || (Ft.prototype[_r4] = Bt.prototype[_r4]); | |
} | |
} | |
function Ft(t) { | |
if (!(this instanceof Ft)) return new Ft(t); | |
Ya.call(this, t), Bt.call(this, t), t ? (this.allowHalfOpen = t.allowHalfOpen !== !1, t.readable === !1 && (this._readableState.readable = !1, this._readableState.ended = !0, this._readableState.endEmitted = !0), t.writable === !1 && (this._writableState.writable = !1, this._writableState.ending = !0, this._writableState.ended = !0, this._writableState.finished = !0)) : this.allowHalfOpen = !0; | |
} | |
d0(Ft.prototype, { | |
writable: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writable")), | |
writableHighWaterMark: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableHighWaterMark")), | |
writableObjectMode: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableObjectMode")), | |
writableBuffer: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableBuffer")), | |
writableLength: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableLength")), | |
writableFinished: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableFinished")), | |
writableCorked: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableCorked")), | |
writableEnded: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableEnded")), | |
writableNeedDrain: Ue({ | |
__proto__: null | |
}, Er(Bt.prototype, "writableNeedDrain")), | |
destroyed: { | |
__proto__: null, | |
get: function get() { | |
return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed; | |
}, | |
set: function set(t) { | |
this._readableState && this._writableState && (this._readableState.destroyed = t, this._writableState.destroyed = t); | |
} | |
} | |
}); | |
var Ga; | |
function Sp() { | |
return Ga === void 0 && (Ga = {}), Ga; | |
} | |
Ft.fromWeb = function (t, e) { | |
return Sp().newStreamDuplexFromReadableWritablePair(t, e); | |
}; | |
Ft.toWeb = function (t) { | |
return Sp().newReadableWritablePairFromDuplex(t); | |
}; | |
var Qa; | |
Ft.from = function (t) { | |
return Qa || (Qa = mp()), Qa(t, "body"); | |
}; | |
}); | |
var Za = H(function (_B, Ip) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne15 = Ne(), | |
Ap = _Ne15.ObjectSetPrototypeOf, | |
y0 = _Ne15.Symbol; | |
Ip.exports = Ar; | |
var g0 = ft().codes.ERR_METHOD_NOT_IMPLEMENTED, | |
Xa = ir(), | |
_xi3 = xi(), | |
w0 = _xi3.getHighWaterMark; | |
Ap(Ar.prototype, Xa.prototype); | |
Ap(Ar, Xa); | |
var qi = y0("kCallback"); | |
function Ar(t) { | |
if (!(this instanceof Ar)) return new Ar(t); | |
var e = t ? w0(this, t, "readableHighWaterMark", !0) : null; | |
e === 0 && (t = Xt(Ue({}, t), { | |
highWaterMark: null, | |
readableHighWaterMark: e, | |
writableHighWaterMark: t.writableHighWaterMark || 0 | |
})), Xa.call(this, t), this._readableState.sync = !1, this[qi] = null, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.on("prefinish", b0); | |
} | |
function Ja(t) { | |
var _this10 = this; | |
typeof this._flush == "function" && !this.destroyed ? this._flush(function (e, r) { | |
if (e) { | |
t ? t(e) : _this10.destroy(e); | |
return; | |
} | |
r != null && _this10.push(r), _this10.push(null), t && t(); | |
}) : (this.push(null), t && t()); | |
} | |
function b0() { | |
this._final !== Ja && Ja.call(this); | |
} | |
Ar.prototype._final = Ja; | |
Ar.prototype._transform = function (t, e, r) { | |
throw new g0("_transform()"); | |
}; | |
Ar.prototype._write = function (t, e, r) { | |
var _this11 = this; | |
var n = this._readableState, | |
i = this._writableState, | |
s = n.length; | |
this._transform(t, e, function (o, a) { | |
if (o) { | |
r(o); | |
return; | |
} | |
a != null && _this11.push(a), i.ended || s === n.length || n.length < n.highWaterMark ? r() : _this11[qi] = r; | |
}); | |
}; | |
Ar.prototype._read = function () { | |
if (this[qi]) { | |
var t = this[qi]; | |
this[qi] = null, t(); | |
} | |
}; | |
}); | |
var tu = H(function (PB, Pp) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne16 = Ne(), | |
Tp = _Ne16.ObjectSetPrototypeOf; | |
Pp.exports = ri; | |
var eu = Za(); | |
Tp(ri.prototype, eu.prototype); | |
Tp(ri, eu); | |
function ri(t) { | |
if (!(this instanceof ri)) return new ri(t); | |
eu.call(this, t); | |
} | |
ri.prototype._transform = function (t, e, r) { | |
r(null, t); | |
}; | |
}); | |
var Zo = H(function (MB, Cp) { | |
P(); | |
O(); | |
R(); | |
var Ui = Ur(), | |
_Ne17 = Ne(), | |
_0 = _Ne17.ArrayIsArray, | |
m0 = _Ne17.Promise, | |
v0 = _Ne17.SymbolAsyncIterator, | |
S0 = _Ne17.SymbolDispose, | |
Xo = Sr(), | |
_it6 = it(), | |
E0 = _it6.once, | |
A0 = hn(), | |
Rp = ir(), | |
_ft7 = ft(), | |
I0 = _ft7.aggregateTwoErrors, | |
_ft7$codes = _ft7.codes, | |
fu = _ft7$codes.ERR_INVALID_ARG_TYPE, | |
ru = _ft7$codes.ERR_INVALID_RETURN_VALUE, | |
T0 = _ft7$codes.ERR_MISSING_ARGS, | |
P0 = _ft7$codes.ERR_STREAM_DESTROYED, | |
R0 = _ft7$codes.ERR_STREAM_PREMATURE_CLOSE, | |
O0 = _ft7.AbortError, | |
_zn4 = zn(), | |
x0 = _zn4.validateFunction, | |
B0 = _zn4.validateAbortSignal, | |
_rr5 = rr(), | |
yn = _rr5.isIterable, | |
nu = _rr5.isReadable, | |
Jo = _rr5.isReadableNodeStream, | |
Op = _rr5.isNodeStream, | |
ni = _rr5.isTransformStream, | |
C0 = _rr5.isWebStream, | |
iu = _rr5.isReadableStream, | |
k0 = _rr5.isReadableFinished, | |
M0 = globalThis.AbortController || Hn().AbortController, | |
ou, | |
su, | |
au; | |
function xp(t, e, r) { | |
var n = !1; | |
t.on("close", function () { | |
n = !0; | |
}); | |
var i = Xo(t, { | |
readable: e, | |
writable: r | |
}, function (s) { | |
n = !s; | |
}); | |
return { | |
destroy: function destroy(s) { | |
n || (n = !0, A0.destroyer(t, s || new P0("pipe"))); | |
}, | |
cleanup: i | |
}; | |
} | |
function N0(t) { | |
return x0(t[t.length - 1], "streams[stream.length - 1]"), t.pop(); | |
} | |
function uu(t) { | |
if (yn(t)) return t; | |
if (Jo(t)) return L0(t); | |
throw new fu("val", ["Readable", "Iterable", "AsyncIterable"], t); | |
} | |
function L0(t) { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() { | |
return _regeneratorRuntime().wrap(function _callee9$(_context10) { | |
while (1) switch (_context10.prev = _context10.next) { | |
case 0: | |
su || (su = ki()); | |
return _context10.delegateYield(Ot(su.prototype[v0].call(t)), "t0", 2); | |
case 2: | |
case "end": | |
return _context10.stop(); | |
} | |
}, _callee9); | |
})); | |
} | |
function Yo(i, s, o, a) { | |
return Ee(this, arguments, function (t, e, r, _ref14) { | |
var n = _ref14.end; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() { | |
var l, c, d, h, m, w, T, v, b, p; | |
return _regeneratorRuntime().wrap(function _callee10$(_context11) { | |
while (1) switch (_context11.prev = _context11.next) { | |
case 0: | |
c = null, d = function d(p) { | |
if (p && (l = p), c) { | |
var _ = c; | |
c = null, _(); | |
} | |
}, h = function h() { | |
return new m0(function (p, _) { | |
l ? _(l) : c = function c() { | |
l ? _(l) : p(); | |
}; | |
}); | |
}; | |
e.on("drain", d); | |
m = Xo(e, { | |
readable: !1 | |
}, d); | |
_context11.prev = 3; | |
_context11.t0 = e.writableNeedDrain; | |
if (!_context11.t0) { | |
_context11.next = 8; | |
break; | |
} | |
_context11.next = 8; | |
return h(); | |
case 8: | |
_context11.prev = 8; | |
w = gt(t); | |
case 10: | |
_context11.next = 12; | |
return w.next(); | |
case 12: | |
if (!(T = !(v = _context11.sent).done)) { | |
_context11.next = 21; | |
break; | |
} | |
p = v.value; | |
_context11.t1 = e.write(p); | |
if (_context11.t1) { | |
_context11.next = 18; | |
break; | |
} | |
_context11.next = 18; | |
return h(); | |
case 18: | |
T = !1; | |
_context11.next = 10; | |
break; | |
case 21: | |
_context11.next = 26; | |
break; | |
case 23: | |
_context11.prev = 23; | |
_context11.t2 = _context11["catch"](8); | |
b = [_context11.t2]; | |
case 26: | |
_context11.prev = 26; | |
_context11.prev = 27; | |
_context11.t3 = T && (v = w["return"]); | |
if (!_context11.t3) { | |
_context11.next = 32; | |
break; | |
} | |
_context11.next = 32; | |
return v.call(w); | |
case 32: | |
_context11.prev = 32; | |
if (!b) { | |
_context11.next = 35; | |
break; | |
} | |
throw b[0]; | |
case 35: | |
return _context11.finish(32); | |
case 36: | |
return _context11.finish(26); | |
case 37: | |
_context11.t4 = n; | |
if (!_context11.t4) { | |
_context11.next = 42; | |
break; | |
} | |
e.end(); | |
_context11.next = 42; | |
return h(); | |
case 42: | |
r(); | |
_context11.next = 48; | |
break; | |
case 45: | |
_context11.prev = 45; | |
_context11.t5 = _context11["catch"](3); | |
r(l !== _context11.t5 ? I0(l, _context11.t5) : _context11.t5); | |
case 48: | |
_context11.prev = 48; | |
m(), e.off("drain", d); | |
return _context11.finish(48); | |
case 51: | |
case "end": | |
return _context11.stop(); | |
} | |
}, _callee10, null, [[3, 45, 48, 51], [8, 23, 26, 37], [27,, 32, 36]]); | |
})(); | |
}); | |
} | |
function lu(i, s, o, a) { | |
return Ee(this, arguments, function (t, e, r, _ref15) { | |
var n = _ref15.end; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() { | |
var l, c, d, h, m, w; | |
return _regeneratorRuntime().wrap(function _callee11$(_context12) { | |
while (1) switch (_context12.prev = _context12.next) { | |
case 0: | |
ni(e) && (e = e.writable); | |
l = e.getWriter(); | |
_context12.prev = 2; | |
_context12.prev = 3; | |
c = gt(t); | |
case 5: | |
_context12.next = 7; | |
return c.next(); | |
case 7: | |
if (!(d = !(h = _context12.sent).done)) { | |
_context12.next = 15; | |
break; | |
} | |
w = h.value; | |
_context12.next = 11; | |
return l.ready; | |
case 11: | |
l.write(w)["catch"](function () {}); | |
case 12: | |
d = !1; | |
_context12.next = 5; | |
break; | |
case 15: | |
_context12.next = 20; | |
break; | |
case 17: | |
_context12.prev = 17; | |
_context12.t0 = _context12["catch"](3); | |
m = [_context12.t0]; | |
case 20: | |
_context12.prev = 20; | |
_context12.prev = 21; | |
_context12.t1 = d && (h = c["return"]); | |
if (!_context12.t1) { | |
_context12.next = 26; | |
break; | |
} | |
_context12.next = 26; | |
return h.call(c); | |
case 26: | |
_context12.prev = 26; | |
if (!m) { | |
_context12.next = 29; | |
break; | |
} | |
throw m[0]; | |
case 29: | |
return _context12.finish(26); | |
case 30: | |
return _context12.finish(20); | |
case 31: | |
_context12.next = 33; | |
return l.ready; | |
case 33: | |
_context12.t2 = n; | |
if (!_context12.t2) { | |
_context12.next = 37; | |
break; | |
} | |
_context12.next = 37; | |
return l.close(); | |
case 37: | |
r(); | |
_context12.next = 51; | |
break; | |
case 40: | |
_context12.prev = 40; | |
_context12.t3 = _context12["catch"](2); | |
_context12.prev = 42; | |
_context12.next = 45; | |
return l.abort(_context12.t3); | |
case 45: | |
r(_context12.t3); | |
_context12.next = 51; | |
break; | |
case 48: | |
_context12.prev = 48; | |
_context12.t4 = _context12["catch"](42); | |
r(_context12.t4); | |
case 51: | |
case "end": | |
return _context12.stop(); | |
} | |
}, _callee11, null, [[2, 40], [3, 17, 20, 31], [21,, 26, 30], [42, 48]]); | |
})(); | |
}); | |
} | |
function q0() { | |
for (var _len13 = arguments.length, t = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) { | |
t[_key13] = arguments[_key13]; | |
} | |
return Bp(t, E0(N0(t))); | |
} | |
function Bp(t, e, r) { | |
if (t.length === 1 && _0(t[0]) && (t = t[0]), t.length < 2) throw new T0("streams"); | |
var n = new M0(), | |
i = n.signal, | |
s = r == null ? void 0 : r.signal, | |
o = []; | |
B0(s, "options.signal"); | |
function a() { | |
T(new O0()); | |
} | |
au = au || it().addAbortListener; | |
var l; | |
s && (l = au(s, a)); | |
var c, | |
d, | |
h = [], | |
m = 0; | |
function w(x) { | |
T(x, --m === 0); | |
} | |
function T(x, I) { | |
var y; | |
if (x && (!c || c.code === "ERR_STREAM_PREMATURE_CLOSE") && (c = x), !(!c && !I)) { | |
for (; h.length;) h.shift()(c); | |
(y = l) === null || y === void 0 || y[S0](), n.abort(), I && (c || o.forEach(function (B) { | |
return B(); | |
}), Ui.nextTick(e, c, d)); | |
} | |
} | |
var v; | |
var _loop2 = function _loop2() { | |
var I = t[x], | |
y = x < t.length - 1, | |
B = x > 0, | |
A = y || (r == null ? void 0 : r.end) !== !1, | |
q = x === t.length - 1; | |
if (Op(I)) { | |
var $ = function $(F) { | |
F && F.name !== "AbortError" && F.code !== "ERR_STREAM_PREMATURE_CLOSE" && w(F); | |
}; | |
_ = $; | |
if (A) { | |
var _xp = xp(I, y, B), | |
F = _xp.destroy, | |
Z = _xp.cleanup; | |
h.push(F), nu(I) && q && o.push(Z); | |
} | |
I.on("error", $), nu(I) && q && o.push(function () { | |
I.removeListener("error", $); | |
}); | |
} | |
if (x === 0) { | |
if (typeof I == "function") { | |
if (v = I({ | |
signal: i | |
}), !yn(v)) throw new ru("Iterable, AsyncIterable or Stream", "source", v); | |
} else yn(I) || Jo(I) || ni(I) ? v = I : v = Rp.from(I); | |
} else if (typeof I == "function") { | |
if (ni(v)) { | |
v = uu((b = v) === null || b === void 0 ? void 0 : b.readable); | |
} else v = uu(v); | |
if (v = I(v, { | |
signal: i | |
}), y) { | |
if (!yn(v, !0)) throw new ru("AsyncIterable", "transform[".concat(x - 1, "]"), v); | |
} else { | |
ou || (ou = tu()); | |
var _$ = new ou({ | |
objectMode: !0 | |
}), | |
_F = (p = v) === null || p === void 0 ? void 0 : p.then; | |
if (typeof _F == "function") m++, _F.call(v, function (V) { | |
d = V, V != null && _$.write(V), A && _$.end(), Ui.nextTick(w); | |
}, function (V) { | |
_$.destroy(V), Ui.nextTick(w, V); | |
});else if (yn(v, !0)) m++, Yo(v, _$, w, { | |
end: A | |
});else if (iu(v) || ni(v)) { | |
var V = v.readable || v; | |
m++, Yo(V, _$, w, { | |
end: A | |
}); | |
} else throw new ru("AsyncIterable or Promise", "destination", v); | |
v = _$; | |
var _xp2 = xp(v, !1, !0), | |
_Z = _xp2.destroy, | |
j = _xp2.cleanup; | |
h.push(_Z), q && o.push(j); | |
} | |
} else if (Op(I)) { | |
if (Jo(v)) { | |
m += 2; | |
var _$2 = U0(v, I, w, { | |
end: A | |
}); | |
nu(I) && q && o.push(_$2); | |
} else if (ni(v) || iu(v)) { | |
var _$3 = v.readable || v; | |
m++, Yo(_$3, I, w, { | |
end: A | |
}); | |
} else if (yn(v)) m++, Yo(v, I, w, { | |
end: A | |
});else throw new fu("val", ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], v); | |
v = I; | |
} else if (C0(I)) { | |
if (Jo(v)) m++, lu(uu(v), I, w, { | |
end: A | |
});else if (iu(v) || yn(v)) m++, lu(v, I, w, { | |
end: A | |
});else if (ni(v)) m++, lu(v.readable, I, w, { | |
end: A | |
});else throw new fu("val", ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], v); | |
v = I; | |
} else v = Rp.from(I); | |
}, | |
_, | |
b, | |
p; | |
for (var x = 0; x < t.length; x++) { | |
_loop2(); | |
} | |
return (i != null && i.aborted || s != null && s.aborted) && Ui.nextTick(a), v; | |
} | |
function U0(t, e, r, _ref16) { | |
var n = _ref16.end; | |
var i = !1; | |
if (e.on("close", function () { | |
i || r(new R0()); | |
}), t.pipe(e, { | |
end: !1 | |
}), n) { | |
var o = function o() { | |
i = !0, e.end(); | |
}; | |
var s = o; | |
k0(t) ? Ui.nextTick(o) : t.once("end", o); | |
} else r(); | |
return Xo(t, { | |
readable: !0, | |
writable: !1 | |
}, function (o) { | |
var a = t._readableState; | |
o && o.code === "ERR_STREAM_PREMATURE_CLOSE" && a && a.ended && !a.errored && !a.errorEmitted ? t.once("end", r).once("error", r) : r(o); | |
}), Xo(e, { | |
readable: !1, | |
writable: !0 | |
}, r); | |
} | |
Cp.exports = { | |
pipelineImpl: Bp, | |
pipeline: q0 | |
}; | |
}); | |
var hu = H(function (WB, Up) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Zo = Zo(), | |
D0 = _Zo.pipeline, | |
es = ir(), | |
_hn2 = hn(), | |
F0 = _hn2.destroyer, | |
_rr6 = rr(), | |
ts = _rr6.isNodeStream, | |
kp = _rr6.isReadable, | |
Mp = _rr6.isWritable, | |
cu = _rr6.isWebStream, | |
gn = _rr6.isTransformStream, | |
Np = _rr6.isWritableStream, | |
Lp = _rr6.isReadableStream, | |
_ft8 = ft(), | |
j0 = _ft8.AbortError, | |
_ft8$codes = _ft8.codes, | |
qp = _ft8$codes.ERR_INVALID_ARG_VALUE, | |
W0 = _ft8$codes.ERR_MISSING_ARGS, | |
$0 = Sr(); | |
Up.exports = function () { | |
for (var _len14 = arguments.length, e = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) { | |
e[_key14] = arguments[_key14]; | |
} | |
if (e.length === 0) throw new W0("streams"); | |
if (e.length === 1) return es.from(e[0]); | |
var r = [].concat(e); | |
if (typeof e[0] == "function" && (e[0] = es.from(e[0])), typeof e[e.length - 1] == "function") { | |
var w = e.length - 1; | |
e[w] = es.from(e[w]); | |
} | |
for (var _w2 = 0; _w2 < e.length; ++_w2) if (!(!ts(e[_w2]) && !cu(e[_w2]))) { | |
if (_w2 < e.length - 1 && !(kp(e[_w2]) || Lp(e[_w2]) || gn(e[_w2]))) throw new qp("streams[".concat(_w2, "]"), r[_w2], "must be readable"); | |
if (_w2 > 0 && !(Mp(e[_w2]) || Np(e[_w2]) || gn(e[_w2]))) throw new qp("streams[".concat(_w2, "]"), r[_w2], "must be writable"); | |
} | |
var n, i, s, o, a; | |
function l(w) { | |
var T = o; | |
o = null, T ? T(w) : w ? a.destroy(w) : !m && !h && a.destroy(); | |
} | |
var c = e[0], | |
d = D0(e, l), | |
h = !!(Mp(c) || Np(c) || gn(c)), | |
m = !!(kp(d) || Lp(d) || gn(d)); | |
if (a = new es({ | |
writableObjectMode: !!(c != null && c.writableObjectMode), | |
readableObjectMode: !!(d != null && d.readableObjectMode), | |
writable: h, | |
readable: m | |
}), h) { | |
if (ts(c)) a._write = function (T, v, b) { | |
c.write(T, v) ? b() : n = b; | |
}, a._final = function (T) { | |
c.end(), i = T; | |
}, c.on("drain", function () { | |
if (n) { | |
var T = n; | |
n = null, T(); | |
} | |
});else if (cu(c)) { | |
var v = (gn(c) ? c.writable : c).getWriter(); | |
a._write = function (b, p, _) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() { | |
return _regeneratorRuntime().wrap(function _callee12$(_context13) { | |
while (1) switch (_context13.prev = _context13.next) { | |
case 0: | |
_context13.prev = 0; | |
_context13.next = 3; | |
return v.ready; | |
case 3: | |
v.write(b)["catch"](function () {}); | |
_(); | |
_context13.next = 10; | |
break; | |
case 7: | |
_context13.prev = 7; | |
_context13.t0 = _context13["catch"](0); | |
_(_context13.t0); | |
case 10: | |
case "end": | |
return _context13.stop(); | |
} | |
}, _callee12, null, [[0, 7]]); | |
})); | |
}, a._final = function (b) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() { | |
return _regeneratorRuntime().wrap(function _callee13$(_context14) { | |
while (1) switch (_context14.prev = _context14.next) { | |
case 0: | |
_context14.prev = 0; | |
_context14.next = 3; | |
return v.ready; | |
case 3: | |
v.close()["catch"](function () {}); | |
i = b; | |
_context14.next = 10; | |
break; | |
case 7: | |
_context14.prev = 7; | |
_context14.t0 = _context14["catch"](0); | |
b(_context14.t0); | |
case 10: | |
case "end": | |
return _context14.stop(); | |
} | |
}, _callee13, null, [[0, 7]]); | |
})); | |
}; | |
} | |
var _w3 = gn(d) ? d.readable : d; | |
$0(_w3, function () { | |
if (i) { | |
var T = i; | |
i = null, T(); | |
} | |
}); | |
} | |
if (m) { | |
if (ts(d)) d.on("readable", function () { | |
if (s) { | |
var _w4 = s; | |
s = null, _w4(); | |
} | |
}), d.on("end", function () { | |
a.push(null); | |
}), a._read = function () { | |
for (;;) { | |
var _w5 = d.read(); | |
if (_w5 === null) { | |
s = a._read; | |
return; | |
} | |
if (!a.push(_w5)) return; | |
} | |
};else if (cu(d)) { | |
var T = (gn(d) ? d.readable : d).getReader(); | |
a._read = function () { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() { | |
var _yield$T$read, _v2, _b2; | |
return _regeneratorRuntime().wrap(function _callee14$(_context15) { | |
while (1) switch (_context15.prev = _context15.next) { | |
case 0: | |
_context15.prev = 0; | |
_context15.next = 3; | |
return T.read(); | |
case 3: | |
_yield$T$read = _context15.sent; | |
_v2 = _yield$T$read.value; | |
_b2 = _yield$T$read.done; | |
if (a.push(_v2)) { | |
_context15.next = 8; | |
break; | |
} | |
return _context15.abrupt("return"); | |
case 8: | |
if (!_b2) { | |
_context15.next = 11; | |
break; | |
} | |
a.push(null); | |
return _context15.abrupt("return"); | |
case 11: | |
_context15.next = 16; | |
break; | |
case 13: | |
_context15.prev = 13; | |
_context15.t0 = _context15["catch"](0); | |
return _context15.abrupt("return"); | |
case 16: | |
_context15.next = 0; | |
break; | |
case 18: | |
case "end": | |
return _context15.stop(); | |
} | |
}, _callee14, null, [[0, 13]]); | |
})); | |
}; | |
} | |
} | |
return a._destroy = function (w, T) { | |
!w && o !== null && (w = new j0()), s = null, n = null, i = null, o === null ? T(w) : (o = T, ts(d) && F0(d, w)); | |
}, a; | |
}; | |
}); | |
var Gp = H(function (YB, yu) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var H0 = globalThis.AbortController || Hn().AbortController, | |
_ft9 = ft(), | |
_ft9$codes = _ft9.codes, | |
V0 = _ft9$codes.ERR_INVALID_ARG_VALUE, | |
Di = _ft9$codes.ERR_INVALID_ARG_TYPE, | |
z0 = _ft9$codes.ERR_MISSING_ARGS, | |
K0 = _ft9$codes.ERR_OUT_OF_RANGE, | |
or = _ft9.AbortError, | |
_zn5 = zn(), | |
wn = _zn5.validateAbortSignal, | |
Dp = _zn5.validateInteger, | |
bn = _zn5.validateObject, | |
G0 = Ne().Symbol("kWeak"), | |
Q0 = Ne().Symbol("kResistStopPropagation"), | |
_Sr = Sr(), | |
Y0 = _Sr.finished, | |
J0 = hu(), | |
_Oi3 = Oi(), | |
X0 = _Oi3.addAbortSignalNoValidate, | |
_rr7 = rr(), | |
Z0 = _rr7.isWritable, | |
eS = _rr7.isNodeStream, | |
_it7 = it(), | |
tS = _it7.deprecate, | |
_Ne18 = Ne(), | |
rS = _Ne18.ArrayPrototypePush, | |
nS = _Ne18.Boolean, | |
Fp = _Ne18.MathFloor, | |
iS = _Ne18.Number, | |
oS = _Ne18.NumberIsNaN, | |
jp = _Ne18.Promise, | |
Wp = _Ne18.PromiseReject, | |
sS = _Ne18.PromiseResolve, | |
$p = _Ne18.PromisePrototypeThen, | |
Vp = _Ne18.Symbol, | |
rs = Vp("kEmpty"), | |
Hp = Vp("kEof"); | |
function aS(t, e) { | |
if (e != null && bn(e, "options"), (e == null ? void 0 : e.signal) != null && wn(e.signal, "options.signal"), eS(t) && !Z0(t)) throw new V0("stream", t, "must be writable"); | |
var r = J0(this, t); | |
return e != null && e.signal && X0(e.signal, r), r; | |
} | |
function ns(t, e) { | |
if (typeof t != "function") throw new Di("fn", ["Function", "AsyncFunction"], t); | |
e != null && bn(e, "options"), (e == null ? void 0 : e.signal) != null && wn(e.signal, "options.signal"); | |
var r = 1; | |
(e == null ? void 0 : e.concurrency) != null && (r = Fp(e.concurrency)); | |
var n = r - 1; | |
return (e == null ? void 0 : e.highWaterMark) != null && (n = Fp(e.highWaterMark)), Dp(r, "options.concurrency", 1), Dp(n, "options.highWaterMark", 0), n += r, function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() { | |
var s, o, a, l, c, d, h, m, w, T, v, b, _p2; | |
return _regeneratorRuntime().wrap(function _callee16$(_context17) { | |
while (1) switch (_context17.prev = _context17.next) { | |
case 0: | |
b = function _b3() { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() { | |
var p, _, x, I, y, B; | |
return _regeneratorRuntime().wrap(function _callee15$(_context16) { | |
while (1) switch (_context16.prev = _context16.next) { | |
case 0: | |
_context16.prev = 0; | |
_context16.prev = 1; | |
p = gt(o); | |
case 3: | |
_context16.next = 5; | |
return p.next(); | |
case 5: | |
if (!(_ = !(x = _context16.sent).done)) { | |
_context16.next = 31; | |
break; | |
} | |
y = x.value; | |
if (!h) { | |
_context16.next = 9; | |
break; | |
} | |
return _context16.abrupt("return"); | |
case 9: | |
if (!s.aborted) { | |
_context16.next = 11; | |
break; | |
} | |
throw new or(); | |
case 11: | |
_context16.prev = 11; | |
if (!(y = t(y, l), y === rs)) { | |
_context16.next = 14; | |
break; | |
} | |
return _context16.abrupt("continue", 28); | |
case 14: | |
y = sS(y); | |
_context16.next = 20; | |
break; | |
case 17: | |
_context16.prev = 17; | |
_context16.t0 = _context16["catch"](11); | |
y = Wp(_context16.t0); | |
case 20: | |
m += 1; | |
$p(y, T, w); | |
a.push(y); | |
c && (c(), c = null); | |
_context16.t1 = !h && (a.length >= n || m >= r); | |
if (!_context16.t1) { | |
_context16.next = 28; | |
break; | |
} | |
_context16.next = 28; | |
return new jp(function (B) { | |
d = B; | |
}); | |
case 28: | |
_ = !1; | |
_context16.next = 3; | |
break; | |
case 31: | |
_context16.next = 36; | |
break; | |
case 33: | |
_context16.prev = 33; | |
_context16.t2 = _context16["catch"](1); | |
I = [_context16.t2]; | |
case 36: | |
_context16.prev = 36; | |
_context16.prev = 37; | |
_context16.t3 = _ && (x = p["return"]); | |
if (!_context16.t3) { | |
_context16.next = 42; | |
break; | |
} | |
_context16.next = 42; | |
return x.call(p); | |
case 42: | |
_context16.prev = 42; | |
if (!I) { | |
_context16.next = 45; | |
break; | |
} | |
throw I[0]; | |
case 45: | |
return _context16.finish(42); | |
case 46: | |
return _context16.finish(36); | |
case 47: | |
a.push(Hp); | |
_context16.next = 54; | |
break; | |
case 50: | |
_context16.prev = 50; | |
_context16.t4 = _context16["catch"](0); | |
B = Wp(_context16.t4); | |
$p(B, T, w), a.push(B); | |
case 54: | |
_context16.prev = 54; | |
h = !0, c && (c(), c = null); | |
return _context16.finish(54); | |
case 57: | |
case "end": | |
return _context16.stop(); | |
} | |
}, _callee15, null, [[0, 50, 54, 57], [1, 33, 36, 47], [11, 17], [37,, 42, 46]]); | |
})); | |
}; | |
v = function _v3() { | |
d && !h && m < r && a.length < n && (d(), d = null); | |
}; | |
T = function _T2() { | |
m -= 1, v(); | |
}; | |
w = function _w6() { | |
h = !0, T(); | |
}; | |
s = it().AbortSignalAny([e == null ? void 0 : e.signal].filter(nS)), o = this, a = [], l = { | |
signal: s | |
}, h = !1, m = 0; | |
b(); | |
_context17.prev = 6; | |
case 7: | |
if (!(a.length > 0)) { | |
_context17.next = 23; | |
break; | |
} | |
_context17.next = 10; | |
return new et(a[0]); | |
case 10: | |
_p2 = _context17.sent; | |
if (!(_p2 === Hp)) { | |
_context17.next = 13; | |
break; | |
} | |
return _context17.abrupt("return"); | |
case 13: | |
if (!s.aborted) { | |
_context17.next = 15; | |
break; | |
} | |
throw new or(); | |
case 15: | |
_context17.t0 = _p2 !== rs; | |
if (!_context17.t0) { | |
_context17.next = 19; | |
break; | |
} | |
_context17.next = 19; | |
return _p2; | |
case 19: | |
a.shift(); | |
v(); | |
case 21: | |
_context17.next = 7; | |
break; | |
case 23: | |
_context17.next = 25; | |
return new et(new jp(function (p) { | |
c = p; | |
})); | |
case 25: | |
_context17.next = 7; | |
break; | |
case 27: | |
_context17.prev = 27; | |
h = !0, d && (d(), d = null); | |
return _context17.finish(27); | |
case 30: | |
case "end": | |
return _context17.stop(); | |
} | |
}, _callee16, this, [[6,, 27, 30]]); | |
})); | |
}.call(this); | |
} | |
function uS() { | |
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : void 0; | |
return t != null && bn(t, "options"), (t == null ? void 0 : t.signal) != null && wn(t.signal, "options.signal"), function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() { | |
var r, i, s, o, a, _l9, n; | |
return _regeneratorRuntime().wrap(function _callee17$(_context18) { | |
while (1) switch (_context18.prev = _context18.next) { | |
case 0: | |
r = 0; | |
_context18.prev = 1; | |
i = gt(this); | |
case 3: | |
_context18.next = 5; | |
return new et(i.next()); | |
case 5: | |
if (!(s = !(o = _context18.sent).done)) { | |
_context18.next = 14; | |
break; | |
} | |
_l9 = o.value; | |
if (!(t != null && (n = t.signal) !== null && n !== void 0 && n.aborted)) { | |
_context18.next = 9; | |
break; | |
} | |
throw new or({ | |
cause: t.signal.reason | |
}); | |
case 9: | |
_context18.next = 11; | |
return [r++, _l9]; | |
case 11: | |
s = !1; | |
_context18.next = 3; | |
break; | |
case 14: | |
_context18.next = 19; | |
break; | |
case 16: | |
_context18.prev = 16; | |
_context18.t0 = _context18["catch"](1); | |
a = [_context18.t0]; | |
case 19: | |
_context18.prev = 19; | |
_context18.prev = 20; | |
_context18.t1 = s && (o = i["return"]); | |
if (!_context18.t1) { | |
_context18.next = 25; | |
break; | |
} | |
_context18.next = 25; | |
return new et(o.call(i)); | |
case 25: | |
_context18.prev = 25; | |
if (!a) { | |
_context18.next = 28; | |
break; | |
} | |
throw a[0]; | |
case 28: | |
return _context18.finish(25); | |
case 29: | |
return _context18.finish(19); | |
case 30: | |
case "end": | |
return _context18.stop(); | |
} | |
}, _callee17, this, [[1, 16, 19, 30], [20,, 25, 29]]); | |
})); | |
}.call(this); | |
} | |
function zp(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0; | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() { | |
var r, n, i, s, _o3; | |
return _regeneratorRuntime().wrap(function _callee18$(_context19) { | |
while (1) switch (_context19.prev = _context19.next) { | |
case 0: | |
_context19.prev = 0; | |
r = gt(pu.call(this, t, e)); | |
case 2: | |
_context19.next = 4; | |
return r.next(); | |
case 4: | |
if (!(n = !(i = _context19.sent).done)) { | |
_context19.next = 10; | |
break; | |
} | |
_o3 = i.value; | |
return _context19.abrupt("return", !0); | |
case 7: | |
n = !1; | |
_context19.next = 2; | |
break; | |
case 10: | |
_context19.next = 15; | |
break; | |
case 12: | |
_context19.prev = 12; | |
_context19.t0 = _context19["catch"](0); | |
s = [_context19.t0]; | |
case 15: | |
_context19.prev = 15; | |
_context19.prev = 16; | |
_context19.t1 = n && (i = r["return"]); | |
if (!_context19.t1) { | |
_context19.next = 21; | |
break; | |
} | |
_context19.next = 21; | |
return i.call(r); | |
case 21: | |
_context19.prev = 21; | |
if (!s) { | |
_context19.next = 24; | |
break; | |
} | |
throw s[0]; | |
case 24: | |
return _context19.finish(21); | |
case 25: | |
return _context19.finish(15); | |
case 26: | |
return _context19.abrupt("return", !1); | |
case 27: | |
case "end": | |
return _context19.stop(); | |
} | |
}, _callee18, this, [[0, 12, 15, 26], [16,, 21, 25]]); | |
})); | |
} | |
function lS(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0; | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() { | |
var _this12 = this; | |
return _regeneratorRuntime().wrap(function _callee20$(_context21) { | |
while (1) switch (_context21.prev = _context21.next) { | |
case 0: | |
if (!(typeof t != "function")) { | |
_context21.next = 2; | |
break; | |
} | |
throw new Di("fn", ["Function", "AsyncFunction"], t); | |
case 2: | |
_context21.next = 4; | |
return zp.call(this, function () { | |
for (var _len15 = arguments.length, r = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) { | |
r[_key15] = arguments[_key15]; | |
} | |
return Ee(_this12, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() { | |
return _regeneratorRuntime().wrap(function _callee19$(_context20) { | |
while (1) switch (_context20.prev = _context20.next) { | |
case 0: | |
_context20.next = 2; | |
return t.apply(void 0, r); | |
case 2: | |
return _context20.abrupt("return", !_context20.sent); | |
case 3: | |
case "end": | |
return _context20.stop(); | |
} | |
}, _callee19); | |
})); | |
}, e); | |
case 4: | |
return _context21.abrupt("return", !_context21.sent); | |
case 5: | |
case "end": | |
return _context21.stop(); | |
} | |
}, _callee20, this); | |
})); | |
} | |
function fS(t, e) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() { | |
var r, n, i, s, _o4; | |
return _regeneratorRuntime().wrap(function _callee21$(_context22) { | |
while (1) switch (_context22.prev = _context22.next) { | |
case 0: | |
_context22.prev = 0; | |
r = gt(pu.call(this, t, e)); | |
case 2: | |
_context22.next = 4; | |
return r.next(); | |
case 4: | |
if (!(n = !(i = _context22.sent).done)) { | |
_context22.next = 10; | |
break; | |
} | |
_o4 = i.value; | |
return _context22.abrupt("return", _o4); | |
case 7: | |
n = !1; | |
_context22.next = 2; | |
break; | |
case 10: | |
_context22.next = 15; | |
break; | |
case 12: | |
_context22.prev = 12; | |
_context22.t0 = _context22["catch"](0); | |
s = [_context22.t0]; | |
case 15: | |
_context22.prev = 15; | |
_context22.prev = 16; | |
_context22.t1 = n && (i = r["return"]); | |
if (!_context22.t1) { | |
_context22.next = 21; | |
break; | |
} | |
_context22.next = 21; | |
return i.call(r); | |
case 21: | |
_context22.prev = 21; | |
if (!s) { | |
_context22.next = 24; | |
break; | |
} | |
throw s[0]; | |
case 24: | |
return _context22.finish(21); | |
case 25: | |
return _context22.finish(15); | |
case 26: | |
case "end": | |
return _context22.stop(); | |
} | |
}, _callee21, this, [[0, 12, 15, 26], [16,, 21, 25]]); | |
})); | |
} | |
function cS(t, e) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() { | |
var r, n, i, s, o, _a3; | |
return _regeneratorRuntime().wrap(function _callee23$(_context24) { | |
while (1) switch (_context24.prev = _context24.next) { | |
case 0: | |
r = function _r5(a, l) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() { | |
return _regeneratorRuntime().wrap(function _callee22$(_context23) { | |
while (1) switch (_context23.prev = _context23.next) { | |
case 0: | |
_context23.next = 2; | |
return t(a, l); | |
case 2: | |
return _context23.abrupt("return", rs); | |
case 3: | |
case "end": | |
return _context23.stop(); | |
} | |
}, _callee22); | |
})); | |
}; | |
if (!(typeof t != "function")) { | |
_context24.next = 3; | |
break; | |
} | |
throw new Di("fn", ["Function", "AsyncFunction"], t); | |
case 3: | |
_context24.prev = 3; | |
n = gt(ns.call(this, r, e)); | |
case 5: | |
_context24.next = 7; | |
return n.next(); | |
case 7: | |
if (!(i = !(s = _context24.sent).done)) { | |
_context24.next = 13; | |
break; | |
} | |
_a3 = s.value; | |
; | |
case 10: | |
i = !1; | |
_context24.next = 5; | |
break; | |
case 13: | |
_context24.next = 18; | |
break; | |
case 15: | |
_context24.prev = 15; | |
_context24.t0 = _context24["catch"](3); | |
o = [_context24.t0]; | |
case 18: | |
_context24.prev = 18; | |
_context24.prev = 19; | |
_context24.t1 = i && (s = n["return"]); | |
if (!_context24.t1) { | |
_context24.next = 24; | |
break; | |
} | |
_context24.next = 24; | |
return s.call(n); | |
case 24: | |
_context24.prev = 24; | |
if (!o) { | |
_context24.next = 27; | |
break; | |
} | |
throw o[0]; | |
case 27: | |
return _context24.finish(24); | |
case 28: | |
return _context24.finish(18); | |
case 29: | |
case "end": | |
return _context24.stop(); | |
} | |
}, _callee23, this, [[3, 15, 18, 29], [19,, 24, 28]]); | |
})); | |
} | |
function pu(t, e) { | |
if (typeof t != "function") throw new Di("fn", ["Function", "AsyncFunction"], t); | |
function r(n, i) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() { | |
return _regeneratorRuntime().wrap(function _callee24$(_context25) { | |
while (1) switch (_context25.prev = _context25.next) { | |
case 0: | |
_context25.next = 2; | |
return t(n, i); | |
case 2: | |
if (!_context25.sent) { | |
_context25.next = 6; | |
break; | |
} | |
_context25.t0 = n; | |
_context25.next = 7; | |
break; | |
case 6: | |
_context25.t0 = rs; | |
case 7: | |
return _context25.abrupt("return", _context25.t0); | |
case 8: | |
case "end": | |
return _context25.stop(); | |
} | |
}, _callee24); | |
})); | |
} | |
return ns.call(this, r, e); | |
} | |
var du = /*#__PURE__*/function (_z) { | |
function du() { | |
var _this13; | |
_classCallCheck(this, du); | |
_this13 = _callSuper(this, du, ["reduce"]), _this13.message = "Reduce of an empty stream requires an initial value"; | |
return _this13; | |
} | |
_inherits(du, _z); | |
return _createClass(du); | |
}(z0); | |
function hS(n, i, s) { | |
return Ee(this, arguments, /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t, e, r) { | |
var o, | |
a, | |
_b4, | |
l, | |
c, | |
_b5, | |
d, | |
m, | |
w, | |
T, | |
v, | |
_b7, | |
h, | |
_args26 = arguments; | |
return _regeneratorRuntime().wrap(function _callee25$(_context26) { | |
while (1) switch (_context26.prev = _context26.next) { | |
case 0: | |
if (!(typeof t != "function")) { | |
_context26.next = 2; | |
break; | |
} | |
throw new Di("reducer", ["Function", "AsyncFunction"], t); | |
case 2: | |
r != null && bn(r, "options"), (r == null ? void 0 : r.signal) != null && wn(r.signal, "options.signal"); | |
a = _args26.length > 1; | |
if (!(r != null && (o = r.signal) !== null && o !== void 0 && o.aborted)) { | |
_context26.next = 10; | |
break; | |
} | |
_b4 = new or(void 0, { | |
cause: r.signal.reason | |
}); | |
this.once("error", function () {}); | |
_context26.next = 9; | |
return Y0(this.destroy(_b4)); | |
case 9: | |
throw _b4; | |
case 10: | |
l = new H0(), c = l.signal; | |
if (r != null && r.signal) { | |
_b5 = _defineProperty(_defineProperty({ | |
once: !0 | |
}, G0, this), Q0, !0); | |
r.signal.addEventListener("abort", function () { | |
return l.abort(); | |
}, _b5); | |
} | |
d = !1; | |
_context26.prev = 13; | |
_context26.prev = 14; | |
m = gt(this); | |
case 16: | |
_context26.next = 18; | |
return m.next(); | |
case 18: | |
if (!(w = !(T = _context26.sent).done)) { | |
_context26.next = 32; | |
break; | |
} | |
_b7 = T.value; | |
if (!(d = !0, r != null && (h = r.signal) !== null && h !== void 0 && h.aborted)) { | |
_context26.next = 22; | |
break; | |
} | |
throw new or(); | |
case 22: | |
if (!a) { | |
_context26.next = 28; | |
break; | |
} | |
_context26.next = 25; | |
return t(e, _b7, { | |
signal: c | |
}); | |
case 25: | |
e = _context26.sent; | |
_context26.next = 29; | |
break; | |
case 28: | |
e = _b7, a = !0; | |
case 29: | |
w = !1; | |
_context26.next = 16; | |
break; | |
case 32: | |
_context26.next = 37; | |
break; | |
case 34: | |
_context26.prev = 34; | |
_context26.t0 = _context26["catch"](14); | |
v = [_context26.t0]; | |
case 37: | |
_context26.prev = 37; | |
_context26.prev = 38; | |
_context26.t1 = w && (T = m["return"]); | |
if (!_context26.t1) { | |
_context26.next = 43; | |
break; | |
} | |
_context26.next = 43; | |
return T.call(m); | |
case 43: | |
_context26.prev = 43; | |
if (!v) { | |
_context26.next = 46; | |
break; | |
} | |
throw v[0]; | |
case 46: | |
return _context26.finish(43); | |
case 47: | |
return _context26.finish(37); | |
case 48: | |
if (!(!d && !a)) { | |
_context26.next = 50; | |
break; | |
} | |
throw new du(); | |
case 50: | |
_context26.prev = 50; | |
l.abort(); | |
return _context26.finish(50); | |
case 53: | |
return _context26.abrupt("return", e); | |
case 54: | |
case "end": | |
return _context26.stop(); | |
} | |
}, _callee25, this, [[13,, 50, 53], [14, 34, 37, 48], [38,, 43, 47]]); | |
})); | |
} | |
function dS(t) { | |
return Ee(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() { | |
var e, n, i, s, o, _a4, r; | |
return _regeneratorRuntime().wrap(function _callee26$(_context27) { | |
while (1) switch (_context27.prev = _context27.next) { | |
case 0: | |
t != null && bn(t, "options"), (t == null ? void 0 : t.signal) != null && wn(t.signal, "options.signal"); | |
e = []; | |
_context27.prev = 2; | |
n = gt(this); | |
case 4: | |
_context27.next = 6; | |
return n.next(); | |
case 6: | |
if (!(i = !(s = _context27.sent).done)) { | |
_context27.next = 14; | |
break; | |
} | |
_a4 = s.value; | |
if (!(t != null && (r = t.signal) !== null && r !== void 0 && r.aborted)) { | |
_context27.next = 10; | |
break; | |
} | |
throw new or(void 0, { | |
cause: t.signal.reason | |
}); | |
case 10: | |
rS(e, _a4); | |
case 11: | |
i = !1; | |
_context27.next = 4; | |
break; | |
case 14: | |
_context27.next = 19; | |
break; | |
case 16: | |
_context27.prev = 16; | |
_context27.t0 = _context27["catch"](2); | |
o = [_context27.t0]; | |
case 19: | |
_context27.prev = 19; | |
_context27.prev = 20; | |
_context27.t1 = i && (s = n["return"]); | |
if (!_context27.t1) { | |
_context27.next = 25; | |
break; | |
} | |
_context27.next = 25; | |
return s.call(n); | |
case 25: | |
_context27.prev = 25; | |
if (!o) { | |
_context27.next = 28; | |
break; | |
} | |
throw o[0]; | |
case 28: | |
return _context27.finish(25); | |
case 29: | |
return _context27.finish(19); | |
case 30: | |
return _context27.abrupt("return", e); | |
case 31: | |
case "end": | |
return _context27.stop(); | |
} | |
}, _callee26, this, [[2, 16, 19, 30], [20,, 25, 29]]); | |
})); | |
} | |
function pS(t, e) { | |
var r = ns.call(this, t, e); | |
return function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() { | |
var i, s, o, a, _l10; | |
return _regeneratorRuntime().wrap(function _callee27$(_context28) { | |
while (1) switch (_context28.prev = _context28.next) { | |
case 0: | |
_context28.prev = 0; | |
i = gt(r); | |
case 2: | |
_context28.next = 4; | |
return new et(i.next()); | |
case 4: | |
if (!(s = !(o = _context28.sent).done)) { | |
_context28.next = 10; | |
break; | |
} | |
_l10 = o.value; | |
return _context28.delegateYield(Ot(_l10), "t0", 7); | |
case 7: | |
s = !1; | |
_context28.next = 2; | |
break; | |
case 10: | |
_context28.next = 15; | |
break; | |
case 12: | |
_context28.prev = 12; | |
_context28.t1 = _context28["catch"](0); | |
a = [_context28.t1]; | |
case 15: | |
_context28.prev = 15; | |
_context28.prev = 16; | |
_context28.t2 = s && (o = i["return"]); | |
if (!_context28.t2) { | |
_context28.next = 21; | |
break; | |
} | |
_context28.next = 21; | |
return new et(o.call(i)); | |
case 21: | |
_context28.prev = 21; | |
if (!a) { | |
_context28.next = 24; | |
break; | |
} | |
throw a[0]; | |
case 24: | |
return _context28.finish(21); | |
case 25: | |
return _context28.finish(15); | |
case 26: | |
case "end": | |
return _context28.stop(); | |
} | |
}, _callee27, null, [[0, 12, 15, 26], [16,, 21, 25]]); | |
})); | |
}.call(this); | |
} | |
function Kp(t) { | |
if (t = iS(t), oS(t)) return 0; | |
if (t < 0) throw new K0("number", ">= 0", t); | |
return t; | |
} | |
function yS(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0; | |
return e != null && bn(e, "options"), (e == null ? void 0 : e.signal) != null && wn(e.signal, "options.signal"), t = Kp(t), function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() { | |
var n, s, o, a, l, _c2, i; | |
return _regeneratorRuntime().wrap(function _callee28$(_context29) { | |
while (1) switch (_context29.prev = _context29.next) { | |
case 0: | |
if (!(e != null && (n = e.signal) !== null && n !== void 0 && n.aborted)) { | |
_context29.next = 2; | |
break; | |
} | |
throw new or(); | |
case 2: | |
_context29.prev = 2; | |
s = gt(this); | |
case 4: | |
_context29.next = 6; | |
return new et(s.next()); | |
case 6: | |
if (!(o = !(a = _context29.sent).done)) { | |
_context29.next = 17; | |
break; | |
} | |
_c2 = a.value; | |
if (!(e != null && (i = e.signal) !== null && i !== void 0 && i.aborted)) { | |
_context29.next = 10; | |
break; | |
} | |
throw new or(); | |
case 10: | |
_context29.t0 = t-- <= 0; | |
if (!_context29.t0) { | |
_context29.next = 14; | |
break; | |
} | |
_context29.next = 14; | |
return _c2; | |
case 14: | |
o = !1; | |
_context29.next = 4; | |
break; | |
case 17: | |
_context29.next = 22; | |
break; | |
case 19: | |
_context29.prev = 19; | |
_context29.t1 = _context29["catch"](2); | |
l = [_context29.t1]; | |
case 22: | |
_context29.prev = 22; | |
_context29.prev = 23; | |
_context29.t2 = o && (a = s["return"]); | |
if (!_context29.t2) { | |
_context29.next = 28; | |
break; | |
} | |
_context29.next = 28; | |
return new et(a.call(s)); | |
case 28: | |
_context29.prev = 28; | |
if (!l) { | |
_context29.next = 31; | |
break; | |
} | |
throw l[0]; | |
case 31: | |
return _context29.finish(28); | |
case 32: | |
return _context29.finish(22); | |
case 33: | |
case "end": | |
return _context29.stop(); | |
} | |
}, _callee28, this, [[2, 19, 22, 33], [23,, 28, 32]]); | |
})); | |
}.call(this); | |
} | |
function gS(t) { | |
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0; | |
return e != null && bn(e, "options"), (e == null ? void 0 : e.signal) != null && wn(e.signal, "options.signal"), t = Kp(t), function () { | |
return Rt(this, null, /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() { | |
var n, s, o, a, l, _c3, i; | |
return _regeneratorRuntime().wrap(function _callee29$(_context30) { | |
while (1) switch (_context30.prev = _context30.next) { | |
case 0: | |
if (!(e != null && (n = e.signal) !== null && n !== void 0 && n.aborted)) { | |
_context30.next = 2; | |
break; | |
} | |
throw new or(); | |
case 2: | |
_context30.prev = 2; | |
s = gt(this); | |
case 4: | |
_context30.next = 6; | |
return new et(s.next()); | |
case 6: | |
if (!(o = !(a = _context30.sent).done)) { | |
_context30.next = 19; | |
break; | |
} | |
_c3 = a.value; | |
if (!(e != null && (i = e.signal) !== null && i !== void 0 && i.aborted)) { | |
_context30.next = 10; | |
break; | |
} | |
throw new or(); | |
case 10: | |
_context30.t0 = t-- > 0; | |
if (!_context30.t0) { | |
_context30.next = 14; | |
break; | |
} | |
_context30.next = 14; | |
return _c3; | |
case 14: | |
if (!(t <= 0)) { | |
_context30.next = 16; | |
break; | |
} | |
return _context30.abrupt("return"); | |
case 16: | |
o = !1; | |
_context30.next = 4; | |
break; | |
case 19: | |
_context30.next = 24; | |
break; | |
case 21: | |
_context30.prev = 21; | |
_context30.t1 = _context30["catch"](2); | |
l = [_context30.t1]; | |
case 24: | |
_context30.prev = 24; | |
_context30.prev = 25; | |
_context30.t2 = o && (a = s["return"]); | |
if (!_context30.t2) { | |
_context30.next = 30; | |
break; | |
} | |
_context30.next = 30; | |
return new et(a.call(s)); | |
case 30: | |
_context30.prev = 30; | |
if (!l) { | |
_context30.next = 33; | |
break; | |
} | |
throw l[0]; | |
case 33: | |
return _context30.finish(30); | |
case 34: | |
return _context30.finish(24); | |
case 35: | |
case "end": | |
return _context30.stop(); | |
} | |
}, _callee29, this, [[2, 21, 24, 35], [25,, 30, 34]]); | |
})); | |
}.call(this); | |
} | |
yu.exports.streamReturningOperators = { | |
asIndexedPairs: tS(uS, "readable.asIndexedPairs will be removed in a future version."), | |
drop: yS, | |
filter: pu, | |
flatMap: pS, | |
map: ns, | |
take: gS, | |
compose: aS | |
}; | |
yu.exports.promiseReturningOperators = { | |
every: lS, | |
forEach: cS, | |
reduce: hS, | |
toArray: dS, | |
some: zp, | |
find: fS | |
}; | |
}); | |
var gu = H(function (iC, Qp) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _Ne19 = Ne(), | |
wS = _Ne19.ArrayPrototypePop, | |
bS = _Ne19.Promise, | |
_rr8 = rr(), | |
_S = _rr8.isIterable, | |
mS = _rr8.isNodeStream, | |
vS = _rr8.isWebStream, | |
_Zo2 = Zo(), | |
SS = _Zo2.pipelineImpl, | |
_Sr2 = Sr(), | |
ES = _Sr2.finished; | |
wu(); | |
function AS() { | |
for (var _len16 = arguments.length, t = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) { | |
t[_key16] = arguments[_key16]; | |
} | |
return new bS(function (e, r) { | |
var n, | |
i, | |
s = t[t.length - 1]; | |
if (s && _typeof(s) == "object" && !mS(s) && !_S(s) && !vS(s)) { | |
var _o5 = wS(t); | |
n = _o5.signal, i = _o5.end; | |
} | |
SS(t, function (o, a) { | |
o ? r(o) : e(a); | |
}, { | |
signal: n, | |
end: i | |
}); | |
}); | |
} | |
Qp.exports = { | |
finished: ES, | |
pipeline: AS | |
}; | |
}); | |
var wu = H(function (cC, iy) { | |
P(); | |
O(); | |
R(); | |
var _ref17 = (ze(), Ie(Je)), | |
IS = _ref17.Buffer, | |
_Ne20 = Ne(), | |
Ir = _Ne20.ObjectDefineProperty, | |
Xp = _Ne20.ObjectKeys, | |
Zp = _Ne20.ReflectApply, | |
_it8 = it(), | |
ey = _it8.promisify.custom, | |
_Gp = Gp(), | |
Yp = _Gp.streamReturningOperators, | |
Jp = _Gp.promiseReturningOperators, | |
_ft10 = ft(), | |
ty = _ft10.codes.ERR_ILLEGAL_CONSTRUCTOR, | |
TS = hu(), | |
_xi4 = xi(), | |
PS = _xi4.setDefaultHighWaterMark, | |
RS = _xi4.getDefaultHighWaterMark, | |
_Zo3 = Zo(), | |
ry = _Zo3.pipeline, | |
_hn3 = hn(), | |
OS = _hn3.destroyer, | |
ny = Sr(), | |
bu = gu(), | |
Fi = rr(), | |
xe = iy.exports = Lo().Stream; | |
xe.isDestroyed = Fi.isDestroyed; | |
xe.isDisturbed = Fi.isDisturbed; | |
xe.isErrored = Fi.isErrored; | |
xe.isReadable = Fi.isReadable; | |
xe.isWritable = Fi.isWritable; | |
xe.Readable = ki(); | |
var _iterator6 = _createForOfIteratorHelper(Xp(Yp)), | |
_step6; | |
try { | |
var _loop3 = function _loop3() { | |
var t = _step6.value; | |
var r = function _target() { | |
if (this instanceof _target ? this.constructor : void 0) throw ty(); | |
for (var _len17 = arguments.length, n = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) { | |
n[_key17] = arguments[_key17]; | |
} | |
return xe.Readable.from(Zp(e, this, n)); | |
}; | |
_u = r; | |
var e = Yp[t]; | |
Ir(r, "name", { | |
__proto__: null, | |
value: e.name | |
}), Ir(r, "length", { | |
__proto__: null, | |
value: e.length | |
}), Ir(xe.Readable.prototype, t, { | |
__proto__: null, | |
value: r, | |
enumerable: !1, | |
configurable: !0, | |
writable: !0 | |
}); | |
}; | |
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { | |
_loop3(); | |
} | |
} catch (err) { | |
_iterator6.e(err); | |
} finally { | |
_iterator6.f(); | |
} | |
var _u; | |
var _iterator7 = _createForOfIteratorHelper(Xp(Jp)), | |
_step7; | |
try { | |
var _loop4 = function _loop4() { | |
var t = _step7.value; | |
var r = function _target2() { | |
if (this instanceof _target2 ? this.constructor : void 0) throw ty(); | |
for (var _len18 = arguments.length, i = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) { | |
i[_key18] = arguments[_key18]; | |
} | |
return Zp(e, this, i); | |
}; | |
_u = r; | |
var e = Jp[t]; | |
Ir(r, "name", { | |
__proto__: null, | |
value: e.name | |
}), Ir(r, "length", { | |
__proto__: null, | |
value: e.length | |
}), Ir(xe.Readable.prototype, t, { | |
__proto__: null, | |
value: r, | |
enumerable: !1, | |
configurable: !0, | |
writable: !0 | |
}); | |
}; | |
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { | |
_loop4(); | |
} | |
} catch (err) { | |
_iterator7.e(err); | |
} finally { | |
_iterator7.f(); | |
} | |
var _u; | |
xe.Writable = Qo(); | |
xe.Duplex = ir(); | |
xe.Transform = Za(); | |
xe.PassThrough = tu(); | |
xe.pipeline = ry; | |
var _Oi4 = Oi(), | |
xS = _Oi4.addAbortSignal; | |
xe.addAbortSignal = xS; | |
xe.finished = ny; | |
xe.destroy = OS; | |
xe.compose = TS; | |
xe.setDefaultHighWaterMark = PS; | |
xe.getDefaultHighWaterMark = RS; | |
Ir(xe, "promises", { | |
__proto__: null, | |
configurable: !0, | |
enumerable: !0, | |
get: function get() { | |
return bu; | |
} | |
}); | |
Ir(ry, ey, { | |
__proto__: null, | |
enumerable: !0, | |
get: function get() { | |
return bu.pipeline; | |
} | |
}); | |
Ir(ny, ey, { | |
__proto__: null, | |
enumerable: !0, | |
get: function get() { | |
return bu.finished; | |
} | |
}); | |
xe.Stream = xe; | |
xe._isUint8Array = function (e) { | |
return e instanceof Uint8Array; | |
}; | |
xe._uint8ArrayToBuffer = function (e) { | |
return IS.from(e.buffer, e.byteOffset, e.byteLength); | |
}; | |
}); | |
var Tr = H(function (bC, Fe) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var Ge = wu(), | |
BS = gu(), | |
CS = Ge.Readable.destroy; | |
Fe.exports = Ge.Readable; | |
Fe.exports._uint8ArrayToBuffer = Ge._uint8ArrayToBuffer; | |
Fe.exports._isUint8Array = Ge._isUint8Array; | |
Fe.exports.isDisturbed = Ge.isDisturbed; | |
Fe.exports.isErrored = Ge.isErrored; | |
Fe.exports.isReadable = Ge.isReadable; | |
Fe.exports.Readable = Ge.Readable; | |
Fe.exports.Writable = Ge.Writable; | |
Fe.exports.Duplex = Ge.Duplex; | |
Fe.exports.Transform = Ge.Transform; | |
Fe.exports.PassThrough = Ge.PassThrough; | |
Fe.exports.addAbortSignal = Ge.addAbortSignal; | |
Fe.exports.finished = Ge.finished; | |
Fe.exports.destroy = Ge.destroy; | |
Fe.exports.destroy = CS; | |
Fe.exports.pipeline = Ge.pipeline; | |
Fe.exports.compose = Ge.compose; | |
Object.defineProperty(Ge, "promises", { | |
configurable: !0, | |
enumerable: !0, | |
get: function get() { | |
return BS; | |
} | |
}); | |
Fe.exports.Stream = Ge.Stream; | |
Fe.exports["default"] = Fe.exports; | |
}); | |
var oy = H(function (IC, mu) { | |
P(); | |
O(); | |
R(); | |
typeof Object.create == "function" ? mu.exports = function (e, r) { | |
r && (e.super_ = r, e.prototype = Object.create(r.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0 | |
} | |
})); | |
} : mu.exports = function (e, r) { | |
if (r) { | |
e.super_ = r; | |
var n = function n() {}; | |
n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e; | |
} | |
}; | |
}); | |
var uy = H(function (CC, ay) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var _ref18 = (ze(), Ie(Je)), | |
jt = _ref18.Buffer, | |
sy = Symbol["for"]("BufferList"); | |
function Oe(t) { | |
if (!(this instanceof Oe)) return new Oe(t); | |
Oe._init.call(this, t); | |
} | |
Oe._init = function (e) { | |
Object.defineProperty(this, sy, { | |
value: !0 | |
}), this._bufs = [], this.length = 0, e && this.append(e); | |
}; | |
Oe.prototype._new = function (e) { | |
return new Oe(e); | |
}; | |
Oe.prototype._offset = function (e) { | |
if (e === 0) return [0, 0]; | |
var r = 0; | |
for (var n = 0; n < this._bufs.length; n++) { | |
var i = r + this._bufs[n].length; | |
if (e < i || n === this._bufs.length - 1) return [n, e - r]; | |
r = i; | |
} | |
}; | |
Oe.prototype._reverseOffset = function (t) { | |
var e = t[0], | |
r = t[1]; | |
for (var n = 0; n < e; n++) r += this._bufs[n].length; | |
return r; | |
}; | |
Oe.prototype.get = function (e) { | |
if (e > this.length || e < 0) return; | |
var r = this._offset(e); | |
return this._bufs[r[0]][r[1]]; | |
}; | |
Oe.prototype.slice = function (e, r) { | |
return typeof e == "number" && e < 0 && (e += this.length), typeof r == "number" && r < 0 && (r += this.length), this.copy(null, 0, e, r); | |
}; | |
Oe.prototype.copy = function (e, r, n, i) { | |
if ((typeof n != "number" || n < 0) && (n = 0), (typeof i != "number" || i > this.length) && (i = this.length), n >= this.length || i <= 0) return e || jt.alloc(0); | |
var s = !!e, | |
o = this._offset(n), | |
a = i - n, | |
l = a, | |
c = s && r || 0, | |
d = o[1]; | |
if (n === 0 && i === this.length) { | |
if (!s) return this._bufs.length === 1 ? this._bufs[0] : jt.concat(this._bufs, this.length); | |
for (var _h3 = 0; _h3 < this._bufs.length; _h3++) this._bufs[_h3].copy(e, c), c += this._bufs[_h3].length; | |
return e; | |
} | |
if (l <= this._bufs[o[0]].length - d) return s ? this._bufs[o[0]].copy(e, r, d, d + l) : this._bufs[o[0]].slice(d, d + l); | |
s || (e = jt.allocUnsafe(a)); | |
for (var _h4 = o[0]; _h4 < this._bufs.length; _h4++) { | |
var _m3 = this._bufs[_h4].length - d; | |
if (l > _m3) this._bufs[_h4].copy(e, c, d), c += _m3;else { | |
this._bufs[_h4].copy(e, c, d, d + l), c += _m3; | |
break; | |
} | |
l -= _m3, d && (d = 0); | |
} | |
return e.length > c ? e.slice(0, c) : e; | |
}; | |
Oe.prototype.shallowSlice = function (e, r) { | |
if (e = e || 0, r = typeof r != "number" ? this.length : r, e < 0 && (e += this.length), r < 0 && (r += this.length), e === r) return this._new(); | |
var n = this._offset(e), | |
i = this._offset(r), | |
s = this._bufs.slice(n[0], i[0] + 1); | |
return i[1] === 0 ? s.pop() : s[s.length - 1] = s[s.length - 1].slice(0, i[1]), n[1] !== 0 && (s[0] = s[0].slice(n[1])), this._new(s); | |
}; | |
Oe.prototype.toString = function (e, r, n) { | |
return this.slice(r, n).toString(e); | |
}; | |
Oe.prototype.consume = function (e) { | |
if (e = Math.trunc(e), Number.isNaN(e) || e <= 0) return this; | |
for (; this._bufs.length;) if (e >= this._bufs[0].length) e -= this._bufs[0].length, this.length -= this._bufs[0].length, this._bufs.shift();else { | |
this._bufs[0] = this._bufs[0].slice(e), this.length -= e; | |
break; | |
} | |
return this; | |
}; | |
Oe.prototype.duplicate = function () { | |
var e = this._new(); | |
for (var _r6 = 0; _r6 < this._bufs.length; _r6++) e.append(this._bufs[_r6]); | |
return e; | |
}; | |
Oe.prototype.append = function (e) { | |
if (e == null) return this; | |
if (e.buffer) this._appendBuffer(jt.from(e.buffer, e.byteOffset, e.byteLength));else if (Array.isArray(e)) for (var _r7 = 0; _r7 < e.length; _r7++) this.append(e[_r7]);else if (this._isBufferList(e)) for (var _r8 = 0; _r8 < e._bufs.length; _r8++) this.append(e._bufs[_r8]);else typeof e == "number" && (e = e.toString()), this._appendBuffer(jt.from(e)); | |
return this; | |
}; | |
Oe.prototype._appendBuffer = function (e) { | |
this._bufs.push(e), this.length += e.length; | |
}; | |
Oe.prototype.indexOf = function (t, e, r) { | |
if (r === void 0 && typeof e == "string" && (r = e, e = void 0), typeof t == "function" || Array.isArray(t)) throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.'); | |
if (typeof t == "number" ? t = jt.from([t]) : typeof t == "string" ? t = jt.from(t, r) : this._isBufferList(t) ? t = t.slice() : Array.isArray(t.buffer) ? t = jt.from(t.buffer, t.byteOffset, t.byteLength) : jt.isBuffer(t) || (t = jt.from(t)), e = Number(e || 0), isNaN(e) && (e = 0), e < 0 && (e = this.length + e), e < 0 && (e = 0), t.length === 0) return e > this.length ? this.length : e; | |
var n = this._offset(e), | |
i = n[0], | |
s = n[1]; | |
for (; i < this._bufs.length; i++) { | |
var _o6 = this._bufs[i]; | |
for (; s < _o6.length;) if (_o6.length - s >= t.length) { | |
var _l11 = _o6.indexOf(t, s); | |
if (_l11 !== -1) return this._reverseOffset([i, _l11]); | |
s = _o6.length - t.length + 1; | |
} else { | |
var _l12 = this._reverseOffset([i, s]); | |
if (this._match(_l12, t)) return _l12; | |
s++; | |
} | |
s = 0; | |
} | |
return -1; | |
}; | |
Oe.prototype._match = function (t, e) { | |
if (this.length - t < e.length) return !1; | |
for (var _r9 = 0; _r9 < e.length; _r9++) if (this.get(t + _r9) !== e[_r9]) return !1; | |
return !0; | |
}; | |
(function () { | |
var t = { | |
readDoubleBE: 8, | |
readDoubleLE: 8, | |
readFloatBE: 4, | |
readFloatLE: 4, | |
readBigInt64BE: 8, | |
readBigInt64LE: 8, | |
readBigUInt64BE: 8, | |
readBigUInt64LE: 8, | |
readInt32BE: 4, | |
readInt32LE: 4, | |
readUInt32BE: 4, | |
readUInt32LE: 4, | |
readInt16BE: 2, | |
readInt16LE: 2, | |
readUInt16BE: 2, | |
readUInt16LE: 2, | |
readInt8: 1, | |
readUInt8: 1, | |
readIntBE: null, | |
readIntLE: null, | |
readUIntBE: null, | |
readUIntLE: null | |
}; | |
for (var _e5 in t) (function (r) { | |
t[r] === null ? Oe.prototype[r] = function (n, i) { | |
return this.slice(n, n + i)[r](0, i); | |
} : Oe.prototype[r] = function () { | |
var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | |
return this.slice(n, n + t[r])[r](0); | |
}; | |
})(_e5); | |
})(); | |
Oe.prototype._isBufferList = function (e) { | |
return e instanceof Oe || Oe.isBufferList(e); | |
}; | |
Oe.isBufferList = function (e) { | |
return e != null && e[sy]; | |
}; | |
ay.exports = Oe; | |
}); | |
var ly = H(function (DC, is) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var vu = Tr().Duplex, | |
kS = oy(), | |
ji = uy(); | |
function st(t) { | |
if (!(this instanceof st)) return new st(t); | |
if (typeof t == "function") { | |
this._callback = t; | |
var _e6 = function (n) { | |
this._callback && (this._callback(n), this._callback = null); | |
}.bind(this); | |
this.on("pipe", function (n) { | |
n.on("error", _e6); | |
}), this.on("unpipe", function (n) { | |
n.removeListener("error", _e6); | |
}), t = null; | |
} | |
ji._init.call(this, t), vu.call(this); | |
} | |
kS(st, vu); | |
Object.assign(st.prototype, ji.prototype); | |
st.prototype._new = function (e) { | |
return new st(e); | |
}; | |
st.prototype._write = function (e, r, n) { | |
this._appendBuffer(e), typeof n == "function" && n(); | |
}; | |
st.prototype._read = function (e) { | |
if (!this.length) return this.push(null); | |
e = Math.min(e, this.length), this.push(this.slice(0, e)), this.consume(e); | |
}; | |
st.prototype.end = function (e) { | |
vu.prototype.end.call(this, e), this._callback && (this._callback(null, this.slice()), this._callback = null); | |
}; | |
st.prototype._destroy = function (e, r) { | |
this._bufs.length = 0, this.length = 0, r(e); | |
}; | |
st.prototype._isBufferList = function (e) { | |
return e instanceof st || e instanceof ji || st.isBufferList(e); | |
}; | |
st.isBufferList = ji.isBufferList; | |
is.exports = st; | |
is.exports.BufferListStream = st; | |
is.exports.BufferList = ji; | |
}); | |
var cy = H(function (zC, fy) { | |
P(); | |
O(); | |
R(); | |
var Su = /*#__PURE__*/_createClass(function Su() { | |
_classCallCheck(this, Su); | |
this.cmd = null, this.retain = !1, this.qos = 0, this.dup = !1, this.length = -1, this.topic = null, this.payload = null; | |
}); | |
fy.exports = Su; | |
}); | |
var Eu = H(function (ZC, hy) { | |
P(); | |
O(); | |
R(); | |
var K = hy.exports, | |
_ref19 = (ze(), Ie(Je)), | |
wt = _ref19.Buffer; | |
K.types = { | |
0: "reserved", | |
1: "connect", | |
2: "connack", | |
3: "publish", | |
4: "puback", | |
5: "pubrec", | |
6: "pubrel", | |
7: "pubcomp", | |
8: "subscribe", | |
9: "suback", | |
10: "unsubscribe", | |
11: "unsuback", | |
12: "pingreq", | |
13: "pingresp", | |
14: "disconnect", | |
15: "auth" | |
}; | |
K.requiredHeaderFlags = { | |
1: 0, | |
2: 0, | |
4: 0, | |
5: 0, | |
6: 2, | |
7: 0, | |
8: 2, | |
9: 0, | |
10: 2, | |
11: 0, | |
12: 0, | |
13: 0, | |
14: 0, | |
15: 0 | |
}; | |
K.requiredHeaderFlagsErrors = {}; | |
for (var t in K.requiredHeaderFlags) { | |
var _e7 = K.requiredHeaderFlags[t]; | |
K.requiredHeaderFlagsErrors[t] = "Invalid header flag bits, must be 0x" + _e7.toString(16) + " for " + K.types[t] + " packet"; | |
} | |
K.codes = {}; | |
for (var _t2 in K.types) { | |
var _e8 = K.types[_t2]; | |
K.codes[_e8] = _t2; | |
} | |
K.CMD_SHIFT = 4; | |
K.CMD_MASK = 240; | |
K.DUP_MASK = 8; | |
K.QOS_MASK = 3; | |
K.QOS_SHIFT = 1; | |
K.RETAIN_MASK = 1; | |
K.VARBYTEINT_MASK = 127; | |
K.VARBYTEINT_FIN_MASK = 128; | |
K.VARBYTEINT_MAX = 268435455; | |
K.SESSIONPRESENT_MASK = 1; | |
K.SESSIONPRESENT_HEADER = wt.from([K.SESSIONPRESENT_MASK]); | |
K.CONNACK_HEADER = wt.from([K.codes.connack << K.CMD_SHIFT]); | |
K.USERNAME_MASK = 128; | |
K.PASSWORD_MASK = 64; | |
K.WILL_RETAIN_MASK = 32; | |
K.WILL_QOS_MASK = 24; | |
K.WILL_QOS_SHIFT = 3; | |
K.WILL_FLAG_MASK = 4; | |
K.CLEAN_SESSION_MASK = 2; | |
K.CONNECT_HEADER = wt.from([K.codes.connect << K.CMD_SHIFT]); | |
K.properties = { | |
sessionExpiryInterval: 17, | |
willDelayInterval: 24, | |
receiveMaximum: 33, | |
maximumPacketSize: 39, | |
topicAliasMaximum: 34, | |
requestResponseInformation: 25, | |
requestProblemInformation: 23, | |
userProperties: 38, | |
authenticationMethod: 21, | |
authenticationData: 22, | |
payloadFormatIndicator: 1, | |
messageExpiryInterval: 2, | |
contentType: 3, | |
responseTopic: 8, | |
correlationData: 9, | |
maximumQoS: 36, | |
retainAvailable: 37, | |
assignedClientIdentifier: 18, | |
reasonString: 31, | |
wildcardSubscriptionAvailable: 40, | |
subscriptionIdentifiersAvailable: 41, | |
sharedSubscriptionAvailable: 42, | |
serverKeepAlive: 19, | |
responseInformation: 26, | |
serverReference: 28, | |
topicAlias: 35, | |
subscriptionIdentifier: 11 | |
}; | |
K.propertiesCodes = {}; | |
for (var _t3 in K.properties) { | |
var _e9 = K.properties[_t3]; | |
K.propertiesCodes[_e9] = _t3; | |
} | |
K.propertiesTypes = { | |
sessionExpiryInterval: "int32", | |
willDelayInterval: "int32", | |
receiveMaximum: "int16", | |
maximumPacketSize: "int32", | |
topicAliasMaximum: "int16", | |
requestResponseInformation: "byte", | |
requestProblemInformation: "byte", | |
userProperties: "pair", | |
authenticationMethod: "string", | |
authenticationData: "binary", | |
payloadFormatIndicator: "byte", | |
messageExpiryInterval: "int32", | |
contentType: "string", | |
responseTopic: "string", | |
correlationData: "binary", | |
maximumQoS: "int8", | |
retainAvailable: "byte", | |
assignedClientIdentifier: "string", | |
reasonString: "string", | |
wildcardSubscriptionAvailable: "byte", | |
subscriptionIdentifiersAvailable: "byte", | |
sharedSubscriptionAvailable: "byte", | |
serverKeepAlive: "int16", | |
responseInformation: "string", | |
serverReference: "string", | |
topicAlias: "int16", | |
subscriptionIdentifier: "var" | |
}; | |
function Wr(t) { | |
return [0, 1, 2].map(function (e) { | |
return [0, 1].map(function (r) { | |
return [0, 1].map(function (n) { | |
var i = wt.alloc(1); | |
return i.writeUInt8(K.codes[t] << K.CMD_SHIFT | (r ? K.DUP_MASK : 0) | e << K.QOS_SHIFT | n, 0, !0), i; | |
}); | |
}); | |
}); | |
} | |
K.PUBLISH_HEADER = Wr("publish"); | |
K.SUBSCRIBE_HEADER = Wr("subscribe"); | |
K.SUBSCRIBE_OPTIONS_QOS_MASK = 3; | |
K.SUBSCRIBE_OPTIONS_NL_MASK = 1; | |
K.SUBSCRIBE_OPTIONS_NL_SHIFT = 2; | |
K.SUBSCRIBE_OPTIONS_RAP_MASK = 1; | |
K.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3; | |
K.SUBSCRIBE_OPTIONS_RH_MASK = 3; | |
K.SUBSCRIBE_OPTIONS_RH_SHIFT = 4; | |
K.SUBSCRIBE_OPTIONS_RH = [0, 16, 32]; | |
K.SUBSCRIBE_OPTIONS_NL = 4; | |
K.SUBSCRIBE_OPTIONS_RAP = 8; | |
K.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2]; | |
K.UNSUBSCRIBE_HEADER = Wr("unsubscribe"); | |
K.ACKS = { | |
unsuback: Wr("unsuback"), | |
puback: Wr("puback"), | |
pubcomp: Wr("pubcomp"), | |
pubrel: Wr("pubrel"), | |
pubrec: Wr("pubrec") | |
}; | |
K.SUBACK_HEADER = wt.from([K.codes.suback << K.CMD_SHIFT]); | |
K.VERSION3 = wt.from([3]); | |
K.VERSION4 = wt.from([4]); | |
K.VERSION5 = wt.from([5]); | |
K.VERSION131 = wt.from([131]); | |
K.VERSION132 = wt.from([132]); | |
K.QOS = [0, 1, 2].map(function (t) { | |
return wt.from([t]); | |
}); | |
K.EMPTY = { | |
pingreq: wt.from([K.codes.pingreq << 4, 0]), | |
pingresp: wt.from([K.codes.pingresp << 4, 0]), | |
disconnect: wt.from([K.codes.disconnect << 4, 0]) | |
}; | |
K.MQTT5_PUBACK_PUBREC_CODES = { | |
0: "Success", | |
16: "No matching subscribers", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
144: "Topic Name invalid", | |
145: "Packet identifier in use", | |
151: "Quota exceeded", | |
153: "Payload format invalid" | |
}; | |
K.MQTT5_PUBREL_PUBCOMP_CODES = { | |
0: "Success", | |
146: "Packet Identifier not found" | |
}; | |
K.MQTT5_SUBACK_CODES = { | |
0: "Granted QoS 0", | |
1: "Granted QoS 1", | |
2: "Granted QoS 2", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
143: "Topic Filter invalid", | |
145: "Packet Identifier in use", | |
151: "Quota exceeded", | |
158: "Shared Subscriptions not supported", | |
161: "Subscription Identifiers not supported", | |
162: "Wildcard Subscriptions not supported" | |
}; | |
K.MQTT5_UNSUBACK_CODES = { | |
0: "Success", | |
17: "No subscription existed", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
143: "Topic Filter invalid", | |
145: "Packet Identifier in use" | |
}; | |
K.MQTT5_DISCONNECT_CODES = { | |
0: "Normal disconnection", | |
4: "Disconnect with Will Message", | |
128: "Unspecified error", | |
129: "Malformed Packet", | |
130: "Protocol Error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
137: "Server busy", | |
139: "Server shutting down", | |
141: "Keep Alive timeout", | |
142: "Session taken over", | |
143: "Topic Filter invalid", | |
144: "Topic Name invalid", | |
147: "Receive Maximum exceeded", | |
148: "Topic Alias invalid", | |
149: "Packet too large", | |
150: "Message rate too high", | |
151: "Quota exceeded", | |
152: "Administrative action", | |
153: "Payload format invalid", | |
154: "Retain not supported", | |
155: "QoS not supported", | |
156: "Use another server", | |
157: "Server moved", | |
158: "Shared Subscriptions not supported", | |
159: "Connection rate exceeded", | |
160: "Maximum connect time", | |
161: "Subscription Identifiers not supported", | |
162: "Wildcard Subscriptions not supported" | |
}; | |
K.MQTT5_AUTH_CODES = { | |
0: "Success", | |
24: "Continue authentication", | |
25: "Re-authenticate" | |
}; | |
}); | |
var py = H(function (sk, dy) { | |
P(); | |
O(); | |
R(); | |
var ii = 1e3, | |
oi = ii * 60, | |
si = oi * 60, | |
_n = si * 24, | |
MS = _n * 7, | |
NS = _n * 365.25; | |
dy.exports = function (t, e) { | |
e = e || {}; | |
var r = _typeof(t); | |
if (r === "string" && t.length > 0) return LS(t); | |
if (r === "number" && isFinite(t)) return e["long"] ? US(t) : qS(t); | |
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(t)); | |
}; | |
function LS(t) { | |
if (t = String(t), !(t.length > 100)) { | |
var e = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t); | |
if (e) { | |
var r = parseFloat(e[1]), | |
n = (e[2] || "ms").toLowerCase(); | |
switch (n) { | |
case "years": | |
case "year": | |
case "yrs": | |
case "yr": | |
case "y": | |
return r * NS; | |
case "weeks": | |
case "week": | |
case "w": | |
return r * MS; | |
case "days": | |
case "day": | |
case "d": | |
return r * _n; | |
case "hours": | |
case "hour": | |
case "hrs": | |
case "hr": | |
case "h": | |
return r * si; | |
case "minutes": | |
case "minute": | |
case "mins": | |
case "min": | |
case "m": | |
return r * oi; | |
case "seconds": | |
case "second": | |
case "secs": | |
case "sec": | |
case "s": | |
return r * ii; | |
case "milliseconds": | |
case "millisecond": | |
case "msecs": | |
case "msec": | |
case "ms": | |
return r; | |
default: | |
return; | |
} | |
} | |
} | |
} | |
function qS(t) { | |
var e = Math.abs(t); | |
return e >= _n ? Math.round(t / _n) + "d" : e >= si ? Math.round(t / si) + "h" : e >= oi ? Math.round(t / oi) + "m" : e >= ii ? Math.round(t / ii) + "s" : t + "ms"; | |
} | |
function US(t) { | |
var e = Math.abs(t); | |
return e >= _n ? os(t, e, _n, "day") : e >= si ? os(t, e, si, "hour") : e >= oi ? os(t, e, oi, "minute") : e >= ii ? os(t, e, ii, "second") : t + " ms"; | |
} | |
function os(t, e, r, n) { | |
var i = e >= r * 1.5; | |
return Math.round(t / r) + " " + n + (i ? "s" : ""); | |
} | |
}); | |
var gy = H(function (dk, yy) { | |
P(); | |
O(); | |
R(); | |
function DS(t) { | |
r.debug = r, r["default"] = r, r.coerce = l, r.disable = s, r.enable = i, r.enabled = o, r.humanize = py(), r.destroy = c, Object.keys(t).forEach(function (d) { | |
r[d] = t[d]; | |
}), r.names = [], r.skips = [], r.formatters = {}; | |
function e(d) { | |
var h = 0; | |
for (var _m4 = 0; _m4 < d.length; _m4++) h = (h << 5) - h + d.charCodeAt(_m4), h |= 0; | |
return r.colors[Math.abs(h) % r.colors.length]; | |
} | |
r.selectColor = e; | |
function r(d) { | |
var h, | |
m = null, | |
w, | |
T; | |
function v() { | |
for (var _len19 = arguments.length, b = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) { | |
b[_key19] = arguments[_key19]; | |
} | |
if (!v.enabled) return; | |
var p = v, | |
_ = Number(new Date()), | |
x = _ - (h || _); | |
p.diff = x, p.prev = h, p.curr = _, h = _, b[0] = r.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O"); | |
var I = 0; | |
b[0] = b[0].replace(/%([a-zA-Z%])/g, function (B, A) { | |
if (B === "%%") return "%"; | |
I++; | |
var q = r.formatters[A]; | |
if (typeof q == "function") { | |
var $ = b[I]; | |
B = q.call(p, $), b.splice(I, 1), I--; | |
} | |
return B; | |
}), r.formatArgs.call(p, b), (p.log || r.log).apply(p, b); | |
} | |
return v.namespace = d, v.useColors = r.useColors(), v.color = r.selectColor(d), v.extend = n, v.destroy = r.destroy, Object.defineProperty(v, "enabled", { | |
enumerable: !0, | |
configurable: !1, | |
get: function get() { | |
return m !== null ? m : (w !== r.namespaces && (w = r.namespaces, T = r.enabled(d)), T); | |
}, | |
set: function set(b) { | |
m = b; | |
} | |
}), typeof r.init == "function" && r.init(v), v; | |
} | |
function n(d, h) { | |
var m = r(this.namespace + (typeof h == "undefined" ? ":" : h) + d); | |
return m.log = this.log, m; | |
} | |
function i(d) { | |
r.save(d), r.namespaces = d, r.names = [], r.skips = []; | |
var h, | |
m = (typeof d == "string" ? d : "").split(/[\s,]+/), | |
w = m.length; | |
for (h = 0; h < w; h++) m[h] && (d = m[h].replace(/\*/g, ".*?"), d[0] === "-" ? r.skips.push(new RegExp("^" + d.slice(1) + "$")) : r.names.push(new RegExp("^" + d + "$"))); | |
} | |
function s() { | |
var d = [].concat(_toConsumableArray(r.names.map(a)), _toConsumableArray(r.skips.map(a).map(function (h) { | |
return "-" + h; | |
}))).join(","); | |
return r.enable(""), d; | |
} | |
function o(d) { | |
if (d[d.length - 1] === "*") return !0; | |
var h, m; | |
for (h = 0, m = r.skips.length; h < m; h++) if (r.skips[h].test(d)) return !1; | |
for (h = 0, m = r.names.length; h < m; h++) if (r.names[h].test(d)) return !0; | |
return !1; | |
} | |
function a(d) { | |
return d.toString().substring(2, d.toString().length - 2).replace(/\.\*\?$/, "*"); | |
} | |
function l(d) { | |
return d instanceof Error ? d.stack || d.message : d; | |
} | |
function c() { | |
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); | |
} | |
return r.enable(r.load()), r; | |
} | |
yy.exports = DS; | |
}); | |
var sr = H(function (_t, ss) { | |
P(); | |
O(); | |
R(); | |
_t.formatArgs = jS; | |
_t.save = WS; | |
_t.load = $S; | |
_t.useColors = FS; | |
_t.storage = HS(); | |
_t.destroy = function () { | |
var t = !1; | |
return function () { | |
t || (t = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")); | |
}; | |
}(); | |
_t.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"]; | |
function FS() { | |
if (typeof window != "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return !0; | |
if (typeof navigator != "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1; | |
var t; | |
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 && (t = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(t[1], 10) >= 31 || typeof navigator != "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); | |
} | |
function jS(t) { | |
if (t[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t[0] + (this.useColors ? "%c " : " ") + "+" + ss.exports.humanize(this.diff), !this.useColors) return; | |
var e = "color: " + this.color; | |
t.splice(1, 0, e, "color: inherit"); | |
var r = 0, | |
n = 0; | |
t[0].replace(/%[a-zA-Z%]/g, function (i) { | |
i !== "%%" && (r++, i === "%c" && (n = r)); | |
}), t.splice(n, 0, e); | |
} | |
_t.log = console.debug || console.log || function () {}; | |
function WS(t) { | |
try { | |
t ? _t.storage.setItem("debug", t) : _t.storage.removeItem("debug"); | |
} catch (e) {} | |
} | |
function $S() { | |
var t; | |
try { | |
t = _t.storage.getItem("debug"); | |
} catch (e) {} | |
return !t && typeof L != "undefined" && "env" in L && (t = L.env.DEBUG), t; | |
} | |
function HS() { | |
try { | |
return localStorage; | |
} catch (t) {} | |
} | |
ss.exports = gy()(_t); | |
var VS = ss.exports.formatters; | |
VS.j = function (t) { | |
try { | |
return JSON.stringify(t); | |
} catch (e) { | |
return "[UnexpectedJSONParseError]: " + e.message; | |
} | |
}; | |
}); | |
var _y = H(function (Tk, by) { | |
P(); | |
O(); | |
R(); | |
var zS = ly(), | |
_ref20 = (qr(), Ie(Lr)), | |
KS = _ref20.EventEmitter, | |
wy = cy(), | |
be = Eu(), | |
fe = sr()("mqtt-packet:parser"), | |
Au = /*#__PURE__*/function (_KS) { | |
function t() { | |
var _this14; | |
_classCallCheck(this, t); | |
_this14 = _callSuper(this, t), _this14.parser = _this14.constructor.parser; | |
return _this14; | |
} | |
_inherits(t, _KS); | |
return _createClass(t, [{ | |
key: "_resetState", | |
value: function _resetState() { | |
fe("_resetState: resetting packet, error, _list, and _stateCounter"), this.packet = new wy(), this.error = null, this._list = zS(), this._stateCounter = 0; | |
} | |
}, { | |
key: "parse", | |
value: function parse(e) { | |
var _this15 = this; | |
this.error && this._resetState(), this._list.append(e), fe("parse: current state: %s", this._states[this._stateCounter]); | |
var r = function r() { | |
return (_this15.packet.length !== -1 || _this15._list.length > 0) && _this15[_this15._states[_this15._stateCounter]](); | |
}; | |
for (; r() && !this.error;) this._stateCounter++, fe("parse: state complete. _stateCounter is now: %d", this._stateCounter), fe("parse: packet.length: %d, buffer list length: %d", this.packet.length, this._list.length), this._stateCounter >= this._states.length && (this._stateCounter = 0); | |
return fe("parse: exited while loop. packet: %d, buffer list length: %d", this.packet.length, this._list.length), this._list.length; | |
} | |
}, { | |
key: "_parseHeader", | |
value: function _parseHeader() { | |
var e = this._list.readUInt8(0), | |
r = e >> be.CMD_SHIFT; | |
this.packet.cmd = be.types[r]; | |
var n = e & 15, | |
i = be.requiredHeaderFlags[r]; | |
return i != null && n !== i ? this._emitError(new Error(be.requiredHeaderFlagsErrors[r])) : (this.packet.retain = (e & be.RETAIN_MASK) !== 0, this.packet.qos = e >> be.QOS_SHIFT & be.QOS_MASK, this.packet.qos > 2 ? this._emitError(new Error("Packet must not have both QoS bits set to 1")) : (this.packet.dup = (e & be.DUP_MASK) !== 0, fe("_parseHeader: packet: %o", this.packet), this._list.consume(1), !0)); | |
} | |
}, { | |
key: "_parseLength", | |
value: function _parseLength() { | |
var e = this._parseVarByteNum(!0); | |
return e && (this.packet.length = e.value, this._list.consume(e.bytes)), fe("_parseLength %d", e.value), !!e; | |
} | |
}, { | |
key: "_parsePayload", | |
value: function _parsePayload() { | |
fe("_parsePayload: payload %O", this._list); | |
var e = !1; | |
if (this.packet.length === 0 || this._list.length >= this.packet.length) { | |
switch (this._pos = 0, this.packet.cmd) { | |
case "connect": | |
this._parseConnect(); | |
break; | |
case "connack": | |
this._parseConnack(); | |
break; | |
case "publish": | |
this._parsePublish(); | |
break; | |
case "puback": | |
case "pubrec": | |
case "pubrel": | |
case "pubcomp": | |
this._parseConfirmation(); | |
break; | |
case "subscribe": | |
this._parseSubscribe(); | |
break; | |
case "suback": | |
this._parseSuback(); | |
break; | |
case "unsubscribe": | |
this._parseUnsubscribe(); | |
break; | |
case "unsuback": | |
this._parseUnsuback(); | |
break; | |
case "pingreq": | |
case "pingresp": | |
break; | |
case "disconnect": | |
this._parseDisconnect(); | |
break; | |
case "auth": | |
this._parseAuth(); | |
break; | |
default: | |
this._emitError(new Error("Not supported")); | |
} | |
e = !0; | |
} | |
return fe("_parsePayload complete result: %s", e), e; | |
} | |
}, { | |
key: "_parseConnect", | |
value: function _parseConnect() { | |
fe("_parseConnect"); | |
var e, | |
r, | |
n, | |
i, | |
s = {}, | |
o = this.packet, | |
a = this._parseString(); | |
if (a === null) return this._emitError(new Error("Cannot parse protocolId")); | |
if (a !== "MQTT" && a !== "MQIsdp") return this._emitError(new Error("Invalid protocolId")); | |
if (o.protocolId = a, this._pos >= this._list.length) return this._emitError(new Error("Packet too short")); | |
if (o.protocolVersion = this._list.readUInt8(this._pos), o.protocolVersion >= 128 && (o.bridgeMode = !0, o.protocolVersion = o.protocolVersion - 128), o.protocolVersion !== 3 && o.protocolVersion !== 4 && o.protocolVersion !== 5) return this._emitError(new Error("Invalid protocol version")); | |
if (this._pos++, this._pos >= this._list.length) return this._emitError(new Error("Packet too short")); | |
if (this._list.readUInt8(this._pos) & 1) return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1")); | |
s.username = this._list.readUInt8(this._pos) & be.USERNAME_MASK, s.password = this._list.readUInt8(this._pos) & be.PASSWORD_MASK, s.will = this._list.readUInt8(this._pos) & be.WILL_FLAG_MASK; | |
var l = !!(this._list.readUInt8(this._pos) & be.WILL_RETAIN_MASK), | |
c = (this._list.readUInt8(this._pos) & be.WILL_QOS_MASK) >> be.WILL_QOS_SHIFT; | |
if (s.will) o.will = {}, o.will.retain = l, o.will.qos = c;else { | |
if (l) return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0")); | |
if (c) return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0")); | |
} | |
if (o.clean = (this._list.readUInt8(this._pos) & be.CLEAN_SESSION_MASK) !== 0, this._pos++, o.keepalive = this._parseNum(), o.keepalive === -1) return this._emitError(new Error("Packet too short")); | |
if (o.protocolVersion === 5) { | |
var _h5 = this._parseProperties(); | |
Object.getOwnPropertyNames(_h5).length && (o.properties = _h5); | |
} | |
var d = this._parseString(); | |
if (d === null) return this._emitError(new Error("Packet too short")); | |
if (o.clientId = d, fe("_parseConnect: packet.clientId: %s", o.clientId), s.will) { | |
if (o.protocolVersion === 5) { | |
var _h6 = this._parseProperties(); | |
Object.getOwnPropertyNames(_h6).length && (o.will.properties = _h6); | |
} | |
if (e = this._parseString(), e === null) return this._emitError(new Error("Cannot parse will topic")); | |
if (o.will.topic = e, fe("_parseConnect: packet.will.topic: %s", o.will.topic), r = this._parseBuffer(), r === null) return this._emitError(new Error("Cannot parse will payload")); | |
o.will.payload = r, fe("_parseConnect: packet.will.paylaod: %s", o.will.payload); | |
} | |
if (s.username) { | |
if (i = this._parseString(), i === null) return this._emitError(new Error("Cannot parse username")); | |
o.username = i, fe("_parseConnect: packet.username: %s", o.username); | |
} | |
if (s.password) { | |
if (n = this._parseBuffer(), n === null) return this._emitError(new Error("Cannot parse password")); | |
o.password = n; | |
} | |
return this.settings = o, fe("_parseConnect: complete"), o; | |
} | |
}, { | |
key: "_parseConnack", | |
value: function _parseConnack() { | |
fe("_parseConnack"); | |
var e = this.packet; | |
if (this._list.length < 1) return null; | |
var r = this._list.readUInt8(this._pos++); | |
if (r > 1) return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0")); | |
if (e.sessionPresent = !!(r & be.SESSIONPRESENT_MASK), this.settings.protocolVersion === 5) this._list.length >= 2 ? e.reasonCode = this._list.readUInt8(this._pos++) : e.reasonCode = 0;else { | |
if (this._list.length < 2) return null; | |
e.returnCode = this._list.readUInt8(this._pos++); | |
} | |
if (e.returnCode === -1 || e.reasonCode === -1) return this._emitError(new Error("Cannot parse return code")); | |
if (this.settings.protocolVersion === 5) { | |
var n = this._parseProperties(); | |
Object.getOwnPropertyNames(n).length && (e.properties = n); | |
} | |
fe("_parseConnack: complete"); | |
} | |
}, { | |
key: "_parsePublish", | |
value: function _parsePublish() { | |
fe("_parsePublish"); | |
var e = this.packet; | |
if (e.topic = this._parseString(), e.topic === null) return this._emitError(new Error("Cannot parse topic")); | |
if (!(e.qos > 0 && !this._parseMessageId())) { | |
if (this.settings.protocolVersion === 5) { | |
var _r10 = this._parseProperties(); | |
Object.getOwnPropertyNames(_r10).length && (e.properties = _r10); | |
} | |
e.payload = this._list.slice(this._pos, e.length), fe("_parsePublish: payload from buffer list: %o", e.payload); | |
} | |
} | |
}, { | |
key: "_parseSubscribe", | |
value: function _parseSubscribe() { | |
fe("_parseSubscribe"); | |
var e = this.packet, | |
r, | |
n, | |
i, | |
s, | |
o, | |
a, | |
l; | |
if (e.subscriptions = [], !!this._parseMessageId()) { | |
if (this.settings.protocolVersion === 5) { | |
var _c4 = this._parseProperties(); | |
Object.getOwnPropertyNames(_c4).length && (e.properties = _c4); | |
} | |
if (e.length <= 0) return this._emitError(new Error("Malformed subscribe, no payload specified")); | |
for (; this._pos < e.length;) { | |
if (r = this._parseString(), r === null) return this._emitError(new Error("Cannot parse topic")); | |
if (this._pos >= e.length) return this._emitError(new Error("Malformed Subscribe Payload")); | |
if (n = this._parseByte(), this.settings.protocolVersion === 5) { | |
if (n & 192) return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0")); | |
} else if (n & 252) return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0")); | |
if (i = n & be.SUBSCRIBE_OPTIONS_QOS_MASK, i > 2) return this._emitError(new Error("Invalid subscribe QoS, must be <= 2")); | |
if (a = (n >> be.SUBSCRIBE_OPTIONS_NL_SHIFT & be.SUBSCRIBE_OPTIONS_NL_MASK) !== 0, o = (n >> be.SUBSCRIBE_OPTIONS_RAP_SHIFT & be.SUBSCRIBE_OPTIONS_RAP_MASK) !== 0, s = n >> be.SUBSCRIBE_OPTIONS_RH_SHIFT & be.SUBSCRIBE_OPTIONS_RH_MASK, s > 2) return this._emitError(new Error("Invalid retain handling, must be <= 2")); | |
l = { | |
topic: r, | |
qos: i | |
}, this.settings.protocolVersion === 5 ? (l.nl = a, l.rap = o, l.rh = s) : this.settings.bridgeMode && (l.rh = 0, l.rap = !0, l.nl = !0), fe("_parseSubscribe: push subscription `%s` to subscription", l), e.subscriptions.push(l); | |
} | |
} | |
} | |
}, { | |
key: "_parseSuback", | |
value: function _parseSuback() { | |
fe("_parseSuback"); | |
var e = this.packet; | |
if (this.packet.granted = [], !!this._parseMessageId()) { | |
if (this.settings.protocolVersion === 5) { | |
var _r11 = this._parseProperties(); | |
Object.getOwnPropertyNames(_r11).length && (e.properties = _r11); | |
} | |
if (e.length <= 0) return this._emitError(new Error("Malformed suback, no payload specified")); | |
for (; this._pos < this.packet.length;) { | |
var _r12 = this._list.readUInt8(this._pos++); | |
if (this.settings.protocolVersion === 5) { | |
if (!be.MQTT5_SUBACK_CODES[_r12]) return this._emitError(new Error("Invalid suback code")); | |
} else if (_r12 > 2 && _r12 !== 128) return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128")); | |
this.packet.granted.push(_r12); | |
} | |
} | |
} | |
}, { | |
key: "_parseUnsubscribe", | |
value: function _parseUnsubscribe() { | |
fe("_parseUnsubscribe"); | |
var e = this.packet; | |
if (e.unsubscriptions = [], !!this._parseMessageId()) { | |
if (this.settings.protocolVersion === 5) { | |
var _r13 = this._parseProperties(); | |
Object.getOwnPropertyNames(_r13).length && (e.properties = _r13); | |
} | |
if (e.length <= 0) return this._emitError(new Error("Malformed unsubscribe, no payload specified")); | |
for (; this._pos < e.length;) { | |
var _r14 = this._parseString(); | |
if (_r14 === null) return this._emitError(new Error("Cannot parse topic")); | |
fe("_parseUnsubscribe: push topic `%s` to unsubscriptions", _r14), e.unsubscriptions.push(_r14); | |
} | |
} | |
} | |
}, { | |
key: "_parseUnsuback", | |
value: function _parseUnsuback() { | |
fe("_parseUnsuback"); | |
var e = this.packet; | |
if (!this._parseMessageId()) return this._emitError(new Error("Cannot parse messageId")); | |
if ((this.settings.protocolVersion === 3 || this.settings.protocolVersion === 4) && e.length !== 2) return this._emitError(new Error("Malformed unsuback, payload length must be 2")); | |
if (e.length <= 0) return this._emitError(new Error("Malformed unsuback, no payload specified")); | |
if (this.settings.protocolVersion === 5) { | |
var _r15 = this._parseProperties(); | |
for (Object.getOwnPropertyNames(_r15).length && (e.properties = _r15), e.granted = []; this._pos < this.packet.length;) { | |
var n = this._list.readUInt8(this._pos++); | |
if (!be.MQTT5_UNSUBACK_CODES[n]) return this._emitError(new Error("Invalid unsuback code")); | |
this.packet.granted.push(n); | |
} | |
} | |
} | |
}, { | |
key: "_parseConfirmation", | |
value: function _parseConfirmation() { | |
fe("_parseConfirmation: packet.cmd: `%s`", this.packet.cmd); | |
var e = this.packet; | |
if (this._parseMessageId(), this.settings.protocolVersion === 5) { | |
if (e.length > 2) { | |
switch (e.reasonCode = this._parseByte(), this.packet.cmd) { | |
case "puback": | |
case "pubrec": | |
if (!be.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode]) return this._emitError(new Error("Invalid " + this.packet.cmd + " reason code")); | |
break; | |
case "pubrel": | |
case "pubcomp": | |
if (!be.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode]) return this._emitError(new Error("Invalid " + this.packet.cmd + " reason code")); | |
break; | |
} | |
fe("_parseConfirmation: packet.reasonCode `%d`", e.reasonCode); | |
} else e.reasonCode = 0; | |
if (e.length > 3) { | |
var _r16 = this._parseProperties(); | |
Object.getOwnPropertyNames(_r16).length && (e.properties = _r16); | |
} | |
} | |
return !0; | |
} | |
}, { | |
key: "_parseDisconnect", | |
value: function _parseDisconnect() { | |
var e = this.packet; | |
if (fe("_parseDisconnect"), this.settings.protocolVersion === 5) { | |
this._list.length > 0 ? (e.reasonCode = this._parseByte(), be.MQTT5_DISCONNECT_CODES[e.reasonCode] || this._emitError(new Error("Invalid disconnect reason code"))) : e.reasonCode = 0; | |
var _r17 = this._parseProperties(); | |
Object.getOwnPropertyNames(_r17).length && (e.properties = _r17); | |
} | |
return fe("_parseDisconnect result: true"), !0; | |
} | |
}, { | |
key: "_parseAuth", | |
value: function _parseAuth() { | |
fe("_parseAuth"); | |
var e = this.packet; | |
if (this.settings.protocolVersion !== 5) return this._emitError(new Error("Not supported auth packet for this version MQTT")); | |
if (e.reasonCode = this._parseByte(), !be.MQTT5_AUTH_CODES[e.reasonCode]) return this._emitError(new Error("Invalid auth reason code")); | |
var r = this._parseProperties(); | |
return Object.getOwnPropertyNames(r).length && (e.properties = r), fe("_parseAuth: result: true"), !0; | |
} | |
}, { | |
key: "_parseMessageId", | |
value: function _parseMessageId() { | |
var e = this.packet; | |
return e.messageId = this._parseNum(), e.messageId === null ? (this._emitError(new Error("Cannot parse messageId")), !1) : (fe("_parseMessageId: packet.messageId %d", e.messageId), !0); | |
} | |
}, { | |
key: "_parseString", | |
value: function _parseString(e) { | |
var r = this._parseNum(), | |
n = r + this._pos; | |
if (r === -1 || n > this._list.length || n > this.packet.length) return null; | |
var i = this._list.toString("utf8", this._pos, n); | |
return this._pos += r, fe("_parseString: result: %s", i), i; | |
} | |
}, { | |
key: "_parseStringPair", | |
value: function _parseStringPair() { | |
return fe("_parseStringPair"), { | |
name: this._parseString(), | |
value: this._parseString() | |
}; | |
} | |
}, { | |
key: "_parseBuffer", | |
value: function _parseBuffer() { | |
var e = this._parseNum(), | |
r = e + this._pos; | |
if (e === -1 || r > this._list.length || r > this.packet.length) return null; | |
var n = this._list.slice(this._pos, r); | |
return this._pos += e, fe("_parseBuffer: result: %o", n), n; | |
} | |
}, { | |
key: "_parseNum", | |
value: function _parseNum() { | |
if (this._list.length - this._pos < 2) return -1; | |
var e = this._list.readUInt16BE(this._pos); | |
return this._pos += 2, fe("_parseNum: result: %s", e), e; | |
} | |
}, { | |
key: "_parse4ByteNum", | |
value: function _parse4ByteNum() { | |
if (this._list.length - this._pos < 4) return -1; | |
var e = this._list.readUInt32BE(this._pos); | |
return this._pos += 4, fe("_parse4ByteNum: result: %s", e), e; | |
} | |
}, { | |
key: "_parseVarByteNum", | |
value: function _parseVarByteNum(e) { | |
fe("_parseVarByteNum"); | |
var r = 4, | |
n = 0, | |
i = 1, | |
s = 0, | |
o = !1, | |
a, | |
l = this._pos ? this._pos : 0; | |
for (; n < r && l + n < this._list.length;) { | |
if (a = this._list.readUInt8(l + n++), s += i * (a & be.VARBYTEINT_MASK), i *= 128, !(a & be.VARBYTEINT_FIN_MASK)) { | |
o = !0; | |
break; | |
} | |
if (this._list.length <= n) break; | |
} | |
return !o && n === r && this._list.length >= n && this._emitError(new Error("Invalid variable byte integer")), l && (this._pos += n), o ? e ? o = { | |
bytes: n, | |
value: s | |
} : o = s : o = !1, fe("_parseVarByteNum: result: %o", o), o; | |
} | |
}, { | |
key: "_parseByte", | |
value: function _parseByte() { | |
var e; | |
return this._pos < this._list.length && (e = this._list.readUInt8(this._pos), this._pos++), fe("_parseByte: result: %o", e), e; | |
} | |
}, { | |
key: "_parseByType", | |
value: function _parseByType(e) { | |
switch (fe("_parseByType: type: %s", e), e) { | |
case "byte": | |
return this._parseByte() !== 0; | |
case "int8": | |
return this._parseByte(); | |
case "int16": | |
return this._parseNum(); | |
case "int32": | |
return this._parse4ByteNum(); | |
case "var": | |
return this._parseVarByteNum(); | |
case "string": | |
return this._parseString(); | |
case "pair": | |
return this._parseStringPair(); | |
case "binary": | |
return this._parseBuffer(); | |
} | |
} | |
}, { | |
key: "_parseProperties", | |
value: function _parseProperties() { | |
fe("_parseProperties"); | |
var e = this._parseVarByteNum(), | |
n = this._pos + e, | |
i = {}; | |
for (; this._pos < n;) { | |
var _s3 = this._parseByte(); | |
if (!_s3) return this._emitError(new Error("Cannot parse property code type")), !1; | |
var _o7 = be.propertiesCodes[_s3]; | |
if (!_o7) return this._emitError(new Error("Unknown property")), !1; | |
if (_o7 === "userProperties") { | |
i[_o7] || (i[_o7] = Object.create(null)); | |
var _a5 = this._parseByType(be.propertiesTypes[_o7]); | |
if (i[_o7][_a5.name]) { | |
if (Array.isArray(i[_o7][_a5.name])) i[_o7][_a5.name].push(_a5.value);else { | |
var _l13 = i[_o7][_a5.name]; | |
i[_o7][_a5.name] = [_l13], i[_o7][_a5.name].push(_a5.value); | |
} | |
} else i[_o7][_a5.name] = _a5.value; | |
continue; | |
} | |
i[_o7] ? Array.isArray(i[_o7]) ? i[_o7].push(this._parseByType(be.propertiesTypes[_o7])) : (i[_o7] = [i[_o7]], i[_o7].push(this._parseByType(be.propertiesTypes[_o7]))) : i[_o7] = this._parseByType(be.propertiesTypes[_o7]); | |
} | |
return i; | |
} | |
}, { | |
key: "_newPacket", | |
value: function _newPacket() { | |
return fe("_newPacket"), this.packet && (this._list.consume(this.packet.length), fe("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d", this.packet.cmd, this.packet.payload, this.packet.length), this.emit("packet", this.packet)), fe("_newPacket: new packet"), this.packet = new wy(), this._pos = 0, !0; | |
} | |
}, { | |
key: "_emitError", | |
value: function _emitError(e) { | |
fe("_emitError", e), this.error = e, this.emit("error", e); | |
} | |
}], [{ | |
key: "parser", | |
value: function parser(e) { | |
return this instanceof t ? (this.settings = e || {}, this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"], this._resetState(), this) : new t().parser(e); | |
} | |
}]); | |
}(KS); | |
by.exports = Au; | |
}); | |
var Ey = H(function (kk, Sy) { | |
P(); | |
O(); | |
R(); | |
var _ref21 = (ze(), Ie(Je)), | |
Wi = _ref21.Buffer, | |
GS = 65536, | |
my = {}, | |
QS = Wi.isBuffer(Wi.from([1, 2]).subarray(0, 1)); | |
function vy(t) { | |
var e = Wi.allocUnsafe(2); | |
return e.writeUInt8(t >> 8, 0), e.writeUInt8(t & 255, 1), e; | |
} | |
function YS() { | |
for (var t = 0; t < GS; t++) my[t] = vy(t); | |
} | |
function JS(t) { | |
var r = 0, | |
n = 0, | |
i = Wi.allocUnsafe(4); | |
do r = t % 128 | 0, t = t / 128 | 0, t > 0 && (r = r | 128), i.writeUInt8(r, n++); while (t > 0 && n < 4); | |
return t > 0 && (n = 0), QS ? i.subarray(0, n) : i.slice(0, n); | |
} | |
function XS(t) { | |
var e = Wi.allocUnsafe(4); | |
return e.writeUInt32BE(t, 0), e; | |
} | |
Sy.exports = { | |
cache: my, | |
generateCache: YS, | |
generateNumber: vy, | |
genBufVariableByteInt: JS, | |
generate4ByteBuffer: XS | |
}; | |
}); | |
var Ay = H(function (Fk, Iu) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
typeof L == "undefined" || !L.version || L.version.indexOf("v0.") === 0 || L.version.indexOf("v1.") === 0 && L.version.indexOf("v1.8.") !== 0 ? Iu.exports = { | |
nextTick: ZS | |
} : Iu.exports = L; | |
function ZS(t, e, r, n) { | |
if (typeof t != "function") throw new TypeError('"callback" argument must be a function'); | |
var i = arguments.length, | |
s, | |
o; | |
switch (i) { | |
case 0: | |
case 1: | |
return L.nextTick(t); | |
case 2: | |
return L.nextTick(function () { | |
t.call(null, e); | |
}); | |
case 3: | |
return L.nextTick(function () { | |
t.call(null, e, r); | |
}); | |
case 4: | |
return L.nextTick(function () { | |
t.call(null, e, r, n); | |
}); | |
default: | |
for (s = new Array(i - 1), o = 0; o < s.length;) s[o++] = arguments[o]; | |
return L.nextTick(function () { | |
t.apply(null, s); | |
}); | |
} | |
} | |
}); | |
var Ru = H(function (Kk, Cy) { | |
P(); | |
O(); | |
R(); | |
var ce = Eu(), | |
_ref22 = (ze(), Ie(Je)), | |
ae = _ref22.Buffer, | |
eE = ae.allocUnsafe(0), | |
tE = ae.from([0]), | |
$i = Ey(), | |
rE = Ay().nextTick, | |
Ct = sr()("mqtt-packet:writeToStream"), | |
as = $i.cache, | |
nE = $i.generateNumber, | |
iE = $i.generateCache, | |
Tu = $i.genBufVariableByteInt, | |
oE = $i.generate4ByteBuffer, | |
ct = Pu, | |
us = !0; | |
function xy(t, e, r) { | |
switch (Ct("generate called"), e.cork && (e.cork(), rE(sE, e)), us && (us = !1, iE()), Ct("generate: packet.cmd: %s", t.cmd), t.cmd) { | |
case "connect": | |
return aE(t, e, r); | |
case "connack": | |
return uE(t, e, r); | |
case "publish": | |
return lE(t, e, r); | |
case "puback": | |
case "pubrec": | |
case "pubrel": | |
case "pubcomp": | |
return fE(t, e, r); | |
case "subscribe": | |
return cE(t, e, r); | |
case "suback": | |
return hE(t, e, r); | |
case "unsubscribe": | |
return dE(t, e, r); | |
case "unsuback": | |
return pE(t, e, r); | |
case "pingreq": | |
case "pingresp": | |
return yE(t, e, r); | |
case "disconnect": | |
return gE(t, e, r); | |
case "auth": | |
return wE(t, e, r); | |
default: | |
return e.destroy(new Error("Unknown command")), !1; | |
} | |
} | |
Object.defineProperty(xy, "cacheNumbers", { | |
get: function get() { | |
return ct === Pu; | |
}, | |
set: function set(t) { | |
t ? ((!as || Object.keys(as).length === 0) && (us = !0), ct = Pu) : (us = !1, ct = bE); | |
} | |
}); | |
function sE(t) { | |
t.uncork(); | |
} | |
function aE(t, e, r) { | |
var n = t || {}, | |
i = n.protocolId || "MQTT", | |
s = n.protocolVersion || 4, | |
o = n.will, | |
a = n.clean, | |
l = n.keepalive || 0, | |
c = n.clientId || "", | |
d = n.username, | |
h = n.password, | |
m = n.properties; | |
a === void 0 && (a = !0); | |
var w = 0; | |
if (!i || typeof i != "string" && !ae.isBuffer(i)) return e.destroy(new Error("Invalid protocolId")), !1; | |
if (w += i.length + 2, s !== 3 && s !== 4 && s !== 5) return e.destroy(new Error("Invalid protocol version")), !1; | |
if (w += 1, (typeof c == "string" || ae.isBuffer(c)) && (c || s >= 4) && (c || a)) w += ae.byteLength(c) + 2;else { | |
if (s < 4) return e.destroy(new Error("clientId must be supplied before 3.1.1")), !1; | |
if (a * 1 === 0) return e.destroy(new Error("clientId must be given if cleanSession set to 0")), !1; | |
} | |
if (typeof l != "number" || l < 0 || l > 65535 || l % 1 !== 0) return e.destroy(new Error("Invalid keepalive")), !1; | |
w += 2, w += 1; | |
var T, v; | |
if (s === 5) { | |
if (T = $r(e, m), !T) return !1; | |
w += T.length; | |
} | |
if (o) { | |
if (_typeof(o) != "object") return e.destroy(new Error("Invalid will")), !1; | |
if (!o.topic || typeof o.topic != "string") return e.destroy(new Error("Invalid will topic")), !1; | |
if (w += ae.byteLength(o.topic) + 2, w += 2, o.payload) if (o.payload.length >= 0) typeof o.payload == "string" ? w += ae.byteLength(o.payload) : w += o.payload.length;else return e.destroy(new Error("Invalid will payload")), !1; | |
if (v = {}, s === 5) { | |
if (v = $r(e, o.properties), !v) return !1; | |
w += v.length; | |
} | |
} | |
var b = !1; | |
if (d != null) if (Oy(d)) b = !0, w += ae.byteLength(d) + 2;else return e.destroy(new Error("Invalid username")), !1; | |
if (h != null) { | |
if (!b) return e.destroy(new Error("Username is required to use password")), !1; | |
if (Oy(h)) w += By(h) + 2;else return e.destroy(new Error("Invalid password")), !1; | |
} | |
e.write(ce.CONNECT_HEADER), kt(e, w), ai(e, i), n.bridgeMode && (s += 128), e.write(s === 131 ? ce.VERSION131 : s === 132 ? ce.VERSION132 : s === 4 ? ce.VERSION4 : s === 5 ? ce.VERSION5 : ce.VERSION3); | |
var p = 0; | |
return p |= d != null ? ce.USERNAME_MASK : 0, p |= h != null ? ce.PASSWORD_MASK : 0, p |= o && o.retain ? ce.WILL_RETAIN_MASK : 0, p |= o && o.qos ? o.qos << ce.WILL_QOS_SHIFT : 0, p |= o ? ce.WILL_FLAG_MASK : 0, p |= a ? ce.CLEAN_SESSION_MASK : 0, e.write(ae.from([p])), ct(e, l), s === 5 && T.write(), ai(e, c), o && (s === 5 && v.write(), mn(e, o.topic), ai(e, o.payload)), d != null && ai(e, d), h != null && ai(e, h), !0; | |
} | |
function uE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = n === 5 ? i.reasonCode : i.returnCode, | |
o = i.properties, | |
a = 2; | |
if (typeof s != "number") return e.destroy(new Error("Invalid return code")), !1; | |
var l = null; | |
if (n === 5) { | |
if (l = $r(e, o), !l) return !1; | |
a += l.length; | |
} | |
return e.write(ce.CONNACK_HEADER), kt(e, a), e.write(i.sessionPresent ? ce.SESSIONPRESENT_HEADER : tE), e.write(ae.from([s])), l != null && l.write(), !0; | |
} | |
function lE(t, e, r) { | |
Ct("publish: packet: %o", t); | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.qos || 0, | |
o = i.retain ? ce.RETAIN_MASK : 0, | |
a = i.topic, | |
l = i.payload || eE, | |
c = i.messageId, | |
d = i.properties, | |
h = 0; | |
if (typeof a == "string") h += ae.byteLength(a) + 2;else if (ae.isBuffer(a)) h += a.length + 2;else return e.destroy(new Error("Invalid topic")), !1; | |
if (ae.isBuffer(l) ? h += l.length : h += ae.byteLength(l), s && typeof c != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
s && (h += 2); | |
var m = null; | |
if (n === 5) { | |
if (m = $r(e, d), !m) return !1; | |
h += m.length; | |
} | |
return e.write(ce.PUBLISH_HEADER[s][i.dup ? 1 : 0][o ? 1 : 0]), kt(e, h), ct(e, By(a)), e.write(a), s > 0 && ct(e, c), m != null && m.write(), Ct("publish: payload: %o", l), e.write(l); | |
} | |
function fE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.cmd || "puback", | |
o = i.messageId, | |
a = i.dup && s === "pubrel" ? ce.DUP_MASK : 0, | |
l = 0, | |
c = i.reasonCode, | |
d = i.properties, | |
h = n === 5 ? 3 : 2; | |
if (s === "pubrel" && (l = 1), typeof o != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
var m = null; | |
if (n === 5 && _typeof(d) == "object") { | |
if (m = Hi(e, d, r, h), !m) return !1; | |
h += m.length; | |
} | |
return e.write(ce.ACKS[s][l][a][0]), h === 3 && (h += c !== 0 ? 1 : -1), kt(e, h), ct(e, o), n === 5 && h !== 2 && e.write(ae.from([c])), m !== null ? m.write() : h === 4 && e.write(ae.from([0])), !0; | |
} | |
function cE(t, e, r) { | |
Ct("subscribe: packet: "); | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.dup ? ce.DUP_MASK : 0, | |
o = i.messageId, | |
a = i.subscriptions, | |
l = i.properties, | |
c = 0; | |
if (typeof o != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
c += 2; | |
var d = null; | |
if (n === 5) { | |
if (d = $r(e, l), !d) return !1; | |
c += d.length; | |
} | |
if (_typeof(a) == "object" && a.length) for (var _m5 = 0; _m5 < a.length; _m5 += 1) { | |
var _w7 = a[_m5].topic, | |
_T3 = a[_m5].qos; | |
if (typeof _w7 != "string") return e.destroy(new Error("Invalid subscriptions - invalid topic")), !1; | |
if (typeof _T3 != "number") return e.destroy(new Error("Invalid subscriptions - invalid qos")), !1; | |
if (n === 5) { | |
if (typeof (a[_m5].nl || !1) != "boolean") return e.destroy(new Error("Invalid subscriptions - invalid No Local")), !1; | |
if (typeof (a[_m5].rap || !1) != "boolean") return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")), !1; | |
var _p3 = a[_m5].rh || 0; | |
if (typeof _p3 != "number" || _p3 > 2) return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")), !1; | |
} | |
c += ae.byteLength(_w7) + 2 + 1; | |
} else return e.destroy(new Error("Invalid subscriptions")), !1; | |
Ct("subscribe: writing to stream: %o", ce.SUBSCRIBE_HEADER), e.write(ce.SUBSCRIBE_HEADER[1][s ? 1 : 0][0]), kt(e, c), ct(e, o), d !== null && d.write(); | |
var h = !0; | |
var _iterator8 = _createForOfIteratorHelper(a), | |
_step8; | |
try { | |
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { | |
var _m6 = _step8.value; | |
var _w8 = _m6.topic, | |
_T4 = _m6.qos, | |
_v4 = +_m6.nl, | |
_b8 = +_m6.rap, | |
_p4 = _m6.rh, | |
_ = void 0; | |
mn(e, _w8), _ = ce.SUBSCRIBE_OPTIONS_QOS[_T4], n === 5 && (_ |= _v4 ? ce.SUBSCRIBE_OPTIONS_NL : 0, _ |= _b8 ? ce.SUBSCRIBE_OPTIONS_RAP : 0, _ |= _p4 ? ce.SUBSCRIBE_OPTIONS_RH[_p4] : 0), h = e.write(ae.from([_])); | |
} | |
} catch (err) { | |
_iterator8.e(err); | |
} finally { | |
_iterator8.f(); | |
} | |
return h; | |
} | |
function hE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.messageId, | |
o = i.granted, | |
a = i.properties, | |
l = 0; | |
if (typeof s != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
if (l += 2, _typeof(o) == "object" && o.length) for (var _d2 = 0; _d2 < o.length; _d2 += 1) { | |
if (typeof o[_d2] != "number") return e.destroy(new Error("Invalid qos vector")), !1; | |
l += 1; | |
} else return e.destroy(new Error("Invalid qos vector")), !1; | |
var c = null; | |
if (n === 5) { | |
if (c = Hi(e, a, r, l), !c) return !1; | |
l += c.length; | |
} | |
return e.write(ce.SUBACK_HEADER), kt(e, l), ct(e, s), c !== null && c.write(), e.write(ae.from(o)); | |
} | |
function dE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.messageId, | |
o = i.dup ? ce.DUP_MASK : 0, | |
a = i.unsubscriptions, | |
l = i.properties, | |
c = 0; | |
if (typeof s != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
if (c += 2, _typeof(a) == "object" && a.length) for (var _m7 = 0; _m7 < a.length; _m7 += 1) { | |
if (typeof a[_m7] != "string") return e.destroy(new Error("Invalid unsubscriptions")), !1; | |
c += ae.byteLength(a[_m7]) + 2; | |
} else return e.destroy(new Error("Invalid unsubscriptions")), !1; | |
var d = null; | |
if (n === 5) { | |
if (d = $r(e, l), !d) return !1; | |
c += d.length; | |
} | |
e.write(ce.UNSUBSCRIBE_HEADER[1][o ? 1 : 0][0]), kt(e, c), ct(e, s), d !== null && d.write(); | |
var h = !0; | |
for (var _m8 = 0; _m8 < a.length; _m8++) h = mn(e, a[_m8]); | |
return h; | |
} | |
function pE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.messageId, | |
o = i.dup ? ce.DUP_MASK : 0, | |
a = i.granted, | |
l = i.properties, | |
c = i.cmd, | |
d = 0, | |
h = 2; | |
if (typeof s != "number") return e.destroy(new Error("Invalid messageId")), !1; | |
if (n === 5) if (_typeof(a) == "object" && a.length) for (var _w9 = 0; _w9 < a.length; _w9 += 1) { | |
if (typeof a[_w9] != "number") return e.destroy(new Error("Invalid qos vector")), !1; | |
h += 1; | |
} else return e.destroy(new Error("Invalid qos vector")), !1; | |
var m = null; | |
if (n === 5) { | |
if (m = Hi(e, l, r, h), !m) return !1; | |
h += m.length; | |
} | |
return e.write(ce.ACKS[c][d][o][0]), kt(e, h), ct(e, s), m !== null && m.write(), n === 5 && e.write(ae.from(a)), !0; | |
} | |
function yE(t, e, r) { | |
return e.write(ce.EMPTY[t.cmd]); | |
} | |
function gE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.reasonCode, | |
o = i.properties, | |
a = n === 5 ? 1 : 0, | |
l = null; | |
if (n === 5) { | |
if (l = Hi(e, o, r, a), !l) return !1; | |
a += l.length; | |
} | |
return e.write(ae.from([ce.codes.disconnect << 4])), kt(e, a), n === 5 && e.write(ae.from([s])), l !== null && l.write(), !0; | |
} | |
function wE(t, e, r) { | |
var n = r ? r.protocolVersion : 4, | |
i = t || {}, | |
s = i.reasonCode, | |
o = i.properties, | |
a = n === 5 ? 1 : 0; | |
n !== 5 && e.destroy(new Error("Invalid mqtt version for auth packet")); | |
var l = Hi(e, o, r, a); | |
return l ? (a += l.length, e.write(ae.from([ce.codes.auth << 4])), kt(e, a), e.write(ae.from([s])), l !== null && l.write(), !0) : !1; | |
} | |
var Iy = {}; | |
function kt(t, e) { | |
if (e > ce.VARBYTEINT_MAX) return t.destroy(new Error("Invalid variable byte integer: ".concat(e))), !1; | |
var r = Iy[e]; | |
return r || (r = Tu(e), e < 16384 && (Iy[e] = r)), Ct("writeVarByteInt: writing to stream: %o", r), t.write(r); | |
} | |
function mn(t, e) { | |
var r = ae.byteLength(e); | |
return ct(t, r), Ct("writeString: %s", e), t.write(e, "utf8"); | |
} | |
function Ty(t, e, r) { | |
mn(t, e), mn(t, r); | |
} | |
function Pu(t, e) { | |
return Ct("writeNumberCached: number: %d", e), Ct("writeNumberCached: %o", as[e]), t.write(as[e]); | |
} | |
function bE(t, e) { | |
var r = nE(e); | |
return Ct("writeNumberGenerated: %o", r), t.write(r); | |
} | |
function _E(t, e) { | |
var r = oE(e); | |
return Ct("write4ByteNumber: %o", r), t.write(r); | |
} | |
function ai(t, e) { | |
typeof e == "string" ? mn(t, e) : e ? (ct(t, e.length), t.write(e)) : ct(t, 0); | |
} | |
function $r(t, e) { | |
if (_typeof(e) != "object" || e.length != null) return { | |
length: 1, | |
write: function write() { | |
Ry(t, {}, 0); | |
} | |
}; | |
var r = 0; | |
function n(s, o) { | |
var a = ce.propertiesTypes[s], | |
l = 0; | |
switch (a) { | |
case "byte": | |
{ | |
if (typeof o != "boolean") return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 2; | |
break; | |
} | |
case "int8": | |
{ | |
if (typeof o != "number" || o < 0 || o > 255) return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 2; | |
break; | |
} | |
case "binary": | |
{ | |
if (o && o === null) return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 1 + ae.byteLength(o) + 2; | |
break; | |
} | |
case "int16": | |
{ | |
if (typeof o != "number" || o < 0 || o > 65535) return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 3; | |
break; | |
} | |
case "int32": | |
{ | |
if (typeof o != "number" || o < 0 || o > 4294967295) return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 5; | |
break; | |
} | |
case "var": | |
{ | |
if (typeof o != "number" || o < 0 || o > 268435455) return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 1 + ae.byteLength(Tu(o)); | |
break; | |
} | |
case "string": | |
{ | |
if (typeof o != "string") return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += 3 + ae.byteLength(o.toString()); | |
break; | |
} | |
case "pair": | |
{ | |
if (_typeof(o) != "object") return t.destroy(new Error("Invalid ".concat(s, ": ").concat(o))), !1; | |
l += Object.getOwnPropertyNames(o).reduce(function (c, d) { | |
var h = o[d]; | |
return Array.isArray(h) ? c += h.reduce(function (m, w) { | |
return m += 3 + ae.byteLength(d.toString()) + 2 + ae.byteLength(w.toString()), m; | |
}, 0) : c += 3 + ae.byteLength(d.toString()) + 2 + ae.byteLength(o[d].toString()), c; | |
}, 0); | |
break; | |
} | |
default: | |
return t.destroy(new Error("Invalid property ".concat(s, ": ").concat(o))), !1; | |
} | |
return l; | |
} | |
if (e) for (var _s4 in e) { | |
var _o8 = 0, | |
_a6 = 0, | |
_l14 = e[_s4]; | |
if (Array.isArray(_l14)) for (var _c5 = 0; _c5 < _l14.length; _c5++) { | |
if (_a6 = n(_s4, _l14[_c5]), !_a6) return !1; | |
_o8 += _a6; | |
} else { | |
if (_a6 = n(_s4, _l14), !_a6) return !1; | |
_o8 = _a6; | |
} | |
if (!_o8) return !1; | |
r += _o8; | |
} | |
return { | |
length: ae.byteLength(Tu(r)) + r, | |
write: function write() { | |
Ry(t, e, r); | |
} | |
}; | |
} | |
function Hi(t, e, r, n) { | |
var i = ["reasonString", "userProperties"], | |
s = r && r.properties && r.properties.maximumPacketSize ? r.properties.maximumPacketSize : 0, | |
o = $r(t, e); | |
if (s) for (; n + o.length > s;) { | |
var _a7 = i.shift(); | |
if (_a7 && e[_a7]) delete e[_a7], o = $r(t, e);else return !1; | |
} | |
return o; | |
} | |
function Py(t, e, r) { | |
switch (ce.propertiesTypes[e]) { | |
case "byte": | |
{ | |
t.write(ae.from([ce.properties[e]])), t.write(ae.from([+r])); | |
break; | |
} | |
case "int8": | |
{ | |
t.write(ae.from([ce.properties[e]])), t.write(ae.from([r])); | |
break; | |
} | |
case "binary": | |
{ | |
t.write(ae.from([ce.properties[e]])), ai(t, r); | |
break; | |
} | |
case "int16": | |
{ | |
t.write(ae.from([ce.properties[e]])), ct(t, r); | |
break; | |
} | |
case "int32": | |
{ | |
t.write(ae.from([ce.properties[e]])), _E(t, r); | |
break; | |
} | |
case "var": | |
{ | |
t.write(ae.from([ce.properties[e]])), kt(t, r); | |
break; | |
} | |
case "string": | |
{ | |
t.write(ae.from([ce.properties[e]])), mn(t, r); | |
break; | |
} | |
case "pair": | |
{ | |
Object.getOwnPropertyNames(r).forEach(function (i) { | |
var s = r[i]; | |
Array.isArray(s) ? s.forEach(function (o) { | |
t.write(ae.from([ce.properties[e]])), Ty(t, i.toString(), o.toString()); | |
}) : (t.write(ae.from([ce.properties[e]])), Ty(t, i.toString(), s.toString())); | |
}); | |
break; | |
} | |
default: | |
return t.destroy(new Error("Invalid property ".concat(e, " value: ").concat(r))), !1; | |
} | |
} | |
function Ry(t, e, r) { | |
kt(t, r); | |
for (var n in e) if (Object.prototype.hasOwnProperty.call(e, n) && e[n] !== null) { | |
var i = e[n]; | |
if (Array.isArray(i)) for (var _s5 = 0; _s5 < i.length; _s5++) Py(t, n, i[_s5]);else Py(t, n, i); | |
} | |
} | |
function By(t) { | |
return t ? t instanceof ae ? t.length : ae.byteLength(t) : 0; | |
} | |
function Oy(t) { | |
return typeof t == "string" || t instanceof ae; | |
} | |
Cy.exports = xy; | |
}); | |
var Ny = H(function (eM, My) { | |
P(); | |
O(); | |
R(); | |
var mE = Ru(), | |
_ref23 = (qr(), Ie(Lr)), | |
vE = _ref23.EventEmitter, | |
_ref24 = (ze(), Ie(Je)), | |
ky = _ref24.Buffer; | |
function SE(t, e) { | |
var r = new Ou(); | |
return mE(t, r, e), r.concat(); | |
} | |
var Ou = /*#__PURE__*/function (_vE) { | |
function Ou() { | |
var _this16; | |
_classCallCheck(this, Ou); | |
_this16 = _callSuper(this, Ou), _this16._array = new Array(20), _this16._i = 0; | |
return _this16; | |
} | |
_inherits(Ou, _vE); | |
return _createClass(Ou, [{ | |
key: "write", | |
value: function write(e) { | |
return this._array[this._i++] = e, !0; | |
} | |
}, { | |
key: "concat", | |
value: function concat() { | |
var e = 0, | |
r = new Array(this._array.length), | |
n = this._array, | |
i = 0, | |
s; | |
for (s = 0; s < n.length && n[s] !== void 0; s++) typeof n[s] != "string" ? r[s] = n[s].length : r[s] = ky.byteLength(n[s]), e += r[s]; | |
var o = ky.allocUnsafe(e); | |
for (s = 0; s < n.length && n[s] !== void 0; s++) typeof n[s] != "string" ? (n[s].copy(o, i), i += r[s]) : (o.write(n[s], i), i += r[s]); | |
return o; | |
} | |
}, { | |
key: "destroy", | |
value: function destroy(e) { | |
e && this.emit("error", e); | |
} | |
}]); | |
}(vE); | |
My.exports = SE; | |
}); | |
var Ly = H(function (ls) { | |
P(); | |
O(); | |
R(); | |
ls.parser = _y().parser; | |
ls.generate = Ny(); | |
ls.writeToStream = Ru(); | |
}); | |
var Bu = H(function (xu) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(xu, "__esModule", { | |
value: !0 | |
}); | |
var EE = function () { | |
function t() { | |
this.nextId = Math.max(1, Math.floor(Math.random() * 65535)); | |
} | |
return t.prototype.allocate = function () { | |
var e = this.nextId++; | |
return this.nextId === 65536 && (this.nextId = 1), e; | |
}, t.prototype.getLastAllocated = function () { | |
return this.nextId === 1 ? 65535 : this.nextId - 1; | |
}, t.prototype.register = function (e) { | |
return !0; | |
}, t.prototype.deallocate = function (e) {}, t.prototype.clear = function () {}, t; | |
}(); | |
xu["default"] = EE; | |
}); | |
var Uy = H(function (vM, qy) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
qy.exports = AE; | |
function ui(t) { | |
return t instanceof W ? W.from(t) : new t.constructor(t.buffer.slice(), t.byteOffset, t.length); | |
} | |
function AE(t) { | |
if (t = t || {}, t.circles) return IE(t); | |
var e = new Map(); | |
if (e.set(Date, function (o) { | |
return new Date(o); | |
}), e.set(Map, function (o, a) { | |
return new Map(n(Array.from(o), a)); | |
}), e.set(Set, function (o, a) { | |
return new Set(n(Array.from(o), a)); | |
}), t.constructorHandlers) { | |
var _iterator9 = _createForOfIteratorHelper(t.constructorHandlers), | |
_step9; | |
try { | |
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { | |
var _o9 = _step9.value; | |
e.set(_o9[0], _o9[1]); | |
} | |
} catch (err) { | |
_iterator9.e(err); | |
} finally { | |
_iterator9.f(); | |
} | |
} | |
var r = null; | |
return t.proto ? s : i; | |
function n(o, a) { | |
var l = Object.keys(o), | |
c = new Array(l.length); | |
for (var _d3 = 0; _d3 < l.length; _d3++) { | |
var _h7 = l[_d3], | |
_m9 = o[_h7]; | |
_typeof(_m9) != "object" || _m9 === null ? c[_h7] = _m9 : _m9.constructor !== Object && (r = e.get(_m9.constructor)) ? c[_h7] = r(_m9, a) : ArrayBuffer.isView(_m9) ? c[_h7] = ui(_m9) : c[_h7] = a(_m9); | |
} | |
return c; | |
} | |
function i(o) { | |
if (_typeof(o) != "object" || o === null) return o; | |
if (Array.isArray(o)) return n(o, i); | |
if (o.constructor !== Object && (r = e.get(o.constructor))) return r(o, i); | |
var a = {}; | |
for (var _l15 in o) { | |
if (Object.hasOwnProperty.call(o, _l15) === !1) continue; | |
var _c6 = o[_l15]; | |
_typeof(_c6) != "object" || _c6 === null ? a[_l15] = _c6 : _c6.constructor !== Object && (r = e.get(_c6.constructor)) ? a[_l15] = r(_c6, i) : ArrayBuffer.isView(_c6) ? a[_l15] = ui(_c6) : a[_l15] = i(_c6); | |
} | |
return a; | |
} | |
function s(o) { | |
if (_typeof(o) != "object" || o === null) return o; | |
if (Array.isArray(o)) return n(o, s); | |
if (o.constructor !== Object && (r = e.get(o.constructor))) return r(o, s); | |
var a = {}; | |
for (var _l16 in o) { | |
var _c7 = o[_l16]; | |
_typeof(_c7) != "object" || _c7 === null ? a[_l16] = _c7 : _c7.constructor !== Object && (r = e.get(_c7.constructor)) ? a[_l16] = r(_c7, s) : ArrayBuffer.isView(_c7) ? a[_l16] = ui(_c7) : a[_l16] = s(_c7); | |
} | |
return a; | |
} | |
} | |
function IE(t) { | |
var e = [], | |
r = [], | |
n = new Map(); | |
if (n.set(Date, function (l) { | |
return new Date(l); | |
}), n.set(Map, function (l, c) { | |
return new Map(s(Array.from(l), c)); | |
}), n.set(Set, function (l, c) { | |
return new Set(s(Array.from(l), c)); | |
}), t.constructorHandlers) { | |
var _iterator10 = _createForOfIteratorHelper(t.constructorHandlers), | |
_step10; | |
try { | |
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { | |
var _l17 = _step10.value; | |
n.set(_l17[0], _l17[1]); | |
} | |
} catch (err) { | |
_iterator10.e(err); | |
} finally { | |
_iterator10.f(); | |
} | |
} | |
var i = null; | |
return t.proto ? a : o; | |
function s(l, c) { | |
var d = Object.keys(l), | |
h = new Array(d.length); | |
for (var _m10 = 0; _m10 < d.length; _m10++) { | |
var _w10 = d[_m10], | |
_T5 = l[_w10]; | |
if (_typeof(_T5) != "object" || _T5 === null) h[_w10] = _T5;else if (_T5.constructor !== Object && (i = n.get(_T5.constructor))) h[_w10] = i(_T5, c);else if (ArrayBuffer.isView(_T5)) h[_w10] = ui(_T5);else { | |
var _v5 = e.indexOf(_T5); | |
_v5 !== -1 ? h[_w10] = r[_v5] : h[_w10] = c(_T5); | |
} | |
} | |
return h; | |
} | |
function o(l) { | |
if (_typeof(l) != "object" || l === null) return l; | |
if (Array.isArray(l)) return s(l, o); | |
if (l.constructor !== Object && (i = n.get(l.constructor))) return i(l, o); | |
var c = {}; | |
e.push(l), r.push(c); | |
for (var _d4 in l) { | |
if (Object.hasOwnProperty.call(l, _d4) === !1) continue; | |
var _h8 = l[_d4]; | |
if (_typeof(_h8) != "object" || _h8 === null) c[_d4] = _h8;else if (_h8.constructor !== Object && (i = n.get(_h8.constructor))) c[_d4] = i(_h8, o);else if (ArrayBuffer.isView(_h8)) c[_d4] = ui(_h8);else { | |
var _m11 = e.indexOf(_h8); | |
_m11 !== -1 ? c[_d4] = r[_m11] : c[_d4] = o(_h8); | |
} | |
} | |
return e.pop(), r.pop(), c; | |
} | |
function a(l) { | |
if (_typeof(l) != "object" || l === null) return l; | |
if (Array.isArray(l)) return s(l, a); | |
if (l.constructor !== Object && (i = n.get(l.constructor))) return i(l, a); | |
var c = {}; | |
e.push(l), r.push(c); | |
for (var _d5 in l) { | |
var _h9 = l[_d5]; | |
if (_typeof(_h9) != "object" || _h9 === null) c[_d5] = _h9;else if (_h9.constructor !== Object && (i = n.get(_h9.constructor))) c[_d5] = i(_h9, a);else if (ArrayBuffer.isView(_h9)) c[_d5] = ui(_h9);else { | |
var _m12 = e.indexOf(_h9); | |
_m12 !== -1 ? c[_d5] = r[_m12] : c[_d5] = a(_h9); | |
} | |
} | |
return e.pop(), r.pop(), c; | |
} | |
} | |
}); | |
var Fy = H(function (RM, Dy) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Dy.exports = Uy()(); | |
}); | |
var Wy = H(function (fs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(fs, "__esModule", { | |
value: !0 | |
}); | |
fs.validateTopic = jy; | |
fs.validateTopics = TE; | |
function jy(t) { | |
for (var e = t.split("/"), r = 0; r < e.length; r++) if (e[r] !== "+") { | |
if (e[r] === "#") return r === e.length - 1; | |
if (e[r].indexOf("+") !== -1 || e[r].indexOf("#") !== -1) return !1; | |
} | |
return !0; | |
} | |
function TE(t) { | |
if (t.length === 0) return "empty_topic_list"; | |
for (var e = 0; e < t.length; e++) if (!jy(t[e])) return t[e]; | |
return null; | |
} | |
}); | |
var Cu = H(function (Vi) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var cs = Vi && Vi.__assign || function () { | |
return cs = Object.assign || function (t) { | |
for (var e, r = 1, n = arguments.length; r < n; r++) { | |
e = arguments[r]; | |
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); | |
} | |
return t; | |
}, cs.apply(this, arguments); | |
}; | |
Object.defineProperty(Vi, "__esModule", { | |
value: !0 | |
}); | |
var PE = Tr(), | |
RE = { | |
objectMode: !0 | |
}, | |
OE = { | |
clean: !0 | |
}, | |
xE = function () { | |
function t(e) { | |
this.options = e || {}, this.options = cs(cs({}, OE), e), this._inflights = new Map(); | |
} | |
return t.prototype.put = function (e, r) { | |
return this._inflights.set(e.messageId, e), r && r(), this; | |
}, t.prototype.createStream = function () { | |
var e = new PE.Readable(RE), | |
r = [], | |
n = !1, | |
i = 0; | |
return this._inflights.forEach(function (s, o) { | |
r.push(s); | |
}), e._read = function () { | |
!n && i < r.length ? e.push(r[i++]) : e.push(null); | |
}, e.destroy = function (s) { | |
if (!n) return n = !0, setTimeout(function () { | |
e.emit("close"); | |
}, 0), e; | |
}, e; | |
}, t.prototype.del = function (e, r) { | |
var n = this._inflights.get(e.messageId); | |
return n ? (this._inflights["delete"](e.messageId), r(null, n)) : r && r(new Error("missing packet")), this; | |
}, t.prototype.get = function (e, r) { | |
var n = this._inflights.get(e.messageId); | |
return n ? r(null, n) : r && r(new Error("missing packet")), this; | |
}, t.prototype.close = function (e) { | |
this.options.clean && (this._inflights = null), e && e(); | |
}, t; | |
}(); | |
Vi["default"] = xE; | |
}); | |
var Hy = H(function (ku) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(ku, "__esModule", { | |
value: !0 | |
}); | |
var $y = [0, 16, 128, 131, 135, 144, 145, 151, 153], | |
BE = function BE(t, e, r) { | |
t.log("handlePublish: packet %o", e), r = typeof r != "undefined" ? r : t.noop; | |
var n = e.topic.toString(), | |
i = e.payload, | |
s = e.qos, | |
o = e.messageId, | |
a = t.options; | |
if (t.options.protocolVersion === 5) { | |
var l = void 0; | |
if (e.properties && (l = e.properties.topicAlias), typeof l != "undefined") if (n.length === 0) { | |
if (l > 0 && l <= 65535) { | |
var c = t.topicAliasRecv.getTopicByAlias(l); | |
if (c) n = c, t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d", n, l);else { | |
t.log("handlePublish :: unregistered topic alias. alias: %d", l), t.emit("error", new Error("Received unregistered Topic Alias")); | |
return; | |
} | |
} else { | |
t.log("handlePublish :: topic alias out of range. alias: %d", l), t.emit("error", new Error("Received Topic Alias is out of range")); | |
return; | |
} | |
} else if (t.topicAliasRecv.put(n, l)) t.log("handlePublish :: registered topic: %s - alias: %d", n, l);else { | |
t.log("handlePublish :: topic alias out of range. alias: %d", l), t.emit("error", new Error("Received Topic Alias is out of range")); | |
return; | |
} | |
} | |
switch (t.log("handlePublish: qos %d", s), s) { | |
case 2: | |
{ | |
a.customHandleAcks(n, i, e, function (d, h) { | |
if (typeof d == "number" && (h = d, d = null), d) return t.emit("error", d); | |
if ($y.indexOf(h) === -1) return t.emit("error", new Error("Wrong reason code for pubrec")); | |
h ? t._sendPacket({ | |
cmd: "pubrec", | |
messageId: o, | |
reasonCode: h | |
}, r) : t.incomingStore.put(e, function () { | |
t._sendPacket({ | |
cmd: "pubrec", | |
messageId: o | |
}, r); | |
}); | |
}); | |
break; | |
} | |
case 1: | |
{ | |
a.customHandleAcks(n, i, e, function (d, h) { | |
if (typeof d == "number" && (h = d, d = null), d) return t.emit("error", d); | |
if ($y.indexOf(h) === -1) return t.emit("error", new Error("Wrong reason code for puback")); | |
h || t.emit("message", n, i, e), t.handleMessage(e, function (m) { | |
if (m) return r && r(m); | |
t._sendPacket({ | |
cmd: "puback", | |
messageId: o, | |
reasonCode: h | |
}, r); | |
}); | |
}); | |
break; | |
} | |
case 0: | |
t.emit("message", n, i, e), t.handleMessage(e, r); | |
break; | |
default: | |
t.log("handlePublish: unknown QoS. Doing nothing."); | |
break; | |
} | |
}; | |
ku["default"] = BE; | |
}); | |
var Vy = H(function (r2, CE) { | |
CE.exports = { | |
version: "5.10.3" | |
}; | |
}); | |
var vn = H(function (mt) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var kE = mt && mt.__extends || function () { | |
var _t4 = function t(e, r) { | |
return _t4 = Object.setPrototypeOf || { | |
__proto__: [] | |
} instanceof Array && function (n, i) { | |
n.__proto__ = i; | |
} || function (n, i) { | |
for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (n[s] = i[s]); | |
}, _t4(e, r); | |
}; | |
return function (e, r) { | |
if (typeof r != "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); | |
_t4(e, r); | |
function n() { | |
this.constructor = e; | |
} | |
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n()); | |
}; | |
}(), | |
zy = mt && mt.__values || function (t) { | |
var e = typeof Symbol == "function" && Symbol.iterator, | |
r = e && t[e], | |
n = 0; | |
if (r) return r.call(t); | |
if (t && typeof t.length == "number") return { | |
next: function next() { | |
return t && n >= t.length && (t = void 0), { | |
value: t && t[n++], | |
done: !t | |
}; | |
} | |
}; | |
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); | |
}; | |
Object.defineProperty(mt, "__esModule", { | |
value: !0 | |
}); | |
mt.MQTTJS_VERSION = mt.nextTick = mt.ErrorWithReasonCode = void 0; | |
mt.applyMixin = NE; | |
var ME = function (t) { | |
kE(e, t); | |
function e(r, n) { | |
var i = t.call(this, r) || this; | |
return i.code = n, Object.setPrototypeOf(i, e.prototype), Object.getPrototypeOf(i).name = "ErrorWithReasonCode", i; | |
} | |
return e; | |
}(Error); | |
mt.ErrorWithReasonCode = ME; | |
function NE(t, e, r) { | |
var n, i, s, o, a; | |
r === void 0 && (r = !1); | |
for (var l = [e];;) { | |
var c = l[0], | |
d = Object.getPrototypeOf(c); | |
if (d != null && d.prototype) l.unshift(d);else break; | |
} | |
try { | |
for (var h = zy(l), m = h.next(); !m.done; m = h.next()) { | |
var w = m.value; | |
try { | |
for (var T = (s = void 0, zy(Object.getOwnPropertyNames(w.prototype))), v = T.next(); !v.done; v = T.next()) { | |
var b = v.value; | |
(r || b !== "constructor") && Object.defineProperty(t.prototype, b, (a = Object.getOwnPropertyDescriptor(w.prototype, b)) !== null && a !== void 0 ? a : Object.create(null)); | |
} | |
} catch (p) { | |
s = { | |
error: p | |
}; | |
} finally { | |
try { | |
v && !v.done && (o = T["return"]) && o.call(T); | |
} finally { | |
if (s) throw s.error; | |
} | |
} | |
} | |
} catch (p) { | |
n = { | |
error: p | |
}; | |
} finally { | |
try { | |
m && !m.done && (i = h["return"]) && i.call(h); | |
} finally { | |
if (n) throw n.error; | |
} | |
} | |
} | |
mt.nextTick = typeof (L === null || L === void 0 ? void 0 : L.nextTick) == "function" ? L.nextTick : function (t) { | |
setTimeout(t, 0); | |
}; | |
mt.MQTTJS_VERSION = Vy().version; | |
}); | |
var zi = H(function (Hr) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Hr, "__esModule", { | |
value: !0 | |
}); | |
Hr.ReasonCodes = void 0; | |
var Ky = vn(); | |
Hr.ReasonCodes = { | |
0: "", | |
1: "Unacceptable protocol version", | |
2: "Identifier rejected", | |
3: "Server unavailable", | |
4: "Bad username or password", | |
5: "Not authorized", | |
16: "No matching subscribers", | |
17: "No subscription existed", | |
128: "Unspecified error", | |
129: "Malformed Packet", | |
130: "Protocol Error", | |
131: "Implementation specific error", | |
132: "Unsupported Protocol Version", | |
133: "Client Identifier not valid", | |
134: "Bad User Name or Password", | |
135: "Not authorized", | |
136: "Server unavailable", | |
137: "Server busy", | |
138: "Banned", | |
139: "Server shutting down", | |
140: "Bad authentication method", | |
141: "Keep Alive timeout", | |
142: "Session taken over", | |
143: "Topic Filter invalid", | |
144: "Topic Name invalid", | |
145: "Packet identifier in use", | |
146: "Packet Identifier not found", | |
147: "Receive Maximum exceeded", | |
148: "Topic Alias invalid", | |
149: "Packet too large", | |
150: "Message rate too high", | |
151: "Quota exceeded", | |
152: "Administrative action", | |
153: "Payload format invalid", | |
154: "Retain not supported", | |
155: "QoS not supported", | |
156: "Use another server", | |
157: "Server moved", | |
158: "Shared Subscriptions not supported", | |
159: "Connection rate exceeded", | |
160: "Maximum connect time", | |
161: "Subscription Identifiers not supported", | |
162: "Wildcard Subscriptions not supported" | |
}; | |
var LE = function LE(t, e) { | |
var r = e.messageId, | |
n = e.cmd, | |
i = null, | |
s = t.outgoing[r] ? t.outgoing[r].cb : null, | |
o = null; | |
if (!s) { | |
t.log("_handleAck :: Server sent an ack in error. Ignoring."); | |
return; | |
} | |
switch (t.log("_handleAck :: packet type", n), n) { | |
case "pubcomp": | |
case "puback": | |
{ | |
var a = e.reasonCode; | |
a && a > 0 && a !== 16 ? (o = new Ky.ErrorWithReasonCode("Publish error: ".concat(Hr.ReasonCodes[a]), a), t._removeOutgoingAndStoreMessage(r, function () { | |
s(o, e); | |
})) : t._removeOutgoingAndStoreMessage(r, s); | |
break; | |
} | |
case "pubrec": | |
{ | |
i = { | |
cmd: "pubrel", | |
qos: 2, | |
messageId: r | |
}; | |
var l = e.reasonCode; | |
l && l > 0 && l !== 16 ? (o = new Ky.ErrorWithReasonCode("Publish error: ".concat(Hr.ReasonCodes[l]), l), t._removeOutgoingAndStoreMessage(r, function () { | |
s(o, e); | |
})) : t._sendPacket(i); | |
break; | |
} | |
case "suback": | |
{ | |
delete t.outgoing[r], t.messageIdProvider.deallocate(r); | |
for (var c = e.granted, d = 0; d < c.length; d++) { | |
var h = c[d]; | |
if (h & 128) { | |
o = new Error("Subscribe error: ".concat(Hr.ReasonCodes[h])), o.code = h; | |
var m = t.messageIdToTopic[r]; | |
m && m.forEach(function (w) { | |
delete t._resubscribeTopics[w]; | |
}); | |
} | |
} | |
delete t.messageIdToTopic[r], t._invokeStoreProcessingQueue(), s(o, e); | |
break; | |
} | |
case "unsuback": | |
{ | |
delete t.outgoing[r], t.messageIdProvider.deallocate(r), t._invokeStoreProcessingQueue(), s(null, e); | |
break; | |
} | |
default: | |
t.emit("error", new Error("unrecognized packet type")); | |
} | |
t.disconnecting && Object.keys(t.outgoing).length === 0 && t.emit("outgoingEmpty"); | |
}; | |
Hr["default"] = LE; | |
}); | |
var Qy = H(function (Mu) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Mu, "__esModule", { | |
value: !0 | |
}); | |
var Gy = vn(), | |
qE = zi(), | |
UE = function UE(t, e) { | |
var r = t.options, | |
n = r.protocolVersion, | |
i = n === 5 ? e.reasonCode : e.returnCode; | |
if (n !== 5) { | |
var s = new Gy.ErrorWithReasonCode("Protocol error: Auth packets are only supported in MQTT 5. Your version:".concat(n), i); | |
t.emit("error", s); | |
return; | |
} | |
t.handleAuth(e, function (o, a) { | |
if (o) { | |
t.emit("error", o); | |
return; | |
} | |
if (i === 24) t.reconnecting = !1, t._sendPacket(a);else { | |
var l = new Gy.ErrorWithReasonCode("Connection refused: ".concat(qE.ReasonCodes[i]), i); | |
t.emit("error", l); | |
} | |
}); | |
}; | |
Mu["default"] = UE; | |
}); | |
var rg = H(function (gs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(gs, "__esModule", { | |
value: !0 | |
}); | |
gs.LRUCache = void 0; | |
var li = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) == "object" && performance && typeof performance.now == "function" ? performance : Date, | |
Xy = new Set(), | |
Nu = _typeof(L) == "object" && L ? L : {}, | |
Zy = function Zy(t, e, r, n) { | |
typeof Nu.emitWarning == "function" ? Nu.emitWarning(t, e, r, n) : console.error("[".concat(r, "] ").concat(e, ": ").concat(t)); | |
}, | |
ps = globalThis.AbortController, | |
Yy = globalThis.AbortSignal, | |
Jy; | |
if (typeof ps == "undefined") { | |
Yy = /*#__PURE__*/function () { | |
function Yy() { | |
_classCallCheck(this, Yy); | |
ke(this, "onabort"); | |
ke(this, "_onabort", []); | |
ke(this, "reason"); | |
ke(this, "aborted", !1); | |
} | |
return _createClass(Yy, [{ | |
key: "addEventListener", | |
value: function addEventListener(n, i) { | |
this._onabort.push(i); | |
} | |
}]); | |
}(), ps = /*#__PURE__*/function () { | |
function ps() { | |
_classCallCheck(this, ps); | |
ke(this, "signal", new Yy()); | |
_e11(); | |
} | |
return _createClass(ps, [{ | |
key: "abort", | |
value: function abort(n) { | |
var i, s; | |
if (!this.signal.aborted) { | |
this.signal.reason = n, this.signal.aborted = !0; | |
var _iterator11 = _createForOfIteratorHelper(this.signal._onabort), | |
_step11; | |
try { | |
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) { | |
var _o10 = _step11.value; | |
_o10(n); | |
} | |
} catch (err) { | |
_iterator11.e(err); | |
} finally { | |
_iterator11.f(); | |
} | |
(s = (i = this.signal).onabort) == null || s.call(i, n); | |
} | |
} | |
}]); | |
}(); | |
var t = ((Jy = Nu.env) == null ? void 0 : Jy.LRU_CACHE_IGNORE_AC_WARNING) !== "1", | |
_e11 = function _e10() { | |
t && (t = !1, Zy("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", _e11)); | |
}; | |
} | |
var DE = function DE(t) { | |
return !Xy.has(t); | |
}, | |
T2 = Symbol("type"), | |
Vr = function Vr(t) { | |
return t && t === Math.floor(t) && t > 0 && isFinite(t); | |
}, | |
eg = function eg(t) { | |
return Vr(t) ? t <= Math.pow(2, 8) ? Uint8Array : t <= Math.pow(2, 16) ? Uint16Array : t <= Math.pow(2, 32) ? Uint32Array : t <= Number.MAX_SAFE_INTEGER ? fi : null : null; | |
}, | |
fi = /*#__PURE__*/function (_Array) { | |
function fi(e) { | |
var _this17; | |
_classCallCheck(this, fi); | |
_this17 = _callSuper(this, fi, [e]), _this17.fill(0); | |
return _this17; | |
} | |
_inherits(fi, _Array); | |
return _createClass(fi); | |
}(/*#__PURE__*/_wrapNativeSuper(Array)), | |
ci, | |
Sn = /*#__PURE__*/function () { | |
function Sn(e, r) { | |
_classCallCheck(this, Sn); | |
ke(this, "heap"); | |
ke(this, "length"); | |
if (!E(Sn, ci)) throw new TypeError("instantiate Stack using Stack.create(n)"); | |
this.heap = new r(e), this.length = 0; | |
} | |
return _createClass(Sn, [{ | |
key: "push", | |
value: function push(e) { | |
this.heap[this.length++] = e; | |
} | |
}, { | |
key: "pop", | |
value: function pop() { | |
return this.heap[--this.length]; | |
} | |
}], [{ | |
key: "create", | |
value: function create(e) { | |
var r = eg(e); | |
if (!r) return []; | |
ie(Sn, ci, !0); | |
var n = new Sn(e, r); | |
return ie(Sn, ci, !1), n; | |
} | |
}]); | |
}(); | |
ci = new WeakMap(), he(Sn, ci, !1); | |
var Lu = Sn, | |
Wt, | |
vt, | |
$t, | |
Ht, | |
hi, | |
di, | |
Qe, | |
Vt, | |
He, | |
Ce, | |
de, | |
ht, | |
St, | |
at, | |
Xe, | |
zt, | |
Ze, | |
Kt, | |
Gt, | |
Et, | |
Qt, | |
Qr, | |
dt, | |
Gi, | |
Uu, | |
En, | |
Pr, | |
Qi, | |
At, | |
ys, | |
tg, | |
An, | |
pi, | |
Yi, | |
ar, | |
zr, | |
ur, | |
Kr, | |
Ji, | |
Du, | |
FE, | |
yi, | |
hs, | |
gi, | |
ds, | |
Pe, | |
Be, | |
Xi, | |
Fu, | |
In, | |
Ki, | |
lr, | |
Gr, | |
Zi, | |
ju, | |
Wu = /*#__PURE__*/function () { | |
function Wu(e) { | |
_classCallCheck(this, Wu); | |
he(this, Gi); | |
he(this, ys); | |
he(this, ar); | |
he(this, ur); | |
he(this, Ji); | |
he(this, yi); | |
he(this, gi); | |
he(this, Pe); | |
he(this, Xi); | |
he(this, In); | |
he(this, lr); | |
he(this, Zi); | |
he(this, Wt, void 0); | |
he(this, vt, void 0); | |
he(this, $t, void 0); | |
he(this, Ht, void 0); | |
he(this, hi, void 0); | |
he(this, di, void 0); | |
ke(this, "ttl"); | |
ke(this, "ttlResolution"); | |
ke(this, "ttlAutopurge"); | |
ke(this, "updateAgeOnGet"); | |
ke(this, "updateAgeOnHas"); | |
ke(this, "allowStale"); | |
ke(this, "noDisposeOnSet"); | |
ke(this, "noUpdateTTL"); | |
ke(this, "maxEntrySize"); | |
ke(this, "sizeCalculation"); | |
ke(this, "noDeleteOnFetchRejection"); | |
ke(this, "noDeleteOnStaleGet"); | |
ke(this, "allowStaleOnFetchAbort"); | |
ke(this, "allowStaleOnFetchRejection"); | |
ke(this, "ignoreFetchAbort"); | |
he(this, Qe, void 0); | |
he(this, Vt, void 0); | |
he(this, He, void 0); | |
he(this, Ce, void 0); | |
he(this, de, void 0); | |
he(this, ht, void 0); | |
he(this, St, void 0); | |
he(this, at, void 0); | |
he(this, Xe, void 0); | |
he(this, zt, void 0); | |
he(this, Ze, void 0); | |
he(this, Kt, void 0); | |
he(this, Gt, void 0); | |
he(this, Et, void 0); | |
he(this, Qt, void 0); | |
he(this, Qr, void 0); | |
he(this, dt, void 0); | |
he(this, En, function () {}); | |
he(this, Pr, function () {}); | |
he(this, Qi, function () {}); | |
he(this, At, function () { | |
return !1; | |
}); | |
he(this, An, function (e) {}); | |
he(this, pi, function (e, r, n) {}); | |
he(this, Yi, function (e, r, n, i) { | |
if (n || i) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); | |
return 0; | |
}); | |
ke(this, FE, "LRUCache"); | |
var _e$max = e.max, | |
r = _e$max === void 0 ? 0 : _e$max, | |
n = e.ttl, | |
_e$ttlResolution = e.ttlResolution, | |
i = _e$ttlResolution === void 0 ? 1 : _e$ttlResolution, | |
s = e.ttlAutopurge, | |
o = e.updateAgeOnGet, | |
a = e.updateAgeOnHas, | |
l = e.allowStale, | |
c = e.dispose, | |
d = e.disposeAfter, | |
h = e.noDisposeOnSet, | |
m = e.noUpdateTTL, | |
_e$maxSize = e.maxSize, | |
w = _e$maxSize === void 0 ? 0 : _e$maxSize, | |
_e$maxEntrySize = e.maxEntrySize, | |
T = _e$maxEntrySize === void 0 ? 0 : _e$maxEntrySize, | |
v = e.sizeCalculation, | |
b = e.fetchMethod, | |
p = e.memoMethod, | |
_ = e.noDeleteOnFetchRejection, | |
x = e.noDeleteOnStaleGet, | |
I = e.allowStaleOnFetchRejection, | |
y = e.allowStaleOnFetchAbort, | |
B = e.ignoreFetchAbort; | |
if (r !== 0 && !Vr(r)) throw new TypeError("max option must be a nonnegative integer"); | |
var A = r ? eg(r) : Array; | |
if (!A) throw new Error("invalid max value: " + r); | |
if (ie(this, Wt, r), ie(this, vt, w), this.maxEntrySize = T || E(this, vt), this.sizeCalculation = v, this.sizeCalculation) { | |
if (!E(this, vt) && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize"); | |
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function"); | |
} | |
if (p !== void 0 && typeof p != "function") throw new TypeError("memoMethod must be a function if defined"); | |
if (ie(this, di, p), b !== void 0 && typeof b != "function") throw new TypeError("fetchMethod must be a function if specified"); | |
if (ie(this, hi, b), ie(this, Qr, !!b), ie(this, He, new Map()), ie(this, Ce, new Array(r).fill(void 0)), ie(this, de, new Array(r).fill(void 0)), ie(this, ht, new A(r)), ie(this, St, new A(r)), ie(this, at, 0), ie(this, Xe, 0), ie(this, zt, Lu.create(r)), ie(this, Qe, 0), ie(this, Vt, 0), typeof c == "function" && ie(this, $t, c), typeof d == "function" ? (ie(this, Ht, d), ie(this, Ze, [])) : (ie(this, Ht, void 0), ie(this, Ze, void 0)), ie(this, Qt, !!E(this, $t)), ie(this, dt, !!E(this, Ht)), this.noDisposeOnSet = !!h, this.noUpdateTTL = !!m, this.noDeleteOnFetchRejection = !!_, this.allowStaleOnFetchRejection = !!I, this.allowStaleOnFetchAbort = !!y, this.ignoreFetchAbort = !!B, this.maxEntrySize !== 0) { | |
if (E(this, vt) !== 0 && !Vr(E(this, vt))) throw new TypeError("maxSize must be a positive integer if specified"); | |
if (!Vr(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified"); | |
J(this, ys, tg).call(this); | |
} | |
if (this.allowStale = !!l, this.noDeleteOnStaleGet = !!x, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!a, this.ttlResolution = Vr(i) || i === 0 ? i : 1, this.ttlAutopurge = !!s, this.ttl = n || 0, this.ttl) { | |
if (!Vr(this.ttl)) throw new TypeError("ttl must be a positive integer if specified"); | |
J(this, Gi, Uu).call(this); | |
} | |
if (E(this, Wt) === 0 && this.ttl === 0 && E(this, vt) === 0) throw new TypeError("At least one of max, maxSize, or ttl is required"); | |
if (!this.ttlAutopurge && !E(this, Wt) && !E(this, vt)) { | |
var q = "LRU_CACHE_UNBOUNDED"; | |
DE(q) && (Xy.add(q), Zy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", q, Wu)); | |
} | |
} | |
return _createClass(Wu, [{ | |
key: "max", | |
get: function get() { | |
return E(this, Wt); | |
} | |
}, { | |
key: "maxSize", | |
get: function get() { | |
return E(this, vt); | |
} | |
}, { | |
key: "calculatedSize", | |
get: function get() { | |
return E(this, Vt); | |
} | |
}, { | |
key: "size", | |
get: function get() { | |
return E(this, Qe); | |
} | |
}, { | |
key: "fetchMethod", | |
get: function get() { | |
return E(this, hi); | |
} | |
}, { | |
key: "memoMethod", | |
get: function get() { | |
return E(this, di); | |
} | |
}, { | |
key: "dispose", | |
get: function get() { | |
return E(this, $t); | |
} | |
}, { | |
key: "disposeAfter", | |
get: function get() { | |
return E(this, Ht); | |
} | |
}, { | |
key: "getRemainingTTL", | |
value: function getRemainingTTL(e) { | |
return E(this, He).has(e) ? 1 / 0 : 0; | |
} | |
}, { | |
key: "entries", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function entries() { | |
var _iterator12, _step12, _e12; | |
return _regeneratorRuntime().wrap(function entries$(_context31) { | |
while (1) switch (_context31.prev = _context31.next) { | |
case 0: | |
_iterator12 = _createForOfIteratorHelper(J(this, ar, zr).call(this)); | |
_context31.prev = 1; | |
_iterator12.s(); | |
case 3: | |
if ((_step12 = _iterator12.n()).done) { | |
_context31.next = 11; | |
break; | |
} | |
_e12 = _step12.value; | |
_context31.t0 = E(this, de)[_e12] !== void 0 && E(this, Ce)[_e12] !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e12]); | |
if (!_context31.t0) { | |
_context31.next = 9; | |
break; | |
} | |
_context31.next = 9; | |
return [E(this, Ce)[_e12], E(this, de)[_e12]]; | |
case 9: | |
_context31.next = 3; | |
break; | |
case 11: | |
_context31.next = 16; | |
break; | |
case 13: | |
_context31.prev = 13; | |
_context31.t1 = _context31["catch"](1); | |
_iterator12.e(_context31.t1); | |
case 16: | |
_context31.prev = 16; | |
_iterator12.f(); | |
return _context31.finish(16); | |
case 19: | |
case "end": | |
return _context31.stop(); | |
} | |
}, entries, this, [[1, 13, 16, 19]]); | |
}) | |
}, { | |
key: "rentries", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function rentries() { | |
var _iterator13, _step13, _e13; | |
return _regeneratorRuntime().wrap(function rentries$(_context32) { | |
while (1) switch (_context32.prev = _context32.next) { | |
case 0: | |
_iterator13 = _createForOfIteratorHelper(J(this, ur, Kr).call(this)); | |
_context32.prev = 1; | |
_iterator13.s(); | |
case 3: | |
if ((_step13 = _iterator13.n()).done) { | |
_context32.next = 11; | |
break; | |
} | |
_e13 = _step13.value; | |
_context32.t0 = E(this, de)[_e13] !== void 0 && E(this, Ce)[_e13] !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e13]); | |
if (!_context32.t0) { | |
_context32.next = 9; | |
break; | |
} | |
_context32.next = 9; | |
return [E(this, Ce)[_e13], E(this, de)[_e13]]; | |
case 9: | |
_context32.next = 3; | |
break; | |
case 11: | |
_context32.next = 16; | |
break; | |
case 13: | |
_context32.prev = 13; | |
_context32.t1 = _context32["catch"](1); | |
_iterator13.e(_context32.t1); | |
case 16: | |
_context32.prev = 16; | |
_iterator13.f(); | |
return _context32.finish(16); | |
case 19: | |
case "end": | |
return _context32.stop(); | |
} | |
}, rentries, this, [[1, 13, 16, 19]]); | |
}) | |
}, { | |
key: "keys", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function keys() { | |
var _iterator14, _step14, _e14, _r18; | |
return _regeneratorRuntime().wrap(function keys$(_context33) { | |
while (1) switch (_context33.prev = _context33.next) { | |
case 0: | |
_iterator14 = _createForOfIteratorHelper(J(this, ar, zr).call(this)); | |
_context33.prev = 1; | |
_iterator14.s(); | |
case 3: | |
if ((_step14 = _iterator14.n()).done) { | |
_context33.next = 12; | |
break; | |
} | |
_e14 = _step14.value; | |
_r18 = E(this, Ce)[_e14]; | |
_context33.t0 = _r18 !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e14]); | |
if (!_context33.t0) { | |
_context33.next = 10; | |
break; | |
} | |
_context33.next = 10; | |
return _r18; | |
case 10: | |
_context33.next = 3; | |
break; | |
case 12: | |
_context33.next = 17; | |
break; | |
case 14: | |
_context33.prev = 14; | |
_context33.t1 = _context33["catch"](1); | |
_iterator14.e(_context33.t1); | |
case 17: | |
_context33.prev = 17; | |
_iterator14.f(); | |
return _context33.finish(17); | |
case 20: | |
case "end": | |
return _context33.stop(); | |
} | |
}, keys, this, [[1, 14, 17, 20]]); | |
}) | |
}, { | |
key: "rkeys", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function rkeys() { | |
var _iterator15, _step15, _e15, _r19; | |
return _regeneratorRuntime().wrap(function rkeys$(_context34) { | |
while (1) switch (_context34.prev = _context34.next) { | |
case 0: | |
_iterator15 = _createForOfIteratorHelper(J(this, ur, Kr).call(this)); | |
_context34.prev = 1; | |
_iterator15.s(); | |
case 3: | |
if ((_step15 = _iterator15.n()).done) { | |
_context34.next = 12; | |
break; | |
} | |
_e15 = _step15.value; | |
_r19 = E(this, Ce)[_e15]; | |
_context34.t0 = _r19 !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e15]); | |
if (!_context34.t0) { | |
_context34.next = 10; | |
break; | |
} | |
_context34.next = 10; | |
return _r19; | |
case 10: | |
_context34.next = 3; | |
break; | |
case 12: | |
_context34.next = 17; | |
break; | |
case 14: | |
_context34.prev = 14; | |
_context34.t1 = _context34["catch"](1); | |
_iterator15.e(_context34.t1); | |
case 17: | |
_context34.prev = 17; | |
_iterator15.f(); | |
return _context34.finish(17); | |
case 20: | |
case "end": | |
return _context34.stop(); | |
} | |
}, rkeys, this, [[1, 14, 17, 20]]); | |
}) | |
}, { | |
key: "values", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function values() { | |
var _iterator16, _step16, _e16; | |
return _regeneratorRuntime().wrap(function values$(_context35) { | |
while (1) switch (_context35.prev = _context35.next) { | |
case 0: | |
_iterator16 = _createForOfIteratorHelper(J(this, ar, zr).call(this)); | |
_context35.prev = 1; | |
_iterator16.s(); | |
case 3: | |
if ((_step16 = _iterator16.n()).done) { | |
_context35.next = 11; | |
break; | |
} | |
_e16 = _step16.value; | |
_context35.t0 = E(this, de)[_e16] !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e16]); | |
if (!_context35.t0) { | |
_context35.next = 9; | |
break; | |
} | |
_context35.next = 9; | |
return E(this, de)[_e16]; | |
case 9: | |
_context35.next = 3; | |
break; | |
case 11: | |
_context35.next = 16; | |
break; | |
case 13: | |
_context35.prev = 13; | |
_context35.t1 = _context35["catch"](1); | |
_iterator16.e(_context35.t1); | |
case 16: | |
_context35.prev = 16; | |
_iterator16.f(); | |
return _context35.finish(16); | |
case 19: | |
case "end": | |
return _context35.stop(); | |
} | |
}, values, this, [[1, 13, 16, 19]]); | |
}) | |
}, { | |
key: "rvalues", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function rvalues() { | |
var _iterator17, _step17, _e17; | |
return _regeneratorRuntime().wrap(function rvalues$(_context36) { | |
while (1) switch (_context36.prev = _context36.next) { | |
case 0: | |
_iterator17 = _createForOfIteratorHelper(J(this, ur, Kr).call(this)); | |
_context36.prev = 1; | |
_iterator17.s(); | |
case 3: | |
if ((_step17 = _iterator17.n()).done) { | |
_context36.next = 11; | |
break; | |
} | |
_e17 = _step17.value; | |
_context36.t0 = E(this, de)[_e17] !== void 0 && !J(this, Pe, Be).call(this, E(this, de)[_e17]); | |
if (!_context36.t0) { | |
_context36.next = 9; | |
break; | |
} | |
_context36.next = 9; | |
return E(this, de)[_e17]; | |
case 9: | |
_context36.next = 3; | |
break; | |
case 11: | |
_context36.next = 16; | |
break; | |
case 13: | |
_context36.prev = 13; | |
_context36.t1 = _context36["catch"](1); | |
_iterator17.e(_context36.t1); | |
case 16: | |
_context36.prev = 16; | |
_iterator17.f(); | |
return _context36.finish(16); | |
case 19: | |
case "end": | |
return _context36.stop(); | |
} | |
}, rvalues, this, [[1, 13, 16, 19]]); | |
}) | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return this.entries(); | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
var _iterator18 = _createForOfIteratorHelper(J(this, ar, zr).call(this)), | |
_step18; | |
try { | |
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { | |
var n = _step18.value; | |
var i = E(this, de)[n], | |
_s6 = J(this, Pe, Be).call(this, i) ? i.__staleWhileFetching : i; | |
if (_s6 !== void 0 && e(_s6, E(this, Ce)[n], this)) return this.get(E(this, Ce)[n], r); | |
} | |
} catch (err) { | |
_iterator18.e(err); | |
} finally { | |
_iterator18.f(); | |
} | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this; | |
var _iterator19 = _createForOfIteratorHelper(J(this, ar, zr).call(this)), | |
_step19; | |
try { | |
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { | |
var n = _step19.value; | |
var i = E(this, de)[n], | |
_s7 = J(this, Pe, Be).call(this, i) ? i.__staleWhileFetching : i; | |
_s7 !== void 0 && e.call(r, _s7, E(this, Ce)[n], this); | |
} | |
} catch (err) { | |
_iterator19.e(err); | |
} finally { | |
_iterator19.f(); | |
} | |
} | |
}, { | |
key: "rforEach", | |
value: function rforEach(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this; | |
var _iterator20 = _createForOfIteratorHelper(J(this, ur, Kr).call(this)), | |
_step20; | |
try { | |
for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { | |
var n = _step20.value; | |
var i = E(this, de)[n], | |
_s8 = J(this, Pe, Be).call(this, i) ? i.__staleWhileFetching : i; | |
_s8 !== void 0 && e.call(r, _s8, E(this, Ce)[n], this); | |
} | |
} catch (err) { | |
_iterator20.e(err); | |
} finally { | |
_iterator20.f(); | |
} | |
} | |
}, { | |
key: "purgeStale", | |
value: function purgeStale() { | |
var e = !1; | |
var _iterator21 = _createForOfIteratorHelper(J(this, ur, Kr).call(this, { | |
allowStale: !0 | |
})), | |
_step21; | |
try { | |
for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) { | |
var _r20 = _step21.value; | |
E(this, At).call(this, _r20) && (J(this, lr, Gr).call(this, E(this, Ce)[_r20], "expire"), e = !0); | |
} | |
} catch (err) { | |
_iterator21.e(err); | |
} finally { | |
_iterator21.f(); | |
} | |
return e; | |
} | |
}, { | |
key: "info", | |
value: function info(e) { | |
var r = E(this, He).get(e); | |
if (r === void 0) return; | |
var n = E(this, de)[r], | |
i = J(this, Pe, Be).call(this, n) ? n.__staleWhileFetching : n; | |
if (i === void 0) return; | |
var s = { | |
value: i | |
}; | |
if (E(this, Et) && E(this, Gt)) { | |
var _o11 = E(this, Et)[r], | |
_a8 = E(this, Gt)[r]; | |
if (_o11 && _a8) { | |
var _l18 = _o11 - (li.now() - _a8); | |
s.ttl = _l18, s.start = Date.now(); | |
} | |
} | |
return E(this, Kt) && (s.size = E(this, Kt)[r]), s; | |
} | |
}, { | |
key: "dump", | |
value: function dump() { | |
var e = []; | |
var _iterator22 = _createForOfIteratorHelper(J(this, ar, zr).call(this, { | |
allowStale: !0 | |
})), | |
_step22; | |
try { | |
for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) { | |
var _r21 = _step22.value; | |
var n = E(this, Ce)[_r21], | |
i = E(this, de)[_r21], | |
_s9 = J(this, Pe, Be).call(this, i) ? i.__staleWhileFetching : i; | |
if (_s9 === void 0 || n === void 0) continue; | |
var _o12 = { | |
value: _s9 | |
}; | |
if (E(this, Et) && E(this, Gt)) { | |
_o12.ttl = E(this, Et)[_r21]; | |
var _a9 = li.now() - E(this, Gt)[_r21]; | |
_o12.start = Math.floor(Date.now() - _a9); | |
} | |
E(this, Kt) && (_o12.size = E(this, Kt)[_r21]), e.unshift([n, _o12]); | |
} | |
} catch (err) { | |
_iterator22.e(err); | |
} finally { | |
_iterator22.f(); | |
} | |
return e; | |
} | |
}, { | |
key: "load", | |
value: function load(e) { | |
this.clear(); | |
var _iterator23 = _createForOfIteratorHelper(e), | |
_step23; | |
try { | |
for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) { | |
var _step23$value = _slicedToArray(_step23.value, 2), | |
_r22 = _step23$value[0], | |
n = _step23$value[1]; | |
if (n.start) { | |
var i = Date.now() - n.start; | |
n.start = li.now() - i; | |
} | |
this.set(_r22, n.value, n); | |
} | |
} catch (err) { | |
_iterator23.e(err); | |
} finally { | |
_iterator23.f(); | |
} | |
} | |
}, { | |
key: "set", | |
value: function set(e, r) { | |
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
var m, w, T, v, b; | |
if (r === void 0) return this["delete"](e), this; | |
var _n$ttl = n.ttl, | |
i = _n$ttl === void 0 ? this.ttl : _n$ttl, | |
s = n.start, | |
_n$noDisposeOnSet = n.noDisposeOnSet, | |
o = _n$noDisposeOnSet === void 0 ? this.noDisposeOnSet : _n$noDisposeOnSet, | |
_n$sizeCalculation = n.sizeCalculation, | |
a = _n$sizeCalculation === void 0 ? this.sizeCalculation : _n$sizeCalculation, | |
l = n.status, | |
_n$noUpdateTTL = n.noUpdateTTL, | |
c = _n$noUpdateTTL === void 0 ? this.noUpdateTTL : _n$noUpdateTTL, | |
d = E(this, Yi).call(this, e, r, n.size || 0, a); | |
if (this.maxEntrySize && d > this.maxEntrySize) return l && (l.set = "miss", l.maxEntrySizeExceeded = !0), J(this, lr, Gr).call(this, e, "set"), this; | |
var h = E(this, Qe) === 0 ? void 0 : E(this, He).get(e); | |
if (h === void 0) h = E(this, Qe) === 0 ? E(this, Xe) : E(this, zt).length !== 0 ? E(this, zt).pop() : E(this, Qe) === E(this, Wt) ? J(this, yi, hs).call(this, !1) : E(this, Qe), E(this, Ce)[h] = e, E(this, de)[h] = r, E(this, He).set(e, h), E(this, ht)[E(this, Xe)] = h, E(this, St)[h] = E(this, Xe), ie(this, Xe, h), bo(this, Qe)._++, E(this, pi).call(this, h, d, l), l && (l.set = "add"), c = !1;else { | |
J(this, In, Ki).call(this, h); | |
var _p5 = E(this, de)[h]; | |
if (r !== _p5) { | |
if (E(this, Qr) && J(this, Pe, Be).call(this, _p5)) { | |
_p5.__abortController.abort(new Error("replaced")); | |
var _ = _p5.__staleWhileFetching; | |
_ !== void 0 && !o && (E(this, Qt) && ((m = E(this, $t)) == null || m.call(this, _, e, "set")), E(this, dt) && ((w = E(this, Ze)) == null || w.push([_, e, "set"]))); | |
} else o || (E(this, Qt) && ((T = E(this, $t)) == null || T.call(this, _p5, e, "set")), E(this, dt) && ((v = E(this, Ze)) == null || v.push([_p5, e, "set"]))); | |
if (E(this, An).call(this, h), E(this, pi).call(this, h, d, l), E(this, de)[h] = r, l) { | |
l.set = "replace"; | |
var _2 = _p5 && J(this, Pe, Be).call(this, _p5) ? _p5.__staleWhileFetching : _p5; | |
_2 !== void 0 && (l.oldValue = _2); | |
} | |
} else l && (l.set = "update"); | |
} | |
if (i !== 0 && !E(this, Et) && J(this, Gi, Uu).call(this), E(this, Et) && (c || E(this, Qi).call(this, h, i, s), l && E(this, Pr).call(this, l, h)), !o && E(this, dt) && E(this, Ze)) { | |
var _p6 = E(this, Ze), | |
_3; | |
for (; _3 = _p6 == null ? void 0 : _p6.shift();) { | |
var _b9; | |
(b = E(this, Ht)) == null || (_b9 = b).call.apply(_b9, [this].concat(_toConsumableArray(_3))); | |
} | |
} | |
return this; | |
} | |
}, { | |
key: "pop", | |
value: function pop() { | |
var e; | |
try { | |
for (; E(this, Qe);) { | |
var _r23 = E(this, de)[E(this, at)]; | |
if (J(this, yi, hs).call(this, !0), J(this, Pe, Be).call(this, _r23)) { | |
if (_r23.__staleWhileFetching) return _r23.__staleWhileFetching; | |
} else if (_r23 !== void 0) return _r23; | |
} | |
} finally { | |
if (E(this, dt) && E(this, Ze)) { | |
var _r24 = E(this, Ze), | |
n; | |
for (; n = _r24 == null ? void 0 : _r24.shift();) { | |
var _e18; | |
(e = E(this, Ht)) == null || (_e18 = e).call.apply(_e18, [this].concat(_toConsumableArray(n))); | |
} | |
} | |
} | |
} | |
}, { | |
key: "has", | |
value: function has(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
var _r$updateAgeOnHas = r.updateAgeOnHas, | |
n = _r$updateAgeOnHas === void 0 ? this.updateAgeOnHas : _r$updateAgeOnHas, | |
i = r.status, | |
s = E(this, He).get(e); | |
if (s !== void 0) { | |
var _o13 = E(this, de)[s]; | |
if (J(this, Pe, Be).call(this, _o13) && _o13.__staleWhileFetching === void 0) return !1; | |
if (E(this, At).call(this, s)) i && (i.has = "stale", E(this, Pr).call(this, i, s));else return n && E(this, En).call(this, s), i && (i.has = "hit", E(this, Pr).call(this, i, s)), !0; | |
} else i && (i.has = "miss"); | |
return !1; | |
} | |
}, { | |
key: "peek", | |
value: function peek(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
var _r$allowStale = r.allowStale, | |
n = _r$allowStale === void 0 ? this.allowStale : _r$allowStale, | |
i = E(this, He).get(e); | |
if (i === void 0 || !n && E(this, At).call(this, i)) return; | |
var s = E(this, de)[i]; | |
return J(this, Pe, Be).call(this, s) ? s.__staleWhileFetching : s; | |
} | |
}, { | |
key: "fetch", | |
value: function fetch(n) { | |
return Ee(this, arguments, function (e) { | |
var _this18 = this; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() { | |
var _r$allowStale2, i, _r$updateAgeOnGet, s, _r$noDeleteOnStaleGet, o, _r$ttl, a, _r$noDisposeOnSet, l, _r$size, c, _r$sizeCalculation, d, _r$noUpdateTTL, h, _r$noDeleteOnFetchRej, m, _r$allowStaleOnFetchR, w, _r$ignoreFetchAbort, T, _r$allowStaleOnFetchA, v, b, _r$forceRefresh, p, _, x, I, y, B, _B2, Z, A, q, F; | |
return _regeneratorRuntime().wrap(function _callee30$(_context37) { | |
while (1) switch (_context37.prev = _context37.next) { | |
case 0: | |
_r$allowStale2 = r.allowStale, i = _r$allowStale2 === void 0 ? _this18.allowStale : _r$allowStale2, _r$updateAgeOnGet = r.updateAgeOnGet, s = _r$updateAgeOnGet === void 0 ? _this18.updateAgeOnGet : _r$updateAgeOnGet, _r$noDeleteOnStaleGet = r.noDeleteOnStaleGet, o = _r$noDeleteOnStaleGet === void 0 ? _this18.noDeleteOnStaleGet : _r$noDeleteOnStaleGet, _r$ttl = r.ttl, a = _r$ttl === void 0 ? _this18.ttl : _r$ttl, _r$noDisposeOnSet = r.noDisposeOnSet, l = _r$noDisposeOnSet === void 0 ? _this18.noDisposeOnSet : _r$noDisposeOnSet, _r$size = r.size, c = _r$size === void 0 ? 0 : _r$size, _r$sizeCalculation = r.sizeCalculation, d = _r$sizeCalculation === void 0 ? _this18.sizeCalculation : _r$sizeCalculation, _r$noUpdateTTL = r.noUpdateTTL, h = _r$noUpdateTTL === void 0 ? _this18.noUpdateTTL : _r$noUpdateTTL, _r$noDeleteOnFetchRej = r.noDeleteOnFetchRejection, m = _r$noDeleteOnFetchRej === void 0 ? _this18.noDeleteOnFetchRejection : _r$noDeleteOnFetchRej, _r$allowStaleOnFetchR = r.allowStaleOnFetchRejection, w = _r$allowStaleOnFetchR === void 0 ? _this18.allowStaleOnFetchRejection : _r$allowStaleOnFetchR, _r$ignoreFetchAbort = r.ignoreFetchAbort, T = _r$ignoreFetchAbort === void 0 ? _this18.ignoreFetchAbort : _r$ignoreFetchAbort, _r$allowStaleOnFetchA = r.allowStaleOnFetchAbort, v = _r$allowStaleOnFetchA === void 0 ? _this18.allowStaleOnFetchAbort : _r$allowStaleOnFetchA, b = r.context, _r$forceRefresh = r.forceRefresh, p = _r$forceRefresh === void 0 ? !1 : _r$forceRefresh, _ = r.status, x = r.signal; | |
if (E(_this18, Qr)) { | |
_context37.next = 3; | |
break; | |
} | |
return _context37.abrupt("return", (_ && (_.fetch = "get"), _this18.get(e, { | |
allowStale: i, | |
updateAgeOnGet: s, | |
noDeleteOnStaleGet: o, | |
status: _ | |
}))); | |
case 3: | |
I = { | |
allowStale: i, | |
updateAgeOnGet: s, | |
noDeleteOnStaleGet: o, | |
ttl: a, | |
noDisposeOnSet: l, | |
size: c, | |
sizeCalculation: d, | |
noUpdateTTL: h, | |
noDeleteOnFetchRejection: m, | |
allowStaleOnFetchRejection: w, | |
allowStaleOnFetchAbort: v, | |
ignoreFetchAbort: T, | |
status: _, | |
signal: x | |
}, y = E(_this18, He).get(e); | |
if (!(y === void 0)) { | |
_context37.next = 10; | |
break; | |
} | |
_ && (_.fetch = "miss"); | |
B = J(_this18, gi, ds).call(_this18, e, y, I, b); | |
return _context37.abrupt("return", B.__returned = B); | |
case 10: | |
_B2 = E(_this18, de)[y]; | |
if (!J(_this18, Pe, Be).call(_this18, _B2)) { | |
_context37.next = 14; | |
break; | |
} | |
Z = i && _B2.__staleWhileFetching !== void 0; | |
return _context37.abrupt("return", (_ && (_.fetch = "inflight", Z && (_.returnedStale = !0)), Z ? _B2.__staleWhileFetching : _B2.__returned = _B2)); | |
case 14: | |
A = E(_this18, At).call(_this18, y); | |
if (!(!p && !A)) { | |
_context37.next = 17; | |
break; | |
} | |
return _context37.abrupt("return", (_ && (_.fetch = "hit"), J(_this18, In, Ki).call(_this18, y), s && E(_this18, En).call(_this18, y), _ && E(_this18, Pr).call(_this18, _, y), _B2)); | |
case 17: | |
q = J(_this18, gi, ds).call(_this18, e, y, I, b), F = q.__staleWhileFetching !== void 0 && i; | |
return _context37.abrupt("return", (_ && (_.fetch = A ? "stale" : "refresh", F && A && (_.returnedStale = !0)), F ? q.__staleWhileFetching : q.__returned = q)); | |
case 19: | |
case "end": | |
return _context37.stop(); | |
} | |
}, _callee30); | |
})(); | |
}); | |
} | |
}, { | |
key: "forceFetch", | |
value: function forceFetch(n) { | |
return Ee(this, arguments, function (e) { | |
var _this19 = this; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() { | |
var i; | |
return _regeneratorRuntime().wrap(function _callee31$(_context38) { | |
while (1) switch (_context38.prev = _context38.next) { | |
case 0: | |
_context38.next = 2; | |
return _this19.fetch(e, r); | |
case 2: | |
i = _context38.sent; | |
if (!(i === void 0)) { | |
_context38.next = 5; | |
break; | |
} | |
throw new Error("fetch() returned undefined"); | |
case 5: | |
return _context38.abrupt("return", i); | |
case 6: | |
case "end": | |
return _context38.stop(); | |
} | |
}, _callee31); | |
})(); | |
}); | |
} | |
}, { | |
key: "memo", | |
value: function memo(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
var n = E(this, di); | |
if (!n) throw new Error("no memoMethod provided to constructor"); | |
var c = r, | |
i = c.context, | |
s = c.forceRefresh, | |
o = Uf(c, ["context", "forceRefresh"]), | |
a = this.get(e, o); | |
if (!s && a !== void 0) return a; | |
var l = n(e, a, { | |
options: o, | |
context: i | |
}); | |
return this.set(e, l, o), l; | |
} | |
}, { | |
key: "get", | |
value: function get(e) { | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
var _r$allowStale3 = r.allowStale, | |
n = _r$allowStale3 === void 0 ? this.allowStale : _r$allowStale3, | |
_r$updateAgeOnGet2 = r.updateAgeOnGet, | |
i = _r$updateAgeOnGet2 === void 0 ? this.updateAgeOnGet : _r$updateAgeOnGet2, | |
_r$noDeleteOnStaleGet2 = r.noDeleteOnStaleGet, | |
s = _r$noDeleteOnStaleGet2 === void 0 ? this.noDeleteOnStaleGet : _r$noDeleteOnStaleGet2, | |
o = r.status, | |
a = E(this, He).get(e); | |
if (a !== void 0) { | |
var _l19 = E(this, de)[a], | |
_c8 = J(this, Pe, Be).call(this, _l19); | |
return o && E(this, Pr).call(this, o, a), E(this, At).call(this, a) ? (o && (o.get = "stale"), _c8 ? (o && n && _l19.__staleWhileFetching !== void 0 && (o.returnedStale = !0), n ? _l19.__staleWhileFetching : void 0) : (s || J(this, lr, Gr).call(this, e, "expire"), o && n && (o.returnedStale = !0), n ? _l19 : void 0)) : (o && (o.get = "hit"), _c8 ? _l19.__staleWhileFetching : (J(this, In, Ki).call(this, a), i && E(this, En).call(this, a), _l19)); | |
} else o && (o.get = "miss"); | |
} | |
}, { | |
key: "delete", | |
value: function _delete(e) { | |
return J(this, lr, Gr).call(this, e, "delete"); | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
return J(this, Zi, ju).call(this, "delete"); | |
} | |
}], [{ | |
key: "unsafeExposeInternals", | |
value: function unsafeExposeInternals(e) { | |
return { | |
starts: E(e, Gt), | |
ttls: E(e, Et), | |
sizes: E(e, Kt), | |
keyMap: E(e, He), | |
keyList: E(e, Ce), | |
valList: E(e, de), | |
next: E(e, ht), | |
prev: E(e, St), | |
get head() { | |
return E(e, at); | |
}, | |
get tail() { | |
return E(e, Xe); | |
}, | |
free: E(e, zt), | |
isBackgroundFetch: function isBackgroundFetch(r) { | |
var n; | |
return J(n = e, Pe, Be).call(n, r); | |
}, | |
backgroundFetch: function backgroundFetch(r, n, i, s) { | |
var o; | |
return J(o = e, gi, ds).call(o, r, n, i, s); | |
}, | |
moveToTail: function moveToTail(r) { | |
var n; | |
return J(n = e, In, Ki).call(n, r); | |
}, | |
indexes: function indexes(r) { | |
var n; | |
return J(n = e, ar, zr).call(n, r); | |
}, | |
rindexes: function rindexes(r) { | |
var n; | |
return J(n = e, ur, Kr).call(n, r); | |
}, | |
isStale: function isStale(r) { | |
var n; | |
return E(n = e, At).call(n, r); | |
} | |
}; | |
} | |
}]); | |
}(); | |
FE = Symbol.toStringTag, Wt = new WeakMap(), vt = new WeakMap(), $t = new WeakMap(), Ht = new WeakMap(), hi = new WeakMap(), di = new WeakMap(), Qe = new WeakMap(), Vt = new WeakMap(), He = new WeakMap(), Ce = new WeakMap(), de = new WeakMap(), ht = new WeakMap(), St = new WeakMap(), at = new WeakMap(), Xe = new WeakMap(), zt = new WeakMap(), Ze = new WeakMap(), Kt = new WeakMap(), Gt = new WeakMap(), Et = new WeakMap(), Qt = new WeakMap(), Qr = new WeakMap(), dt = new WeakMap(), Gi = new WeakSet(), Uu = function Uu() { | |
var _this20 = this; | |
var e = new fi(E(this, Wt)), | |
r = new fi(E(this, Wt)); | |
ie(this, Et, e), ie(this, Gt, r), ie(this, Qi, function (s, o) { | |
var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : li.now(); | |
if (r[s] = o !== 0 ? a : 0, e[s] = o, o !== 0 && _this20.ttlAutopurge) { | |
var _l20 = setTimeout(function () { | |
E(_this20, At).call(_this20, s) && J(_this20, lr, Gr).call(_this20, E(_this20, Ce)[s], "expire"); | |
}, o + 1); | |
_l20.unref && _l20.unref(); | |
} | |
}), ie(this, En, function (s) { | |
r[s] = e[s] !== 0 ? li.now() : 0; | |
}), ie(this, Pr, function (s, o) { | |
if (e[o]) { | |
var _a10 = e[o], | |
_l21 = r[o]; | |
if (!_a10 || !_l21) return; | |
s.ttl = _a10, s.start = _l21, s.now = n || i(); | |
var _c9 = s.now - _l21; | |
s.remainingTTL = _a10 - _c9; | |
} | |
}); | |
var n = 0, | |
i = function i() { | |
var s = li.now(); | |
if (_this20.ttlResolution > 0) { | |
n = s; | |
var _o14 = setTimeout(function () { | |
return n = 0; | |
}, _this20.ttlResolution); | |
_o14.unref && _o14.unref(); | |
} | |
return s; | |
}; | |
this.getRemainingTTL = function (s) { | |
var o = E(_this20, He).get(s); | |
if (o === void 0) return 0; | |
var a = e[o], | |
l = r[o]; | |
if (!a || !l) return 1 / 0; | |
var c = (n || i()) - l; | |
return a - c; | |
}, ie(this, At, function (s) { | |
var o = r[s], | |
a = e[s]; | |
return !!a && !!o && (n || i()) - o > a; | |
}); | |
}, En = new WeakMap(), Pr = new WeakMap(), Qi = new WeakMap(), At = new WeakMap(), ys = new WeakSet(), tg = function tg() { | |
var _this21 = this; | |
var e = new fi(E(this, Wt)); | |
ie(this, Vt, 0), ie(this, Kt, e), ie(this, An, function (r) { | |
ie(_this21, Vt, E(_this21, Vt) - e[r]), e[r] = 0; | |
}), ie(this, Yi, function (r, n, i, s) { | |
if (J(_this21, Pe, Be).call(_this21, n)) return 0; | |
if (!Vr(i)) if (s) { | |
if (typeof s != "function") throw new TypeError("sizeCalculation must be a function"); | |
if (i = s(n, r), !Vr(i)) throw new TypeError("sizeCalculation return invalid (expect positive integer)"); | |
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set."); | |
return i; | |
}), ie(this, pi, function (r, n, i) { | |
if (e[r] = n, E(_this21, vt)) { | |
var _s10 = E(_this21, vt) - e[r]; | |
for (; E(_this21, Vt) > _s10;) J(_this21, yi, hs).call(_this21, !0); | |
} | |
ie(_this21, Vt, E(_this21, Vt) + e[r]), i && (i.entrySize = n, i.totalCalculatedSize = E(_this21, Vt)); | |
}); | |
}, An = new WeakMap(), pi = new WeakMap(), Yi = new WeakMap(), ar = new WeakSet(), zr = function zr() { | |
var _this22 = this; | |
var _ref25 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | |
_ref25$allowStale = _ref25.allowStale, | |
e = _ref25$allowStale === void 0 ? this.allowStale : _ref25$allowStale; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() { | |
var _r25; | |
return _regeneratorRuntime().wrap(function _callee32$(_context39) { | |
while (1) switch (_context39.prev = _context39.next) { | |
case 0: | |
if (!E(_this22, Qe)) { | |
_context39.next = 13; | |
break; | |
} | |
_r25 = E(_this22, Xe); | |
case 2: | |
_context39.t0 = !J(_this22, Ji, Du).call(_this22, _r25); | |
if (_context39.t0) { | |
_context39.next = 9; | |
break; | |
} | |
_context39.t1 = e || !E(_this22, At).call(_this22, _r25); | |
if (!_context39.t1) { | |
_context39.next = 8; | |
break; | |
} | |
_context39.next = 8; | |
return _r25; | |
case 8: | |
_context39.t0 = _r25 === E(_this22, at); | |
case 9: | |
if (_context39.t0) { | |
_context39.next = 13; | |
break; | |
} | |
_r25 = E(_this22, St)[_r25]; | |
case 11: | |
_context39.next = 2; | |
break; | |
case 13: | |
case "end": | |
return _context39.stop(); | |
} | |
}, _callee32); | |
})(); | |
}, ur = new WeakSet(), Kr = function Kr() { | |
var _this23 = this; | |
var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | |
_ref26$allowStale = _ref26.allowStale, | |
e = _ref26$allowStale === void 0 ? this.allowStale : _ref26$allowStale; | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() { | |
var _r26; | |
return _regeneratorRuntime().wrap(function _callee33$(_context40) { | |
while (1) switch (_context40.prev = _context40.next) { | |
case 0: | |
if (!E(_this23, Qe)) { | |
_context40.next = 13; | |
break; | |
} | |
_r26 = E(_this23, at); | |
case 2: | |
_context40.t0 = !J(_this23, Ji, Du).call(_this23, _r26); | |
if (_context40.t0) { | |
_context40.next = 9; | |
break; | |
} | |
_context40.t1 = e || !E(_this23, At).call(_this23, _r26); | |
if (!_context40.t1) { | |
_context40.next = 8; | |
break; | |
} | |
_context40.next = 8; | |
return _r26; | |
case 8: | |
_context40.t0 = _r26 === E(_this23, Xe); | |
case 9: | |
if (_context40.t0) { | |
_context40.next = 13; | |
break; | |
} | |
_r26 = E(_this23, ht)[_r26]; | |
case 11: | |
_context40.next = 2; | |
break; | |
case 13: | |
case "end": | |
return _context40.stop(); | |
} | |
}, _callee33); | |
})(); | |
}, Ji = new WeakSet(), Du = function Du(e) { | |
return e !== void 0 && E(this, He).get(E(this, Ce)[e]) === e; | |
}, yi = new WeakSet(), hs = function hs(e) { | |
var s, o; | |
var r = E(this, at), | |
n = E(this, Ce)[r], | |
i = E(this, de)[r]; | |
return E(this, Qr) && J(this, Pe, Be).call(this, i) ? i.__abortController.abort(new Error("evicted")) : (E(this, Qt) || E(this, dt)) && (E(this, Qt) && ((s = E(this, $t)) == null || s.call(this, i, n, "evict")), E(this, dt) && ((o = E(this, Ze)) == null || o.push([i, n, "evict"]))), E(this, An).call(this, r), e && (E(this, Ce)[r] = void 0, E(this, de)[r] = void 0, E(this, zt).push(r)), E(this, Qe) === 1 ? (ie(this, at, ie(this, Xe, 0)), E(this, zt).length = 0) : ie(this, at, E(this, ht)[r]), E(this, He)["delete"](n), bo(this, Qe)._--, r; | |
}, gi = new WeakSet(), ds = function ds(e, r, n, i) { | |
var _this24 = this; | |
var s = r === void 0 ? void 0 : E(this, de)[r]; | |
if (J(this, Pe, Be).call(this, s)) return s; | |
var o = new ps(), | |
a = n.signal; | |
a == null || a.addEventListener("abort", function () { | |
return o.abort(a.reason); | |
}, { | |
signal: o.signal | |
}); | |
var l = { | |
signal: o.signal, | |
options: n, | |
context: i | |
}, | |
c = function c(v) { | |
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1; | |
var p = o.signal.aborted, | |
_ = n.ignoreFetchAbort && v !== void 0; | |
if (n.status && (p && !b ? (n.status.fetchAborted = !0, n.status.fetchError = o.signal.reason, _ && (n.status.fetchAbortIgnored = !0)) : n.status.fetchResolved = !0), p && !_ && !b) return h(o.signal.reason); | |
var x = w; | |
return E(_this24, de)[r] === w && (v === void 0 ? x.__staleWhileFetching ? E(_this24, de)[r] = x.__staleWhileFetching : J(_this24, lr, Gr).call(_this24, e, "fetch") : (n.status && (n.status.fetchUpdated = !0), _this24.set(e, v, l.options))), v; | |
}, | |
d = function d(v) { | |
return n.status && (n.status.fetchRejected = !0, n.status.fetchError = v), h(v); | |
}, | |
h = function h(v) { | |
var b = o.signal.aborted, | |
p = b && n.allowStaleOnFetchAbort, | |
_ = p || n.allowStaleOnFetchRejection, | |
x = _ || n.noDeleteOnFetchRejection, | |
I = w; | |
if (E(_this24, de)[r] === w && (!x || I.__staleWhileFetching === void 0 ? J(_this24, lr, Gr).call(_this24, e, "fetch") : p || (E(_this24, de)[r] = I.__staleWhileFetching)), _) return n.status && I.__staleWhileFetching !== void 0 && (n.status.returnedStale = !0), I.__staleWhileFetching; | |
if (I.__returned === I) throw v; | |
}, | |
m = function m(v, b) { | |
var _; | |
var p = (_ = E(_this24, hi)) == null ? void 0 : _.call(_this24, e, s, l); | |
p && p instanceof Promise && p.then(function (x) { | |
return v(x === void 0 ? void 0 : x); | |
}, b), o.signal.addEventListener("abort", function () { | |
(!n.ignoreFetchAbort || n.allowStaleOnFetchAbort) && (v(void 0), n.allowStaleOnFetchAbort && (v = function v(x) { | |
return c(x, !0); | |
})); | |
}); | |
}; | |
n.status && (n.status.fetchDispatched = !0); | |
var w = new Promise(m).then(c, d), | |
T = Object.assign(w, { | |
__abortController: o, | |
__staleWhileFetching: s, | |
__returned: void 0 | |
}); | |
return r === void 0 ? (this.set(e, T, Xt(Ue({}, l.options), { | |
status: void 0 | |
})), r = E(this, He).get(e)) : E(this, de)[r] = T, T; | |
}, Pe = new WeakSet(), Be = function Be(e) { | |
if (!E(this, Qr)) return !1; | |
var r = e; | |
return !!r && r instanceof Promise && r.hasOwnProperty("__staleWhileFetching") && r.__abortController instanceof ps; | |
}, Xi = new WeakSet(), Fu = function Fu(e, r) { | |
E(this, St)[r] = e, E(this, ht)[e] = r; | |
}, In = new WeakSet(), Ki = function Ki(e) { | |
e !== E(this, Xe) && (e === E(this, at) ? ie(this, at, E(this, ht)[e]) : J(this, Xi, Fu).call(this, E(this, St)[e], E(this, ht)[e]), J(this, Xi, Fu).call(this, E(this, Xe), e), ie(this, Xe, e)); | |
}, lr = new WeakSet(), Gr = function Gr(e, r) { | |
var i, s, o, a; | |
var n = !1; | |
if (E(this, Qe) !== 0) { | |
var _l22 = E(this, He).get(e); | |
if (_l22 !== void 0) if (n = !0, E(this, Qe) === 1) J(this, Zi, ju).call(this, r);else { | |
E(this, An).call(this, _l22); | |
var _c10 = E(this, de)[_l22]; | |
if (J(this, Pe, Be).call(this, _c10) ? _c10.__abortController.abort(new Error("deleted")) : (E(this, Qt) || E(this, dt)) && (E(this, Qt) && ((i = E(this, $t)) == null || i.call(this, _c10, e, r)), E(this, dt) && ((s = E(this, Ze)) == null || s.push([_c10, e, r]))), E(this, He)["delete"](e), E(this, Ce)[_l22] = void 0, E(this, de)[_l22] = void 0, _l22 === E(this, Xe)) ie(this, Xe, E(this, St)[_l22]);else if (_l22 === E(this, at)) ie(this, at, E(this, ht)[_l22]);else { | |
var _d6 = E(this, St)[_l22]; | |
E(this, ht)[_d6] = E(this, ht)[_l22]; | |
var _h10 = E(this, ht)[_l22]; | |
E(this, St)[_h10] = E(this, St)[_l22]; | |
} | |
bo(this, Qe)._--, E(this, zt).push(_l22); | |
} | |
} | |
if (E(this, dt) && (o = E(this, Ze)) != null && o.length) { | |
var _l23 = E(this, Ze), | |
_c11; | |
for (; _c11 = _l23 == null ? void 0 : _l23.shift();) { | |
var _a11; | |
(a = E(this, Ht)) == null || (_a11 = a).call.apply(_a11, [this].concat(_toConsumableArray(_c11))); | |
} | |
} | |
return n; | |
}, Zi = new WeakSet(), ju = function ju(e) { | |
var r, n, i; | |
var _iterator24 = _createForOfIteratorHelper(J(this, ur, Kr).call(this, { | |
allowStale: !0 | |
})), | |
_step24; | |
try { | |
for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) { | |
var _s12 = _step24.value; | |
var _o16 = E(this, de)[_s12]; | |
if (J(this, Pe, Be).call(this, _o16)) _o16.__abortController.abort(new Error("deleted"));else { | |
var _a12 = E(this, Ce)[_s12]; | |
E(this, Qt) && ((r = E(this, $t)) == null || r.call(this, _o16, _a12, e)), E(this, dt) && ((n = E(this, Ze)) == null || n.push([_o16, _a12, e])); | |
} | |
} | |
} catch (err) { | |
_iterator24.e(err); | |
} finally { | |
_iterator24.f(); | |
} | |
if (E(this, He).clear(), E(this, de).fill(void 0), E(this, Ce).fill(void 0), E(this, Et) && E(this, Gt) && (E(this, Et).fill(0), E(this, Gt).fill(0)), E(this, Kt) && E(this, Kt).fill(0), ie(this, at, 0), ie(this, Xe, 0), E(this, zt).length = 0, ie(this, Vt, 0), ie(this, Qe, 0), E(this, dt) && E(this, Ze)) { | |
var _s11 = E(this, Ze), | |
_o15; | |
for (; _o15 = _s11 == null ? void 0 : _s11.shift();) { | |
var _i6; | |
(i = E(this, Ht)) == null || (_i6 = i).call.apply(_i6, [this].concat(_toConsumableArray(_o15))); | |
} | |
} | |
}; | |
var qu = Wu; | |
gs.LRUCache = qu; | |
}); | |
var fr = H(function (Yr) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Yr, "t", { | |
value: !0 | |
}); | |
Yr.ContainerIterator = Yr.Container = Yr.Base = void 0; | |
var $u = /*#__PURE__*/function () { | |
function $u() { | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | |
_classCallCheck(this, $u); | |
this.iteratorType = e; | |
} | |
return _createClass($u, [{ | |
key: "equals", | |
value: function equals(e) { | |
return this.o === e.o; | |
} | |
}]); | |
}(); | |
Yr.ContainerIterator = $u; | |
var ws = /*#__PURE__*/function () { | |
function ws() { | |
_classCallCheck(this, ws); | |
this.i = 0; | |
} | |
return _createClass(ws, [{ | |
key: "length", | |
get: function get() { | |
return this.i; | |
} | |
}, { | |
key: "size", | |
value: function size() { | |
return this.i; | |
} | |
}, { | |
key: "empty", | |
value: function empty() { | |
return this.i === 0; | |
} | |
}]); | |
}(); | |
Yr.Base = ws; | |
var Hu = /*#__PURE__*/function (_ws) { | |
function Hu() { | |
_classCallCheck(this, Hu); | |
return _callSuper(this, Hu, arguments); | |
} | |
_inherits(Hu, _ws); | |
return _createClass(Hu); | |
}(ws); | |
Yr.Container = Hu; | |
}); | |
var ng = H(function (bs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(bs, "t", { | |
value: !0 | |
}); | |
bs["default"] = void 0; | |
var jE = fr(), | |
Vu = /*#__PURE__*/function (_jE$Base) { | |
function Vu() { | |
var _this25; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
_classCallCheck(this, Vu); | |
_this25 = _callSuper(this, Vu), _this25.S = []; | |
var r = _this25; | |
e.forEach(function (n) { | |
r.push(n); | |
}); | |
return _this25; | |
} | |
_inherits(Vu, _jE$Base); | |
return _createClass(Vu, [{ | |
key: "clear", | |
value: function clear() { | |
this.i = 0, this.S = []; | |
} | |
}, { | |
key: "push", | |
value: function push(e) { | |
return this.S.push(e), this.i += 1, this.i; | |
} | |
}, { | |
key: "pop", | |
value: function pop() { | |
if (this.i !== 0) return this.i -= 1, this.S.pop(); | |
} | |
}, { | |
key: "top", | |
value: function top() { | |
return this.S[this.i - 1]; | |
} | |
}]); | |
}(jE.Base), | |
WE = Vu; | |
bs["default"] = WE; | |
}); | |
var ig = H(function (_s) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(_s, "t", { | |
value: !0 | |
}); | |
_s["default"] = void 0; | |
var $E = fr(), | |
zu = /*#__PURE__*/function (_$E$Base) { | |
function zu() { | |
var _this26; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
_classCallCheck(this, zu); | |
_this26 = _callSuper(this, zu), _this26.j = 0, _this26.q = []; | |
var r = _this26; | |
e.forEach(function (n) { | |
r.push(n); | |
}); | |
return _this26; | |
} | |
_inherits(zu, _$E$Base); | |
return _createClass(zu, [{ | |
key: "clear", | |
value: function clear() { | |
this.q = [], this.i = this.j = 0; | |
} | |
}, { | |
key: "push", | |
value: function push(e) { | |
var r = this.q.length; | |
if (this.j / r > .5 && this.j + this.i >= r && r > 4096) { | |
var n = this.i; | |
for (var i = 0; i < n; ++i) this.q[i] = this.q[this.j + i]; | |
this.j = 0, this.q[this.i] = e; | |
} else this.q[this.j + this.i] = e; | |
return ++this.i; | |
} | |
}, { | |
key: "pop", | |
value: function pop() { | |
if (this.i === 0) return; | |
var e = this.q[this.j++]; | |
return this.i -= 1, e; | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
if (this.i !== 0) return this.q[this.j]; | |
} | |
}]); | |
}($E.Base), | |
HE = zu; | |
_s["default"] = HE; | |
}); | |
var og = H(function (ms) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(ms, "t", { | |
value: !0 | |
}); | |
ms["default"] = void 0; | |
var VE = fr(), | |
Ku = /*#__PURE__*/function (_VE$Base) { | |
function Ku() { | |
var _this27; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (i, s) { | |
return i > s ? -1 : i < s ? 1 : 0; | |
}; | |
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0; | |
_classCallCheck(this, Ku); | |
if (_this27 = _callSuper(this, Ku), _this27.v = r, Array.isArray(e)) _this27.C = n ? _toConsumableArray(e) : e;else { | |
_this27.C = []; | |
var _s13 = _assertThisInitialized(_this27); | |
e.forEach(function (o) { | |
_s13.C.push(o); | |
}); | |
} | |
_this27.i = _this27.C.length; | |
var i = _this27.i >> 1; | |
for (var _s14 = _this27.i - 1 >> 1; _s14 >= 0; --_s14) _this27.k(_s14, i); | |
return _this27; | |
} | |
_inherits(Ku, _VE$Base); | |
return _createClass(Ku, [{ | |
key: "m", | |
value: function m(e) { | |
var r = this.C[e]; | |
for (; e > 0;) { | |
var n = e - 1 >> 1, | |
i = this.C[n]; | |
if (this.v(i, r) <= 0) break; | |
this.C[e] = i, e = n; | |
} | |
this.C[e] = r; | |
} | |
}, { | |
key: "k", | |
value: function k(e, r) { | |
var n = this.C[e]; | |
for (; e < r;) { | |
var i = e << 1 | 1, | |
_s15 = i + 1, | |
_o17 = this.C[i]; | |
if (_s15 < this.i && this.v(_o17, this.C[_s15]) > 0 && (i = _s15, _o17 = this.C[_s15]), this.v(_o17, n) >= 0) break; | |
this.C[e] = _o17, e = i; | |
} | |
this.C[e] = n; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
this.i = 0, this.C.length = 0; | |
} | |
}, { | |
key: "push", | |
value: function push(e) { | |
this.C.push(e), this.m(this.i), this.i += 1; | |
} | |
}, { | |
key: "pop", | |
value: function pop() { | |
if (this.i === 0) return; | |
var e = this.C[0], | |
r = this.C.pop(); | |
return this.i -= 1, this.i && (this.C[0] = r, this.k(0, this.i >> 1)), e; | |
} | |
}, { | |
key: "top", | |
value: function top() { | |
return this.C[0]; | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
return this.C.indexOf(e) >= 0; | |
} | |
}, { | |
key: "remove", | |
value: function remove(e) { | |
var r = this.C.indexOf(e); | |
return r < 0 ? !1 : (r === 0 ? this.pop() : r === this.i - 1 ? (this.C.pop(), this.i -= 1) : (this.C.splice(r, 1, this.C.pop()), this.i -= 1, this.m(r), this.k(r, this.i >> 1)), !0); | |
} | |
}, { | |
key: "updateItem", | |
value: function updateItem(e) { | |
var r = this.C.indexOf(e); | |
return r < 0 ? !1 : (this.m(r), this.k(r, this.i >> 1), !0); | |
} | |
}, { | |
key: "toArray", | |
value: function toArray() { | |
return _toConsumableArray(this.C); | |
} | |
}]); | |
}(VE.Base), | |
zE = Ku; | |
ms["default"] = zE; | |
}); | |
var Ss = H(function (vs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(vs, "t", { | |
value: !0 | |
}); | |
vs["default"] = void 0; | |
var KE = fr(), | |
Gu = /*#__PURE__*/function (_KE$Container) { | |
function Gu() { | |
_classCallCheck(this, Gu); | |
return _callSuper(this, Gu, arguments); | |
} | |
_inherits(Gu, _KE$Container); | |
return _createClass(Gu); | |
}(KE.Container), | |
GE = Gu; | |
vs["default"] = GE; | |
}); | |
var cr = H(function (Qu) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Qu, "t", { | |
value: !0 | |
}); | |
Qu.throwIteratorAccessError = QE; | |
function QE() { | |
throw new RangeError("Iterator access denied!"); | |
} | |
}); | |
var Ju = H(function (As) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(As, "t", { | |
value: !0 | |
}); | |
As.RandomIterator = void 0; | |
var YE = fr(), | |
Es = cr(), | |
Yu = /*#__PURE__*/function (_YE$ContainerIterator) { | |
function Yu(e, r) { | |
var _this28; | |
_classCallCheck(this, Yu); | |
_this28 = _callSuper(this, Yu, [r]), _this28.o = e, _this28.iteratorType === 0 ? (_this28.pre = function () { | |
return this.o === 0 && (0, Es.throwIteratorAccessError)(), this.o -= 1, this; | |
}, _this28.next = function () { | |
return this.o === this.container.size() && (0, Es.throwIteratorAccessError)(), this.o += 1, this; | |
}) : (_this28.pre = function () { | |
return this.o === this.container.size() - 1 && (0, Es.throwIteratorAccessError)(), this.o += 1, this; | |
}, _this28.next = function () { | |
return this.o === -1 && (0, Es.throwIteratorAccessError)(), this.o -= 1, this; | |
}); | |
return _this28; | |
} | |
_inherits(Yu, _YE$ContainerIterator); | |
return _createClass(Yu, [{ | |
key: "pointer", | |
get: function get() { | |
return this.container.getElementByPos(this.o); | |
}, | |
set: function set(e) { | |
this.container.setElementByPos(this.o, e); | |
} | |
}]); | |
}(YE.ContainerIterator); | |
As.RandomIterator = Yu; | |
}); | |
var sg = H(function (Is) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Is, "t", { | |
value: !0 | |
}); | |
Is["default"] = void 0; | |
var JE = ZE(Ss()), | |
XE = Ju(); | |
function ZE(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var Tn = /*#__PURE__*/function (_XE$RandomIterator) { | |
function t(e, r, n) { | |
var _this29; | |
_classCallCheck(this, t); | |
_this29 = _callSuper(this, t, [e, n]), _this29.container = r; | |
return _this29; | |
} | |
_inherits(t, _XE$RandomIterator); | |
return _createClass(t, [{ | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.container, this.iteratorType); | |
} | |
}]); | |
}(XE.RandomIterator), | |
Xu = /*#__PURE__*/function (_JE$default) { | |
function Xu() { | |
var _this30; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0; | |
_classCallCheck(this, Xu); | |
if (_this30 = _callSuper(this, Xu), Array.isArray(e)) _this30.J = r ? _toConsumableArray(e) : e, _this30.i = e.length;else { | |
_this30.J = []; | |
var n = _assertThisInitialized(_this30); | |
e.forEach(function (i) { | |
n.pushBack(i); | |
}); | |
} | |
return _this30; | |
} | |
_inherits(Xu, _JE$default); | |
return _createClass(Xu, [{ | |
key: "clear", | |
value: function clear() { | |
this.i = 0, this.J.length = 0; | |
} | |
}, { | |
key: "begin", | |
value: function begin() { | |
return new Tn(0, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new Tn(this.i, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new Tn(this.i - 1, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new Tn(-1, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
return this.J[0]; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
return this.J[this.i - 1]; | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
return this.J[e]; | |
} | |
}, { | |
key: "eraseElementByPos", | |
value: function eraseElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
return this.J.splice(e, 1), this.i -= 1, this.i; | |
} | |
}, { | |
key: "eraseElementByValue", | |
value: function eraseElementByValue(e) { | |
var r = 0; | |
for (var n = 0; n < this.i; ++n) this.J[n] !== e && (this.J[r++] = this.J[n]); | |
return this.i = this.J.length = r, this.i; | |
} | |
}, { | |
key: "eraseElementByIterator", | |
value: function eraseElementByIterator(e) { | |
var r = e.o; | |
return e = e.next(), this.eraseElementByPos(r), e; | |
} | |
}, { | |
key: "pushBack", | |
value: function pushBack(e) { | |
return this.J.push(e), this.i += 1, this.i; | |
} | |
}, { | |
key: "popBack", | |
value: function popBack() { | |
if (this.i !== 0) return this.i -= 1, this.J.pop(); | |
} | |
}, { | |
key: "setElementByPos", | |
value: function setElementByPos(e, r) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
this.J[e] = r; | |
} | |
}, { | |
key: "insert", | |
value: function insert(e, r) { | |
var _this$J; | |
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; | |
if (e < 0 || e > this.i) throw new RangeError(); | |
return (_this$J = this.J).splice.apply(_this$J, [e, 0].concat(_toConsumableArray(new Array(n).fill(r)))), this.i += n, this.i; | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
for (var _r27 = 0; _r27 < this.i; ++_r27) if (this.J[_r27] === e) return new Tn(_r27, this); | |
return this.end(); | |
} | |
}, { | |
key: "reverse", | |
value: function reverse() { | |
this.J.reverse(); | |
} | |
}, { | |
key: "unique", | |
value: function unique() { | |
var e = 1; | |
for (var _r28 = 1; _r28 < this.i; ++_r28) this.J[_r28] !== this.J[_r28 - 1] && (this.J[e++] = this.J[_r28]); | |
return this.i = this.J.length = e, this.i; | |
} | |
}, { | |
key: "sort", | |
value: function sort(e) { | |
this.J.sort(e); | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
for (var _r29 = 0; _r29 < this.i; ++_r29) e(this.J[_r29], _r29, this); | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() { | |
return _regeneratorRuntime().wrap(function _callee34$(_context41) { | |
while (1) switch (_context41.prev = _context41.next) { | |
case 0: | |
return _context41.delegateYield(Ot(this.J), "t0", 1); | |
case 1: | |
case "end": | |
return _context41.stop(); | |
} | |
}, _callee34, this); | |
}).bind(this)(); | |
} | |
}]); | |
}(JE["default"]), | |
e1 = Xu; | |
Is["default"] = e1; | |
}); | |
var ag = H(function (Ts) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Ts, "t", { | |
value: !0 | |
}); | |
Ts["default"] = void 0; | |
var t1 = n1(Ss()), | |
r1 = fr(), | |
Pn = cr(); | |
function n1(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var Rn = /*#__PURE__*/function (_r1$ContainerIterator) { | |
function t(e, r, n, i) { | |
var _this31; | |
_classCallCheck(this, t); | |
_this31 = _callSuper(this, t, [i]), _this31.o = e, _this31.h = r, _this31.container = n, _this31.iteratorType === 0 ? (_this31.pre = function () { | |
return this.o.L === this.h && (0, Pn.throwIteratorAccessError)(), this.o = this.o.L, this; | |
}, _this31.next = function () { | |
return this.o === this.h && (0, Pn.throwIteratorAccessError)(), this.o = this.o.B, this; | |
}) : (_this31.pre = function () { | |
return this.o.B === this.h && (0, Pn.throwIteratorAccessError)(), this.o = this.o.B, this; | |
}, _this31.next = function () { | |
return this.o === this.h && (0, Pn.throwIteratorAccessError)(), this.o = this.o.L, this; | |
}); | |
return _this31; | |
} | |
_inherits(t, _r1$ContainerIterator); | |
return _createClass(t, [{ | |
key: "pointer", | |
get: function get() { | |
return this.o === this.h && (0, Pn.throwIteratorAccessError)(), this.o.l; | |
}, | |
set: function set(e) { | |
this.o === this.h && (0, Pn.throwIteratorAccessError)(), this.o.l = e; | |
} | |
}, { | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.h, this.container, this.iteratorType); | |
} | |
}]); | |
}(r1.ContainerIterator), | |
Zu = /*#__PURE__*/function (_t1$default) { | |
function Zu() { | |
var _this32; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
_classCallCheck(this, Zu); | |
_this32 = _callSuper(this, Zu), _this32.h = {}, _this32.p = _this32._ = _this32.h.L = _this32.h.B = _this32.h; | |
var r = _this32; | |
e.forEach(function (n) { | |
r.pushBack(n); | |
}); | |
return _this32; | |
} | |
_inherits(Zu, _t1$default); | |
return _createClass(Zu, [{ | |
key: "V", | |
value: function V(e) { | |
var r = e.L, | |
n = e.B; | |
r.B = n, n.L = r, e === this.p && (this.p = n), e === this._ && (this._ = r), this.i -= 1; | |
} | |
}, { | |
key: "G", | |
value: function G(e, r) { | |
var n = r.B, | |
i = { | |
l: e, | |
L: r, | |
B: n | |
}; | |
r.B = i, n.L = i, r === this.h && (this.p = i), n === this.h && (this._ = i), this.i += 1; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
this.i = 0, this.p = this._ = this.h.L = this.h.B = this.h; | |
} | |
}, { | |
key: "begin", | |
value: function begin() { | |
return new Rn(this.p, this.h, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new Rn(this.h, this.h, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new Rn(this._, this.h, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new Rn(this.h, this.h, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
return this.p.l; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
return this._.l; | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = this.p; | |
for (; e--;) r = r.B; | |
return r.l; | |
} | |
}, { | |
key: "eraseElementByPos", | |
value: function eraseElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = this.p; | |
for (; e--;) r = r.B; | |
return this.V(r), this.i; | |
} | |
}, { | |
key: "eraseElementByValue", | |
value: function eraseElementByValue(e) { | |
var r = this.p; | |
for (; r !== this.h;) r.l === e && this.V(r), r = r.B; | |
return this.i; | |
} | |
}, { | |
key: "eraseElementByIterator", | |
value: function eraseElementByIterator(e) { | |
var r = e.o; | |
return r === this.h && (0, Pn.throwIteratorAccessError)(), e = e.next(), this.V(r), e; | |
} | |
}, { | |
key: "pushBack", | |
value: function pushBack(e) { | |
return this.G(e, this._), this.i; | |
} | |
}, { | |
key: "popBack", | |
value: function popBack() { | |
if (this.i === 0) return; | |
var e = this._.l; | |
return this.V(this._), e; | |
} | |
}, { | |
key: "pushFront", | |
value: function pushFront(e) { | |
return this.G(e, this.h), this.i; | |
} | |
}, { | |
key: "popFront", | |
value: function popFront() { | |
if (this.i === 0) return; | |
var e = this.p.l; | |
return this.V(this.p), e; | |
} | |
}, { | |
key: "setElementByPos", | |
value: function setElementByPos(e, r) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var n = this.p; | |
for (; e--;) n = n.B; | |
n.l = r; | |
} | |
}, { | |
key: "insert", | |
value: function insert(e, r) { | |
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; | |
if (e < 0 || e > this.i) throw new RangeError(); | |
if (n <= 0) return this.i; | |
if (e === 0) for (; n--;) this.pushFront(r);else if (e === this.i) for (; n--;) this.pushBack(r);else { | |
var i = this.p; | |
for (var _o18 = 1; _o18 < e; ++_o18) i = i.B; | |
var _s16 = i.B; | |
for (this.i += n; n--;) i.B = { | |
l: r, | |
L: i | |
}, i.B.L = i, i = i.B; | |
i.B = _s16, _s16.L = i; | |
} | |
return this.i; | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
var r = this.p; | |
for (; r !== this.h;) { | |
if (r.l === e) return new Rn(r, this.h, this); | |
r = r.B; | |
} | |
return this.end(); | |
} | |
}, { | |
key: "reverse", | |
value: function reverse() { | |
if (this.i <= 1) return; | |
var e = this.p, | |
r = this._, | |
n = 0; | |
for (; n << 1 < this.i;) { | |
var i = e.l; | |
e.l = r.l, r.l = i, e = e.B, r = r.L, n += 1; | |
} | |
} | |
}, { | |
key: "unique", | |
value: function unique() { | |
if (this.i <= 1) return this.i; | |
var e = this.p; | |
for (; e !== this.h;) { | |
var _r30 = e; | |
for (; _r30.B !== this.h && _r30.l === _r30.B.l;) _r30 = _r30.B, this.i -= 1; | |
e.B = _r30.B, e.B.L = e, e = e.B; | |
} | |
return this.i; | |
} | |
}, { | |
key: "sort", | |
value: function sort(e) { | |
if (this.i <= 1) return; | |
var r = []; | |
this.forEach(function (i) { | |
r.push(i); | |
}), r.sort(e); | |
var n = this.p; | |
r.forEach(function (i) { | |
n.l = i, n = n.B; | |
}); | |
} | |
}, { | |
key: "merge", | |
value: function merge(e) { | |
var r = this; | |
if (this.i === 0) e.forEach(function (n) { | |
r.pushBack(n); | |
});else { | |
var n = this.p; | |
e.forEach(function (i) { | |
for (; n !== r.h && n.l <= i;) n = n.B; | |
r.G(i, n.L); | |
}); | |
} | |
return this.i; | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
var r = this.p, | |
n = 0; | |
for (; r !== this.h;) e(r.l, n++, this), r = r.B; | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() { | |
var e; | |
return _regeneratorRuntime().wrap(function _callee35$(_context42) { | |
while (1) switch (_context42.prev = _context42.next) { | |
case 0: | |
if (!(this.i === 0)) { | |
_context42.next = 2; | |
break; | |
} | |
return _context42.abrupt("return"); | |
case 2: | |
e = this.p; | |
case 3: | |
if (!(e !== this.h)) { | |
_context42.next = 9; | |
break; | |
} | |
_context42.next = 6; | |
return e.l; | |
case 6: | |
e = e.B; | |
case 7: | |
_context42.next = 3; | |
break; | |
case 9: | |
case "end": | |
return _context42.stop(); | |
} | |
}, _callee35, this); | |
}).bind(this)(); | |
} | |
}]); | |
}(t1["default"]), | |
i1 = Zu; | |
Ts["default"] = i1; | |
}); | |
var ug = H(function (Ps) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Ps, "t", { | |
value: !0 | |
}); | |
Ps["default"] = void 0; | |
var o1 = a1(Ss()), | |
s1 = Ju(); | |
function a1(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var On = /*#__PURE__*/function (_s1$RandomIterator) { | |
function t(e, r, n) { | |
var _this33; | |
_classCallCheck(this, t); | |
_this33 = _callSuper(this, t, [e, n]), _this33.container = r; | |
return _this33; | |
} | |
_inherits(t, _s1$RandomIterator); | |
return _createClass(t, [{ | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.container, this.iteratorType); | |
} | |
}]); | |
}(s1.RandomIterator), | |
el = /*#__PURE__*/function (_o1$default) { | |
function el() { | |
var _this34; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4096; | |
_classCallCheck(this, el); | |
_this34 = _callSuper(this, el), _this34.j = 0, _this34.D = 0, _this34.R = 0, _this34.N = 0, _this34.P = 0, _this34.A = []; | |
var n = function () { | |
if (typeof e.length == "number") return e.length; | |
if (typeof e.size == "number") return e.size; | |
if (typeof e.size == "function") return e.size(); | |
throw new TypeError("Cannot get the length or size of the container"); | |
}(); | |
_this34.F = r, _this34.P = Math.max(Math.ceil(n / _this34.F), 1); | |
for (var _o19 = 0; _o19 < _this34.P; ++_o19) _this34.A.push(new Array(_this34.F)); | |
var i = Math.ceil(n / _this34.F); | |
_this34.j = _this34.R = (_this34.P >> 1) - (i >> 1), _this34.D = _this34.N = _this34.F - n % _this34.F >> 1; | |
var s = _this34; | |
e.forEach(function (o) { | |
s.pushBack(o); | |
}); | |
return _this34; | |
} | |
_inherits(el, _o1$default); | |
return _createClass(el, [{ | |
key: "T", | |
value: function T() { | |
var e = [], | |
r = Math.max(this.P >> 1, 1); | |
for (var n = 0; n < r; ++n) e[n] = new Array(this.F); | |
for (var _n6 = this.j; _n6 < this.P; ++_n6) e[e.length] = this.A[_n6]; | |
for (var _n7 = 0; _n7 < this.R; ++_n7) e[e.length] = this.A[_n7]; | |
e[e.length] = _toConsumableArray(this.A[this.R]), this.j = r, this.R = e.length - 1; | |
for (var _n8 = 0; _n8 < r; ++_n8) e[e.length] = new Array(this.F); | |
this.A = e, this.P = e.length; | |
} | |
}, { | |
key: "O", | |
value: function O(e) { | |
var r = this.D + e + 1, | |
n = r % this.F, | |
i = n - 1, | |
s = this.j + (r - n) / this.F; | |
return n === 0 && (s -= 1), s %= this.P, i < 0 && (i += this.F), { | |
curNodeBucketIndex: s, | |
curNodePointerIndex: i | |
}; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
this.A = [new Array(this.F)], this.P = 1, this.j = this.R = this.i = 0, this.D = this.N = this.F >> 1; | |
} | |
}, { | |
key: "begin", | |
value: function begin() { | |
return new On(0, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new On(this.i, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new On(this.i - 1, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new On(-1, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
if (this.i !== 0) return this.A[this.j][this.D]; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
if (this.i !== 0) return this.A[this.R][this.N]; | |
} | |
}, { | |
key: "pushBack", | |
value: function pushBack(e) { | |
return this.i && (this.N < this.F - 1 ? this.N += 1 : this.R < this.P - 1 ? (this.R += 1, this.N = 0) : (this.R = 0, this.N = 0), this.R === this.j && this.N === this.D && this.T()), this.i += 1, this.A[this.R][this.N] = e, this.i; | |
} | |
}, { | |
key: "popBack", | |
value: function popBack() { | |
if (this.i === 0) return; | |
var e = this.A[this.R][this.N]; | |
return this.i !== 1 && (this.N > 0 ? this.N -= 1 : this.R > 0 ? (this.R -= 1, this.N = this.F - 1) : (this.R = this.P - 1, this.N = this.F - 1)), this.i -= 1, e; | |
} | |
}, { | |
key: "pushFront", | |
value: function pushFront(e) { | |
return this.i && (this.D > 0 ? this.D -= 1 : this.j > 0 ? (this.j -= 1, this.D = this.F - 1) : (this.j = this.P - 1, this.D = this.F - 1), this.j === this.R && this.D === this.N && this.T()), this.i += 1, this.A[this.j][this.D] = e, this.i; | |
} | |
}, { | |
key: "popFront", | |
value: function popFront() { | |
if (this.i === 0) return; | |
var e = this.A[this.j][this.D]; | |
return this.i !== 1 && (this.D < this.F - 1 ? this.D += 1 : this.j < this.P - 1 ? (this.j += 1, this.D = 0) : (this.j = 0, this.D = 0)), this.i -= 1, e; | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var _this$O = this.O(e), | |
r = _this$O.curNodeBucketIndex, | |
n = _this$O.curNodePointerIndex; | |
return this.A[r][n]; | |
} | |
}, { | |
key: "setElementByPos", | |
value: function setElementByPos(e, r) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var _this$O2 = this.O(e), | |
n = _this$O2.curNodeBucketIndex, | |
i = _this$O2.curNodePointerIndex; | |
this.A[n][i] = r; | |
} | |
}, { | |
key: "insert", | |
value: function insert(e, r) { | |
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; | |
if (e < 0 || e > this.i) throw new RangeError(); | |
if (e === 0) for (; n--;) this.pushFront(r);else if (e === this.i) for (; n--;) this.pushBack(r);else { | |
var i = []; | |
for (var _s17 = e; _s17 < this.i; ++_s17) i.push(this.getElementByPos(_s17)); | |
this.cut(e - 1); | |
for (var _s18 = 0; _s18 < n; ++_s18) this.pushBack(r); | |
for (var _s19 = 0; _s19 < i.length; ++_s19) this.pushBack(i[_s19]); | |
} | |
return this.i; | |
} | |
}, { | |
key: "cut", | |
value: function cut(e) { | |
if (e < 0) return this.clear(), 0; | |
var _this$O3 = this.O(e), | |
r = _this$O3.curNodeBucketIndex, | |
n = _this$O3.curNodePointerIndex; | |
return this.R = r, this.N = n, this.i = e + 1, this.i; | |
} | |
}, { | |
key: "eraseElementByPos", | |
value: function eraseElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
if (e === 0) this.popFront();else if (e === this.i - 1) this.popBack();else { | |
var _r31 = []; | |
for (var i = e + 1; i < this.i; ++i) _r31.push(this.getElementByPos(i)); | |
this.cut(e), this.popBack(); | |
var n = this; | |
_r31.forEach(function (i) { | |
n.pushBack(i); | |
}); | |
} | |
return this.i; | |
} | |
}, { | |
key: "eraseElementByValue", | |
value: function eraseElementByValue(e) { | |
if (this.i === 0) return 0; | |
var r = []; | |
for (var i = 0; i < this.i; ++i) { | |
var _s20 = this.getElementByPos(i); | |
_s20 !== e && r.push(_s20); | |
} | |
var n = r.length; | |
for (var _i7 = 0; _i7 < n; ++_i7) this.setElementByPos(_i7, r[_i7]); | |
return this.cut(n - 1); | |
} | |
}, { | |
key: "eraseElementByIterator", | |
value: function eraseElementByIterator(e) { | |
var r = e.o; | |
return this.eraseElementByPos(r), e = e.next(), e; | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
for (var _r32 = 0; _r32 < this.i; ++_r32) if (this.getElementByPos(_r32) === e) return new On(_r32, this); | |
return this.end(); | |
} | |
}, { | |
key: "reverse", | |
value: function reverse() { | |
var e = 0, | |
r = this.i - 1; | |
for (; e < r;) { | |
var n = this.getElementByPos(e); | |
this.setElementByPos(e, this.getElementByPos(r)), this.setElementByPos(r, n), e += 1, r -= 1; | |
} | |
} | |
}, { | |
key: "unique", | |
value: function unique() { | |
if (this.i <= 1) return this.i; | |
var e = 1, | |
r = this.getElementByPos(0); | |
for (var n = 1; n < this.i; ++n) { | |
var i = this.getElementByPos(n); | |
i !== r && (r = i, this.setElementByPos(e++, i)); | |
} | |
for (; this.i > e;) this.popBack(); | |
return this.i; | |
} | |
}, { | |
key: "sort", | |
value: function sort(e) { | |
var r = []; | |
for (var n = 0; n < this.i; ++n) r.push(this.getElementByPos(n)); | |
r.sort(e); | |
for (var _n9 = 0; _n9 < this.i; ++_n9) this.setElementByPos(_n9, r[_n9]); | |
} | |
}, { | |
key: "shrinkToFit", | |
value: function shrinkToFit() { | |
if (this.i === 0) return; | |
var e = []; | |
this.forEach(function (r) { | |
e.push(r); | |
}), this.P = Math.max(Math.ceil(this.i / this.F), 1), this.i = this.j = this.R = this.D = this.N = 0, this.A = []; | |
for (var _r33 = 0; _r33 < this.P; ++_r33) this.A.push(new Array(this.F)); | |
for (var _r34 = 0; _r34 < e.length; ++_r34) this.pushBack(e[_r34]); | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
for (var _r35 = 0; _r35 < this.i; ++_r35) e(this.getElementByPos(_r35), _r35, this); | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() { | |
var _e19; | |
return _regeneratorRuntime().wrap(function _callee36$(_context43) { | |
while (1) switch (_context43.prev = _context43.next) { | |
case 0: | |
_e19 = 0; | |
case 1: | |
if (!(_e19 < this.i)) { | |
_context43.next = 7; | |
break; | |
} | |
_context43.next = 4; | |
return this.getElementByPos(_e19); | |
case 4: | |
++_e19; | |
_context43.next = 1; | |
break; | |
case 7: | |
case "end": | |
return _context43.stop(); | |
} | |
}, _callee36, this); | |
}).bind(this)(); | |
} | |
}]); | |
}(o1["default"]), | |
u1 = el; | |
Ps["default"] = u1; | |
}); | |
var lg = H(function (wi) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(wi, "t", { | |
value: !0 | |
}); | |
wi.TreeNodeEnableIndex = wi.TreeNode = void 0; | |
var Rs = /*#__PURE__*/function () { | |
function Rs(e, r) { | |
_classCallCheck(this, Rs); | |
this.ee = 1, this.u = void 0, this.l = void 0, this.U = void 0, this.W = void 0, this.tt = void 0, this.u = e, this.l = r; | |
} | |
return _createClass(Rs, [{ | |
key: "L", | |
value: function L() { | |
var e = this; | |
if (e.ee === 1 && e.tt.tt === e) e = e.W;else if (e.U) for (e = e.U; e.W;) e = e.W;else { | |
var _r36 = e.tt; | |
for (; _r36.U === e;) e = _r36, _r36 = e.tt; | |
e = _r36; | |
} | |
return e; | |
} | |
}, { | |
key: "B", | |
value: function B() { | |
var e = this; | |
if (e.W) { | |
for (e = e.W; e.U;) e = e.U; | |
return e; | |
} else { | |
var _r37 = e.tt; | |
for (; _r37.W === e;) e = _r37, _r37 = e.tt; | |
return e.W !== _r37 ? _r37 : e; | |
} | |
} | |
}, { | |
key: "te", | |
value: function te() { | |
var e = this.tt, | |
r = this.W, | |
n = r.U; | |
return e.tt === this ? e.tt = r : e.U === this ? e.U = r : e.W = r, r.tt = e, r.U = this, this.tt = r, this.W = n, n && (n.tt = this), r; | |
} | |
}, { | |
key: "se", | |
value: function se() { | |
var e = this.tt, | |
r = this.U, | |
n = r.W; | |
return e.tt === this ? e.tt = r : e.U === this ? e.U = r : e.W = r, r.tt = e, r.W = this, this.tt = r, this.U = n, n && (n.tt = this), r; | |
} | |
}]); | |
}(); | |
wi.TreeNode = Rs; | |
var tl = /*#__PURE__*/function (_Rs) { | |
function tl() { | |
var _this35; | |
_classCallCheck(this, tl); | |
_this35 = _callSuper(this, tl, arguments), _this35.rt = 1; | |
return _this35; | |
} | |
_inherits(tl, _Rs); | |
return _createClass(tl, [{ | |
key: "te", | |
value: function te() { | |
var e = _superPropGet(tl, "te", this, 3)([]); | |
return this.ie(), e.ie(), e; | |
} | |
}, { | |
key: "se", | |
value: function se() { | |
var e = _superPropGet(tl, "se", this, 3)([]); | |
return this.ie(), e.ie(), e; | |
} | |
}, { | |
key: "ie", | |
value: function ie() { | |
this.rt = 1, this.U && (this.rt += this.U.rt), this.W && (this.rt += this.W.rt); | |
} | |
}]); | |
}(Rs); | |
wi.TreeNodeEnableIndex = tl; | |
}); | |
var nl = H(function (Os) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Os, "t", { | |
value: !0 | |
}); | |
Os["default"] = void 0; | |
var fg = lg(), | |
l1 = fr(), | |
cg = cr(), | |
rl = /*#__PURE__*/function (_l1$Container) { | |
function rl() { | |
var _this36; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (n, i) { | |
return n < i ? -1 : n > i ? 1 : 0; | |
}; | |
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1; | |
_classCallCheck(this, rl); | |
_this36 = _callSuper(this, rl), _this36.Y = void 0, _this36.v = e, r ? (_this36.re = fg.TreeNodeEnableIndex, _this36.M = function (n, i, s) { | |
var o = this.ne(n, i, s); | |
if (o) { | |
var _a13 = o.tt; | |
for (; _a13 !== this.h;) _a13.rt += 1, _a13 = _a13.tt; | |
var _l24 = this.he(o); | |
if (_l24) { | |
var _c12 = _l24.parentNode, | |
_d7 = _l24.grandParent, | |
_h11 = _l24.curNode; | |
_c12.ie(), _d7.ie(), _h11.ie(); | |
} | |
} | |
return this.i; | |
}, _this36.V = function (n) { | |
var i = this.fe(n); | |
for (; i !== this.h;) i.rt -= 1, i = i.tt; | |
}) : (_this36.re = fg.TreeNode, _this36.M = function (n, i, s) { | |
var o = this.ne(n, i, s); | |
return o && this.he(o), this.i; | |
}, _this36.V = _this36.fe), _this36.h = new _this36.re(); | |
return _this36; | |
} | |
_inherits(rl, _l1$Container); | |
return _createClass(rl, [{ | |
key: "X", | |
value: function X(e, r) { | |
var n = this.h; | |
for (; e;) { | |
var i = this.v(e.u, r); | |
if (i < 0) e = e.W;else if (i > 0) n = e, e = e.U;else return e; | |
} | |
return n; | |
} | |
}, { | |
key: "Z", | |
value: function Z(e, r) { | |
var n = this.h; | |
for (; e;) this.v(e.u, r) <= 0 ? e = e.W : (n = e, e = e.U); | |
return n; | |
} | |
}, { | |
key: "$", | |
value: function $(e, r) { | |
var n = this.h; | |
for (; e;) { | |
var i = this.v(e.u, r); | |
if (i < 0) n = e, e = e.W;else if (i > 0) e = e.U;else return e; | |
} | |
return n; | |
} | |
}, { | |
key: "rr", | |
value: function rr(e, r) { | |
var n = this.h; | |
for (; e;) this.v(e.u, r) < 0 ? (n = e, e = e.W) : e = e.U; | |
return n; | |
} | |
}, { | |
key: "ue", | |
value: function ue(e) { | |
for (;;) { | |
var _r38 = e.tt; | |
if (_r38 === this.h) return; | |
if (e.ee === 1) { | |
e.ee = 0; | |
return; | |
} | |
if (e === _r38.U) { | |
var n = _r38.W; | |
if (n.ee === 1) n.ee = 0, _r38.ee = 1, _r38 === this.Y ? this.Y = _r38.te() : _r38.te();else if (n.W && n.W.ee === 1) { | |
n.ee = _r38.ee, _r38.ee = 0, n.W.ee = 0, _r38 === this.Y ? this.Y = _r38.te() : _r38.te(); | |
return; | |
} else n.U && n.U.ee === 1 ? (n.ee = 1, n.U.ee = 0, n.se()) : (n.ee = 1, e = _r38); | |
} else { | |
var _n10 = _r38.U; | |
if (_n10.ee === 1) _n10.ee = 0, _r38.ee = 1, _r38 === this.Y ? this.Y = _r38.se() : _r38.se();else if (_n10.U && _n10.U.ee === 1) { | |
_n10.ee = _r38.ee, _r38.ee = 0, _n10.U.ee = 0, _r38 === this.Y ? this.Y = _r38.se() : _r38.se(); | |
return; | |
} else _n10.W && _n10.W.ee === 1 ? (_n10.ee = 1, _n10.W.ee = 0, _n10.te()) : (_n10.ee = 1, e = _r38); | |
} | |
} | |
} | |
}, { | |
key: "fe", | |
value: function fe(e) { | |
if (this.i === 1) return this.clear(), this.h; | |
var r = e; | |
for (; r.U || r.W;) { | |
var _ref27, _ref28; | |
if (r.W) for (r = r.W; r.U;) r = r.U;else r = r.U; | |
_ref27 = [r.u, e.u], e.u = _ref27[0], r.u = _ref27[1], _ref28 = [r.l, e.l], e.l = _ref28[0], r.l = _ref28[1], e = r; | |
} | |
this.h.U === r ? this.h.U = r.tt : this.h.W === r && (this.h.W = r.tt), this.ue(r); | |
var n = r.tt; | |
return r === n.U ? n.U = void 0 : n.W = void 0, this.i -= 1, this.Y.ee = 0, n; | |
} | |
}, { | |
key: "oe", | |
value: function oe(e, r) { | |
return e === void 0 ? !1 : this.oe(e.U, r) || r(e) ? !0 : this.oe(e.W, r); | |
} | |
}, { | |
key: "he", | |
value: function he(e) { | |
for (;;) { | |
var _r39 = e.tt; | |
if (_r39.ee === 0) return; | |
var n = _r39.tt; | |
if (_r39 === n.U) { | |
var i = n.W; | |
if (i && i.ee === 1) { | |
if (i.ee = _r39.ee = 0, n === this.Y) return; | |
n.ee = 1, e = n; | |
continue; | |
} else if (e === _r39.W) { | |
if (e.ee = 0, e.U && (e.U.tt = _r39), e.W && (e.W.tt = n), _r39.W = e.U, n.U = e.W, e.U = _r39, e.W = n, n === this.Y) this.Y = e, this.h.tt = e;else { | |
var _s21 = n.tt; | |
_s21.U === n ? _s21.U = e : _s21.W = e; | |
} | |
return e.tt = n.tt, _r39.tt = e, n.tt = e, n.ee = 1, { | |
parentNode: _r39, | |
grandParent: n, | |
curNode: e | |
}; | |
} else _r39.ee = 0, n === this.Y ? this.Y = n.se() : n.se(), n.ee = 1; | |
} else { | |
var _i8 = n.U; | |
if (_i8 && _i8.ee === 1) { | |
if (_i8.ee = _r39.ee = 0, n === this.Y) return; | |
n.ee = 1, e = n; | |
continue; | |
} else if (e === _r39.U) { | |
if (e.ee = 0, e.U && (e.U.tt = n), e.W && (e.W.tt = _r39), n.W = e.U, _r39.U = e.W, e.U = n, e.W = _r39, n === this.Y) this.Y = e, this.h.tt = e;else { | |
var _s22 = n.tt; | |
_s22.U === n ? _s22.U = e : _s22.W = e; | |
} | |
return e.tt = n.tt, _r39.tt = e, n.tt = e, n.ee = 1, { | |
parentNode: _r39, | |
grandParent: n, | |
curNode: e | |
}; | |
} else _r39.ee = 0, n === this.Y ? this.Y = n.te() : n.te(), n.ee = 1; | |
} | |
return; | |
} | |
} | |
}, { | |
key: "ne", | |
value: function ne(e, r, n) { | |
if (this.Y === void 0) { | |
this.i += 1, this.Y = new this.re(e, r), this.Y.ee = 0, this.Y.tt = this.h, this.h.tt = this.Y, this.h.U = this.Y, this.h.W = this.Y; | |
return; | |
} | |
var i, | |
s = this.h.U, | |
o = this.v(s.u, e); | |
if (o === 0) { | |
s.l = r; | |
return; | |
} else if (o > 0) s.U = new this.re(e, r), s.U.tt = s, i = s.U, this.h.U = i;else { | |
var _a14 = this.h.W, | |
_l25 = this.v(_a14.u, e); | |
if (_l25 === 0) { | |
_a14.l = r; | |
return; | |
} else if (_l25 < 0) _a14.W = new this.re(e, r), _a14.W.tt = _a14, i = _a14.W, this.h.W = i;else { | |
if (n !== void 0) { | |
var _c13 = n.o; | |
if (_c13 !== this.h) { | |
var _d8 = this.v(_c13.u, e); | |
if (_d8 === 0) { | |
_c13.l = r; | |
return; | |
} else if (_d8 > 0) { | |
var _h12 = _c13.L(), | |
_m13 = this.v(_h12.u, e); | |
if (_m13 === 0) { | |
_h12.l = r; | |
return; | |
} else _m13 < 0 && (i = new this.re(e, r), _h12.W === void 0 ? (_h12.W = i, i.tt = _h12) : (_c13.U = i, i.tt = _c13)); | |
} | |
} | |
} | |
if (i === void 0) for (i = this.Y;;) { | |
var _c14 = this.v(i.u, e); | |
if (_c14 > 0) { | |
if (i.U === void 0) { | |
i.U = new this.re(e, r), i.U.tt = i, i = i.U; | |
break; | |
} | |
i = i.U; | |
} else if (_c14 < 0) { | |
if (i.W === void 0) { | |
i.W = new this.re(e, r), i.W.tt = i, i = i.W; | |
break; | |
} | |
i = i.W; | |
} else { | |
i.l = r; | |
return; | |
} | |
} | |
} | |
} | |
return this.i += 1, i; | |
} | |
}, { | |
key: "I", | |
value: function I(e, r) { | |
for (; e;) { | |
var n = this.v(e.u, r); | |
if (n < 0) e = e.W;else if (n > 0) e = e.U;else return e; | |
} | |
return e || this.h; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
this.i = 0, this.Y = void 0, this.h.tt = void 0, this.h.U = this.h.W = void 0; | |
} | |
}, { | |
key: "updateKeyByIterator", | |
value: function updateKeyByIterator(e, r) { | |
var n = e.o; | |
if (n === this.h && (0, cg.throwIteratorAccessError)(), this.i === 1) return n.u = r, !0; | |
if (n === this.h.U) return this.v(n.B().u, r) > 0 ? (n.u = r, !0) : !1; | |
if (n === this.h.W) return this.v(n.L().u, r) < 0 ? (n.u = r, !0) : !1; | |
var i = n.L().u; | |
if (this.v(i, r) >= 0) return !1; | |
var s = n.B().u; | |
return this.v(s, r) <= 0 ? !1 : (n.u = r, !0); | |
} | |
}, { | |
key: "eraseElementByPos", | |
value: function eraseElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = 0, | |
n = this; | |
return this.oe(this.Y, function (i) { | |
return e === r ? (n.V(i), !0) : (r += 1, !1); | |
}), this.i; | |
} | |
}, { | |
key: "eraseElementByKey", | |
value: function eraseElementByKey(e) { | |
if (this.i === 0) return !1; | |
var r = this.I(this.Y, e); | |
return r === this.h ? !1 : (this.V(r), !0); | |
} | |
}, { | |
key: "eraseElementByIterator", | |
value: function eraseElementByIterator(e) { | |
var r = e.o; | |
r === this.h && (0, cg.throwIteratorAccessError)(); | |
var n = r.W === void 0; | |
return e.iteratorType === 0 ? n && e.next() : (!n || r.U === void 0) && e.next(), this.V(r), e; | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
var r = 0; | |
var _iterator25 = _createForOfIteratorHelper(this), | |
_step25; | |
try { | |
for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) { | |
var n = _step25.value; | |
e(n, r++, this); | |
} | |
} catch (err) { | |
_iterator25.e(err); | |
} finally { | |
_iterator25.f(); | |
} | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r, | |
n = 0; | |
var _iterator26 = _createForOfIteratorHelper(this), | |
_step26; | |
try { | |
for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) { | |
var i = _step26.value; | |
if (n === e) { | |
r = i; | |
break; | |
} | |
n += 1; | |
} | |
} catch (err) { | |
_iterator26.e(err); | |
} finally { | |
_iterator26.f(); | |
} | |
return r; | |
} | |
}, { | |
key: "getHeight", | |
value: function getHeight() { | |
if (this.i === 0) return 0; | |
var e = function (_e20) { | |
function e(_x) { | |
return _e20.apply(this, arguments); | |
} | |
e.toString = function () { | |
return _e20.toString(); | |
}; | |
return e; | |
}(function (r) { | |
return r ? Math.max(e(r.U), e(r.W)) + 1 : 0; | |
}); | |
return e(this.Y); | |
} | |
}]); | |
}(l1.Container), | |
f1 = rl; | |
Os["default"] = f1; | |
}); | |
var ol = H(function (Bs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Bs, "t", { | |
value: !0 | |
}); | |
Bs["default"] = void 0; | |
var c1 = fr(), | |
xs = cr(), | |
il = /*#__PURE__*/function (_c1$ContainerIterator) { | |
function il(e, r, n) { | |
var _this37; | |
_classCallCheck(this, il); | |
_this37 = _callSuper(this, il, [n]), _this37.o = e, _this37.h = r, _this37.iteratorType === 0 ? (_this37.pre = function () { | |
return this.o === this.h.U && (0, xs.throwIteratorAccessError)(), this.o = this.o.L(), this; | |
}, _this37.next = function () { | |
return this.o === this.h && (0, xs.throwIteratorAccessError)(), this.o = this.o.B(), this; | |
}) : (_this37.pre = function () { | |
return this.o === this.h.W && (0, xs.throwIteratorAccessError)(), this.o = this.o.B(), this; | |
}, _this37.next = function () { | |
return this.o === this.h && (0, xs.throwIteratorAccessError)(), this.o = this.o.L(), this; | |
}); | |
return _this37; | |
} | |
_inherits(il, _c1$ContainerIterator); | |
return _createClass(il, [{ | |
key: "index", | |
get: function get() { | |
var e = this.o, | |
r = this.h.tt; | |
if (e === this.h) return r ? r.rt - 1 : 0; | |
var n = 0; | |
for (e.U && (n += e.U.rt); e !== r;) { | |
var i = e.tt; | |
e === i.W && (n += 1, i.U && (n += i.U.rt)), e = i; | |
} | |
return n; | |
} | |
}]); | |
}(c1.ContainerIterator), | |
h1 = il; | |
Bs["default"] = h1; | |
}); | |
var dg = H(function (Cs) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Cs, "t", { | |
value: !0 | |
}); | |
Cs["default"] = void 0; | |
var d1 = hg(nl()), | |
p1 = hg(ol()), | |
y1 = cr(); | |
function hg(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var Yt = /*#__PURE__*/function (_p1$default) { | |
function t(e, r, n, i) { | |
var _this38; | |
_classCallCheck(this, t); | |
_this38 = _callSuper(this, t, [e, r, i]), _this38.container = n; | |
return _this38; | |
} | |
_inherits(t, _p1$default); | |
return _createClass(t, [{ | |
key: "pointer", | |
get: function get() { | |
return this.o === this.h && (0, y1.throwIteratorAccessError)(), this.o.u; | |
} | |
}, { | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.h, this.container, this.iteratorType); | |
} | |
}]); | |
}(p1["default"]), | |
sl = /*#__PURE__*/function (_d1$default) { | |
function sl() { | |
var _this39; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
var r = arguments.length > 1 ? arguments[1] : undefined; | |
var n = arguments.length > 2 ? arguments[2] : undefined; | |
_classCallCheck(this, sl); | |
_this39 = _callSuper(this, sl, [r, n]); | |
var i = _this39; | |
e.forEach(function (s) { | |
i.insert(s); | |
}); | |
return _this39; | |
} | |
_inherits(sl, _d1$default); | |
return _createClass(sl, [{ | |
key: "K", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function K(e) { | |
return _regeneratorRuntime().wrap(function K$(_context44) { | |
while (1) switch (_context44.prev = _context44.next) { | |
case 0: | |
_context44.t0 = e !== void 0; | |
if (!_context44.t0) { | |
_context44.next = 6; | |
break; | |
} | |
return _context44.delegateYield(Ot(this.K(e.U)), "t1", 3); | |
case 3: | |
_context44.next = 5; | |
return e.u; | |
case 5: | |
return _context44.delegateYield(Ot(this.K(e.W)), "t2", 6); | |
case 6: | |
case "end": | |
return _context44.stop(); | |
} | |
}, K, this); | |
}) | |
}, { | |
key: "begin", | |
value: function begin() { | |
return new Yt(this.h.U || this.h, this.h, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new Yt(this.h, this.h, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new Yt(this.h.W || this.h, this.h, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new Yt(this.h, this.h, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
return this.h.U ? this.h.U.u : void 0; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
return this.h.W ? this.h.W.u : void 0; | |
} | |
}, { | |
key: "insert", | |
value: function insert(e, r) { | |
return this.M(e, void 0, r); | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
var r = this.I(this.Y, e); | |
return new Yt(r, this.h, this); | |
} | |
}, { | |
key: "lowerBound", | |
value: function lowerBound(e) { | |
var r = this.X(this.Y, e); | |
return new Yt(r, this.h, this); | |
} | |
}, { | |
key: "upperBound", | |
value: function upperBound(e) { | |
var r = this.Z(this.Y, e); | |
return new Yt(r, this.h, this); | |
} | |
}, { | |
key: "reverseLowerBound", | |
value: function reverseLowerBound(e) { | |
var r = this.$(this.Y, e); | |
return new Yt(r, this.h, this); | |
} | |
}, { | |
key: "reverseUpperBound", | |
value: function reverseUpperBound(e) { | |
var r = this.rr(this.Y, e); | |
return new Yt(r, this.h, this); | |
} | |
}, { | |
key: "union", | |
value: function union(e) { | |
var r = this; | |
return e.forEach(function (n) { | |
r.insert(n); | |
}), this.i; | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return this.K(this.Y); | |
} | |
}]); | |
}(d1["default"]), | |
g1 = sl; | |
Cs["default"] = g1; | |
}); | |
var yg = H(function (ks) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(ks, "t", { | |
value: !0 | |
}); | |
ks["default"] = void 0; | |
var w1 = pg(nl()), | |
b1 = pg(ol()), | |
_1 = cr(); | |
function pg(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var Jt = /*#__PURE__*/function (_b1$default) { | |
function t(e, r, n, i) { | |
var _this40; | |
_classCallCheck(this, t); | |
_this40 = _callSuper(this, t, [e, r, i]), _this40.container = n; | |
return _this40; | |
} | |
_inherits(t, _b1$default); | |
return _createClass(t, [{ | |
key: "pointer", | |
get: function get() { | |
this.o === this.h && (0, _1.throwIteratorAccessError)(); | |
var e = this; | |
return new Proxy([], { | |
get: function get(r, n) { | |
if (n === "0") return e.o.u; | |
if (n === "1") return e.o.l; | |
}, | |
set: function set(r, n, i) { | |
if (n !== "1") throw new TypeError("props must be 1"); | |
return e.o.l = i, !0; | |
} | |
}); | |
} | |
}, { | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.h, this.container, this.iteratorType); | |
} | |
}]); | |
}(b1["default"]), | |
al = /*#__PURE__*/function (_w1$default) { | |
function al() { | |
var _this41; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
var r = arguments.length > 1 ? arguments[1] : undefined; | |
var n = arguments.length > 2 ? arguments[2] : undefined; | |
_classCallCheck(this, al); | |
_this41 = _callSuper(this, al, [r, n]); | |
var i = _this41; | |
e.forEach(function (s) { | |
i.setElement(s[0], s[1]); | |
}); | |
return _this41; | |
} | |
_inherits(al, _w1$default); | |
return _createClass(al, [{ | |
key: "K", | |
value: /*#__PURE__*/_regeneratorRuntime().mark(function K(e) { | |
return _regeneratorRuntime().wrap(function K$(_context45) { | |
while (1) switch (_context45.prev = _context45.next) { | |
case 0: | |
_context45.t0 = e !== void 0; | |
if (!_context45.t0) { | |
_context45.next = 6; | |
break; | |
} | |
return _context45.delegateYield(Ot(this.K(e.U)), "t1", 3); | |
case 3: | |
_context45.next = 5; | |
return [e.u, e.l]; | |
case 5: | |
return _context45.delegateYield(Ot(this.K(e.W)), "t2", 6); | |
case 6: | |
case "end": | |
return _context45.stop(); | |
} | |
}, K, this); | |
}) | |
}, { | |
key: "begin", | |
value: function begin() { | |
return new Jt(this.h.U || this.h, this.h, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new Jt(this.h, this.h, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new Jt(this.h.W || this.h, this.h, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new Jt(this.h, this.h, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
if (this.i === 0) return; | |
var e = this.h.U; | |
return [e.u, e.l]; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
if (this.i === 0) return; | |
var e = this.h.W; | |
return [e.u, e.l]; | |
} | |
}, { | |
key: "lowerBound", | |
value: function lowerBound(e) { | |
var r = this.X(this.Y, e); | |
return new Jt(r, this.h, this); | |
} | |
}, { | |
key: "upperBound", | |
value: function upperBound(e) { | |
var r = this.Z(this.Y, e); | |
return new Jt(r, this.h, this); | |
} | |
}, { | |
key: "reverseLowerBound", | |
value: function reverseLowerBound(e) { | |
var r = this.$(this.Y, e); | |
return new Jt(r, this.h, this); | |
} | |
}, { | |
key: "reverseUpperBound", | |
value: function reverseUpperBound(e) { | |
var r = this.rr(this.Y, e); | |
return new Jt(r, this.h, this); | |
} | |
}, { | |
key: "setElement", | |
value: function setElement(e, r, n) { | |
return this.M(e, r, n); | |
} | |
}, { | |
key: "find", | |
value: function find(e) { | |
var r = this.I(this.Y, e); | |
return new Jt(r, this.h, this); | |
} | |
}, { | |
key: "getElementByKey", | |
value: function getElementByKey(e) { | |
return this.I(this.Y, e).l; | |
} | |
}, { | |
key: "union", | |
value: function union(e) { | |
var r = this; | |
return e.forEach(function (n) { | |
r.setElement(n[0], n[1]); | |
}), this.i; | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return this.K(this.Y); | |
} | |
}]); | |
}(w1["default"]), | |
m1 = al; | |
ks["default"] = m1; | |
}); | |
var ll = H(function (ul) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(ul, "t", { | |
value: !0 | |
}); | |
ul["default"] = v1; | |
function v1(t) { | |
var e = _typeof(t); | |
return e === "object" && t !== null || e === "function"; | |
} | |
}); | |
var dl = H(function (bi) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(bi, "t", { | |
value: !0 | |
}); | |
bi.HashContainerIterator = bi.HashContainer = void 0; | |
var gg = fr(), | |
fl = S1(ll()), | |
eo = cr(); | |
function S1(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var cl = /*#__PURE__*/function (_gg$ContainerIterator) { | |
function cl(e, r, n) { | |
var _this42; | |
_classCallCheck(this, cl); | |
_this42 = _callSuper(this, cl, [n]), _this42.o = e, _this42.h = r, _this42.iteratorType === 0 ? (_this42.pre = function () { | |
return this.o.L === this.h && (0, eo.throwIteratorAccessError)(), this.o = this.o.L, this; | |
}, _this42.next = function () { | |
return this.o === this.h && (0, eo.throwIteratorAccessError)(), this.o = this.o.B, this; | |
}) : (_this42.pre = function () { | |
return this.o.B === this.h && (0, eo.throwIteratorAccessError)(), this.o = this.o.B, this; | |
}, _this42.next = function () { | |
return this.o === this.h && (0, eo.throwIteratorAccessError)(), this.o = this.o.L, this; | |
}); | |
return _this42; | |
} | |
_inherits(cl, _gg$ContainerIterator); | |
return _createClass(cl); | |
}(gg.ContainerIterator); | |
bi.HashContainerIterator = cl; | |
var hl = /*#__PURE__*/function (_gg$Container) { | |
function hl() { | |
var _this43; | |
_classCallCheck(this, hl); | |
_this43 = _callSuper(this, hl), _this43.H = [], _this43.g = {}, _this43.HASH_TAG = Symbol("@@HASH_TAG"), Object.setPrototypeOf(_this43.g, null), _this43.h = {}, _this43.h.L = _this43.h.B = _this43.p = _this43._ = _this43.h; | |
return _this43; | |
} | |
_inherits(hl, _gg$Container); | |
return _createClass(hl, [{ | |
key: "V", | |
value: function V(e) { | |
var r = e.L, | |
n = e.B; | |
r.B = n, n.L = r, e === this.p && (this.p = n), e === this._ && (this._ = r), this.i -= 1; | |
} | |
}, { | |
key: "M", | |
value: function M(e, r, n) { | |
n === void 0 && (n = (0, fl["default"])(e)); | |
var i; | |
if (n) { | |
var _s23 = e[this.HASH_TAG]; | |
if (_s23 !== void 0) return this.H[_s23].l = r, this.i; | |
Object.defineProperty(e, this.HASH_TAG, { | |
value: this.H.length, | |
configurable: !0 | |
}), i = { | |
u: e, | |
l: r, | |
L: this._, | |
B: this.h | |
}, this.H.push(i); | |
} else { | |
var _s24 = this.g[e]; | |
if (_s24) return _s24.l = r, this.i; | |
i = { | |
u: e, | |
l: r, | |
L: this._, | |
B: this.h | |
}, this.g[e] = i; | |
} | |
return this.i === 0 ? (this.p = i, this.h.B = i) : this._.B = i, this._ = i, this.h.L = i, ++this.i; | |
} | |
}, { | |
key: "I", | |
value: function I(e, r) { | |
if (r === void 0 && (r = (0, fl["default"])(e)), r) { | |
var n = e[this.HASH_TAG]; | |
return n === void 0 ? this.h : this.H[n]; | |
} else return this.g[e] || this.h; | |
} | |
}, { | |
key: "clear", | |
value: function clear() { | |
var e = this.HASH_TAG; | |
this.H.forEach(function (r) { | |
delete r.u[e]; | |
}), this.H = [], this.g = {}, Object.setPrototypeOf(this.g, null), this.i = 0, this.p = this._ = this.h.L = this.h.B = this.h; | |
} | |
}, { | |
key: "eraseElementByKey", | |
value: function eraseElementByKey(e, r) { | |
var n; | |
if (r === void 0 && (r = (0, fl["default"])(e)), r) { | |
var i = e[this.HASH_TAG]; | |
if (i === void 0) return !1; | |
delete e[this.HASH_TAG], n = this.H[i], delete this.H[i]; | |
} else { | |
if (n = this.g[e], n === void 0) return !1; | |
delete this.g[e]; | |
} | |
return this.V(n), !0; | |
} | |
}, { | |
key: "eraseElementByIterator", | |
value: function eraseElementByIterator(e) { | |
var r = e.o; | |
return r === this.h && (0, eo.throwIteratorAccessError)(), this.V(r), e.next(); | |
} | |
}, { | |
key: "eraseElementByPos", | |
value: function eraseElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = this.p; | |
for (; e--;) r = r.B; | |
return this.V(r), this.i; | |
} | |
}]); | |
}(gg.Container); | |
bi.HashContainer = hl; | |
}); | |
var bg = H(function (Ms) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Ms, "t", { | |
value: !0 | |
}); | |
Ms["default"] = void 0; | |
var wg = dl(), | |
E1 = cr(), | |
xn = /*#__PURE__*/function (_wg$HashContainerIter) { | |
function t(e, r, n, i) { | |
var _this44; | |
_classCallCheck(this, t); | |
_this44 = _callSuper(this, t, [e, r, i]), _this44.container = n; | |
return _this44; | |
} | |
_inherits(t, _wg$HashContainerIter); | |
return _createClass(t, [{ | |
key: "pointer", | |
get: function get() { | |
return this.o === this.h && (0, E1.throwIteratorAccessError)(), this.o.u; | |
} | |
}, { | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.h, this.container, this.iteratorType); | |
} | |
}]); | |
}(wg.HashContainerIterator), | |
pl = /*#__PURE__*/function (_wg$HashContainer) { | |
function pl() { | |
var _this45; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
_classCallCheck(this, pl); | |
_this45 = _callSuper(this, pl); | |
var r = _this45; | |
e.forEach(function (n) { | |
r.insert(n); | |
}); | |
return _this45; | |
} | |
_inherits(pl, _wg$HashContainer); | |
return _createClass(pl, [{ | |
key: "begin", | |
value: function begin() { | |
return new xn(this.p, this.h, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new xn(this.h, this.h, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new xn(this._, this.h, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new xn(this.h, this.h, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
return this.p.u; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
return this._.u; | |
} | |
}, { | |
key: "insert", | |
value: function insert(e, r) { | |
return this.M(e, void 0, r); | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = this.p; | |
for (; e--;) r = r.B; | |
return r.u; | |
} | |
}, { | |
key: "find", | |
value: function find(e, r) { | |
var n = this.I(e, r); | |
return new xn(n, this.h, this); | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
var r = 0, | |
n = this.p; | |
for (; n !== this.h;) e(n.u, r++, this), n = n.B; | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() { | |
var e; | |
return _regeneratorRuntime().wrap(function _callee37$(_context46) { | |
while (1) switch (_context46.prev = _context46.next) { | |
case 0: | |
e = this.p; | |
case 1: | |
if (!(e !== this.h)) { | |
_context46.next = 7; | |
break; | |
} | |
_context46.next = 4; | |
return e.u; | |
case 4: | |
e = e.B; | |
case 5: | |
_context46.next = 1; | |
break; | |
case 7: | |
case "end": | |
return _context46.stop(); | |
} | |
}, _callee37, this); | |
}).bind(this)(); | |
} | |
}]); | |
}(wg.HashContainer), | |
A1 = pl; | |
Ms["default"] = A1; | |
}); | |
var mg = H(function (Ns) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Ns, "t", { | |
value: !0 | |
}); | |
Ns["default"] = void 0; | |
var _g = dl(), | |
I1 = P1(ll()), | |
T1 = cr(); | |
function P1(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
var Bn = /*#__PURE__*/function (_g$HashContainerItera) { | |
function t(e, r, n, i) { | |
var _this46; | |
_classCallCheck(this, t); | |
_this46 = _callSuper(this, t, [e, r, i]), _this46.container = n; | |
return _this46; | |
} | |
_inherits(t, _g$HashContainerItera); | |
return _createClass(t, [{ | |
key: "pointer", | |
get: function get() { | |
this.o === this.h && (0, T1.throwIteratorAccessError)(); | |
var e = this; | |
return new Proxy([], { | |
get: function get(r, n) { | |
if (n === "0") return e.o.u; | |
if (n === "1") return e.o.l; | |
}, | |
set: function set(r, n, i) { | |
if (n !== "1") throw new TypeError("props must be 1"); | |
return e.o.l = i, !0; | |
} | |
}); | |
} | |
}, { | |
key: "copy", | |
value: function copy() { | |
return new t(this.o, this.h, this.container, this.iteratorType); | |
} | |
}]); | |
}(_g.HashContainerIterator), | |
yl = /*#__PURE__*/function (_g$HashContainer) { | |
function yl() { | |
var _this47; | |
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | |
_classCallCheck(this, yl); | |
_this47 = _callSuper(this, yl); | |
var r = _this47; | |
e.forEach(function (n) { | |
r.setElement(n[0], n[1]); | |
}); | |
return _this47; | |
} | |
_inherits(yl, _g$HashContainer); | |
return _createClass(yl, [{ | |
key: "begin", | |
value: function begin() { | |
return new Bn(this.p, this.h, this); | |
} | |
}, { | |
key: "end", | |
value: function end() { | |
return new Bn(this.h, this.h, this); | |
} | |
}, { | |
key: "rBegin", | |
value: function rBegin() { | |
return new Bn(this._, this.h, this, 1); | |
} | |
}, { | |
key: "rEnd", | |
value: function rEnd() { | |
return new Bn(this.h, this.h, this, 1); | |
} | |
}, { | |
key: "front", | |
value: function front() { | |
if (this.i !== 0) return [this.p.u, this.p.l]; | |
} | |
}, { | |
key: "back", | |
value: function back() { | |
if (this.i !== 0) return [this._.u, this._.l]; | |
} | |
}, { | |
key: "setElement", | |
value: function setElement(e, r, n) { | |
return this.M(e, r, n); | |
} | |
}, { | |
key: "getElementByKey", | |
value: function getElementByKey(e, r) { | |
if (r === void 0 && (r = (0, I1["default"])(e)), r) { | |
var i = e[this.HASH_TAG]; | |
return i !== void 0 ? this.H[i].l : void 0; | |
} | |
var n = this.g[e]; | |
return n ? n.l : void 0; | |
} | |
}, { | |
key: "getElementByPos", | |
value: function getElementByPos(e) { | |
if (e < 0 || e > this.i - 1) throw new RangeError(); | |
var r = this.p; | |
for (; e--;) r = r.B; | |
return [r.u, r.l]; | |
} | |
}, { | |
key: "find", | |
value: function find(e, r) { | |
var n = this.I(e, r); | |
return new Bn(n, this.h, this); | |
} | |
}, { | |
key: "forEach", | |
value: function forEach(e) { | |
var r = 0, | |
n = this.p; | |
for (; n !== this.h;) e([n.u, n.l], r++, this), n = n.B; | |
} | |
}, { | |
key: Symbol.iterator, | |
value: function value() { | |
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() { | |
var e; | |
return _regeneratorRuntime().wrap(function _callee38$(_context47) { | |
while (1) switch (_context47.prev = _context47.next) { | |
case 0: | |
e = this.p; | |
case 1: | |
if (!(e !== this.h)) { | |
_context47.next = 7; | |
break; | |
} | |
_context47.next = 4; | |
return [e.u, e.l]; | |
case 4: | |
e = e.B; | |
case 5: | |
_context47.next = 1; | |
break; | |
case 7: | |
case "end": | |
return _context47.stop(); | |
} | |
}, _callee38, this); | |
}).bind(this)(); | |
} | |
}]); | |
}(_g.HashContainer), | |
R1 = yl; | |
Ns["default"] = R1; | |
}); | |
var vg = H(function (Mt) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Mt, "t", { | |
value: !0 | |
}); | |
Object.defineProperty(Mt, "Deque", { | |
enumerable: !0, | |
get: function get() { | |
return M1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "HashMap", { | |
enumerable: !0, | |
get: function get() { | |
return U1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "HashSet", { | |
enumerable: !0, | |
get: function get() { | |
return q1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "LinkList", { | |
enumerable: !0, | |
get: function get() { | |
return k1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "OrderedMap", { | |
enumerable: !0, | |
get: function get() { | |
return L1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "OrderedSet", { | |
enumerable: !0, | |
get: function get() { | |
return N1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "PriorityQueue", { | |
enumerable: !0, | |
get: function get() { | |
return B1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "Queue", { | |
enumerable: !0, | |
get: function get() { | |
return x1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "Stack", { | |
enumerable: !0, | |
get: function get() { | |
return O1["default"]; | |
} | |
}); | |
Object.defineProperty(Mt, "Vector", { | |
enumerable: !0, | |
get: function get() { | |
return C1["default"]; | |
} | |
}); | |
var O1 = hr(ng()), | |
x1 = hr(ig()), | |
B1 = hr(og()), | |
C1 = hr(sg()), | |
k1 = hr(ag()), | |
M1 = hr(ug()), | |
N1 = hr(dg()), | |
L1 = hr(yg()), | |
q1 = hr(bg()), | |
U1 = hr(mg()); | |
function hr(t) { | |
return t && t.t ? t : { | |
"default": t | |
}; | |
} | |
}); | |
var Eg = H(function (gq, Sg) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var D1 = vg().OrderedSet, | |
dr = sr()("number-allocator:trace"), | |
F1 = sr()("number-allocator:error"); | |
function pt(t, e) { | |
this.low = t, this.high = e; | |
} | |
pt.prototype.equals = function (t) { | |
return this.low === t.low && this.high === t.high; | |
}; | |
pt.prototype.compare = function (t) { | |
return this.low < t.low && this.high < t.low ? -1 : t.low < this.low && t.high < this.low ? 1 : 0; | |
}; | |
function pr(t, e) { | |
if (!(this instanceof pr)) return new pr(t, e); | |
this.min = t, this.max = e, this.ss = new D1([], function (r, n) { | |
return r.compare(n); | |
}), dr("Create"), this.clear(); | |
} | |
pr.prototype.firstVacant = function () { | |
return this.ss.size() === 0 ? null : this.ss.front().low; | |
}; | |
pr.prototype.alloc = function () { | |
if (this.ss.size() === 0) return dr("alloc():empty"), null; | |
var t = this.ss.begin(), | |
e = t.pointer.low, | |
r = t.pointer.high, | |
n = e; | |
return n + 1 <= r ? this.ss.updateKeyByIterator(t, new pt(e + 1, r)) : this.ss.eraseElementByPos(0), dr("alloc():" + n), n; | |
}; | |
pr.prototype.use = function (t) { | |
var e = new pt(t, t), | |
r = this.ss.lowerBound(e); | |
if (!r.equals(this.ss.end())) { | |
var n = r.pointer.low, | |
i = r.pointer.high; | |
return r.pointer.equals(e) ? (this.ss.eraseElementByIterator(r), dr("use():" + t), !0) : n > t ? !1 : n === t ? (this.ss.updateKeyByIterator(r, new pt(n + 1, i)), dr("use():" + t), !0) : i === t ? (this.ss.updateKeyByIterator(r, new pt(n, i - 1)), dr("use():" + t), !0) : (this.ss.updateKeyByIterator(r, new pt(t + 1, i)), this.ss.insert(new pt(n, t - 1)), dr("use():" + t), !0); | |
} | |
return dr("use():failed"), !1; | |
}; | |
pr.prototype.free = function (t) { | |
if (t < this.min || t > this.max) { | |
F1("free():" + t + " is out of range"); | |
return; | |
} | |
var e = new pt(t, t), | |
r = this.ss.upperBound(e); | |
if (r.equals(this.ss.end())) { | |
if (r.equals(this.ss.begin())) { | |
this.ss.insert(e); | |
return; | |
} | |
r.pre(); | |
var n = r.pointer.high; | |
r.pointer.high + 1 === t ? this.ss.updateKeyByIterator(r, new pt(n, t)) : this.ss.insert(e); | |
} else if (r.equals(this.ss.begin())) { | |
if (t + 1 === r.pointer.low) { | |
var _n11 = r.pointer.high; | |
this.ss.updateKeyByIterator(r, new pt(t, _n11)); | |
} else this.ss.insert(e); | |
} else { | |
var _n12 = r.pointer.low, | |
i = r.pointer.high; | |
r.pre(); | |
var _s25 = r.pointer.low; | |
r.pointer.high + 1 === t ? t + 1 === _n12 ? (this.ss.eraseElementByIterator(r), this.ss.updateKeyByIterator(r, new pt(_s25, i))) : this.ss.updateKeyByIterator(r, new pt(_s25, t)) : t + 1 === _n12 ? (this.ss.eraseElementByIterator(r.next()), this.ss.insert(new pt(t, i))) : this.ss.insert(e); | |
} | |
dr("free():" + t); | |
}; | |
pr.prototype.clear = function () { | |
dr("clear()"), this.ss.clear(), this.ss.insert(new pt(this.min, this.max)); | |
}; | |
pr.prototype.intervalCount = function () { | |
return this.ss.size(); | |
}; | |
pr.prototype.dump = function () { | |
console.log("length:" + this.ss.size()); | |
var _iterator27 = _createForOfIteratorHelper(this.ss), | |
_step27; | |
try { | |
for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) { | |
var t = _step27.value; | |
console.log(t); | |
} | |
} catch (err) { | |
_iterator27.e(err); | |
} finally { | |
_iterator27.f(); | |
} | |
}; | |
Sg.exports = pr; | |
}); | |
var gl = H(function (Eq, Ag) { | |
P(); | |
O(); | |
R(); | |
var j1 = Eg(); | |
Ag.exports.NumberAllocator = j1; | |
}); | |
var Ig = H(function (Cn) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var W1 = Cn && Cn.__read || function (t, e) { | |
var r = typeof Symbol == "function" && t[Symbol.iterator]; | |
if (!r) return t; | |
var n = r.call(t), | |
i, | |
s = [], | |
o; | |
try { | |
for (; (e === void 0 || e-- > 0) && !(i = n.next()).done;) s.push(i.value); | |
} catch (a) { | |
o = { | |
error: a | |
}; | |
} finally { | |
try { | |
i && !i.done && (r = n["return"]) && r.call(n); | |
} finally { | |
if (o) throw o.error; | |
} | |
} | |
return s; | |
}, | |
$1 = Cn && Cn.__spreadArray || function (t, e, r) { | |
if (r || arguments.length === 2) for (var n = 0, i = e.length, s; n < i; n++) (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]); | |
return t.concat(s || Array.prototype.slice.call(e)); | |
}; | |
Object.defineProperty(Cn, "__esModule", { | |
value: !0 | |
}); | |
var H1 = rg(), | |
V1 = gl(), | |
z1 = function () { | |
function t(e) { | |
e > 0 && (this.aliasToTopic = new H1.LRUCache({ | |
max: e | |
}), this.topicToAlias = {}, this.numberAllocator = new V1.NumberAllocator(1, e), this.max = e, this.length = 0); | |
} | |
return t.prototype.put = function (e, r) { | |
if (r === 0 || r > this.max) return !1; | |
var n = this.aliasToTopic.get(r); | |
return n && delete this.topicToAlias[n], this.aliasToTopic.set(r, e), this.topicToAlias[e] = r, this.numberAllocator.use(r), this.length = this.aliasToTopic.size, !0; | |
}, t.prototype.getTopicByAlias = function (e) { | |
return this.aliasToTopic.get(e); | |
}, t.prototype.getAliasByTopic = function (e) { | |
var r = this.topicToAlias[e]; | |
return typeof r != "undefined" && this.aliasToTopic.get(r), r; | |
}, t.prototype.clear = function () { | |
this.aliasToTopic.clear(), this.topicToAlias = {}, this.numberAllocator.clear(), this.length = 0; | |
}, t.prototype.getLruAlias = function () { | |
var e = this.numberAllocator.firstVacant(); | |
return e || $1([], W1(this.aliasToTopic.keys()), !1)[this.aliasToTopic.size - 1]; | |
}, t; | |
}(); | |
Cn["default"] = z1; | |
}); | |
var Tg = H(function (to) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var K1 = to && to.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(to, "__esModule", { | |
value: !0 | |
}); | |
var G1 = zi(), | |
Q1 = K1(Ig()), | |
Y1 = vn(), | |
J1 = function J1(t, e) { | |
t.log("_handleConnack"); | |
var r = t.options, | |
n = r.protocolVersion, | |
i = n === 5 ? e.reasonCode : e.returnCode; | |
if (clearTimeout(t.connackTimer), delete t.topicAliasSend, e.properties) { | |
if (e.properties.topicAliasMaximum) { | |
if (e.properties.topicAliasMaximum > 65535) { | |
t.emit("error", new Error("topicAliasMaximum from broker is out of range")); | |
return; | |
} | |
e.properties.topicAliasMaximum > 0 && (t.topicAliasSend = new Q1["default"](e.properties.topicAliasMaximum)); | |
} | |
e.properties.serverKeepAlive && r.keepalive && (r.keepalive = e.properties.serverKeepAlive), e.properties.maximumPacketSize && (r.properties || (r.properties = {}), r.properties.maximumPacketSize = e.properties.maximumPacketSize); | |
} | |
if (i === 0) t.reconnecting = !1, t._onConnect(e);else if (i > 0) { | |
var s = new Y1.ErrorWithReasonCode("Connection refused: ".concat(G1.ReasonCodes[i]), i); | |
t.emit("error", s), t.options.reconnectOnConnackError && t._cleanUp(!0); | |
} | |
}; | |
to["default"] = J1; | |
}); | |
var Pg = H(function (wl) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(wl, "__esModule", { | |
value: !0 | |
}); | |
var X1 = function X1(t, e, r) { | |
t.log("handling pubrel packet"); | |
var n = typeof r != "undefined" ? r : t.noop, | |
i = e.messageId, | |
s = { | |
cmd: "pubcomp", | |
messageId: i | |
}; | |
t.incomingStore.get(e, function (o, a) { | |
o ? t._sendPacket(s, n) : (t.emit("message", a.topic, a.payload, a), t.handleMessage(a, function (l) { | |
if (l) return n(l); | |
t.incomingStore.del(a, t.noop), t._sendPacket(s, n); | |
})); | |
}); | |
}; | |
wl["default"] = X1; | |
}); | |
var Rg = H(function (ro) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var no = ro && ro.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(ro, "__esModule", { | |
value: !0 | |
}); | |
var Z1 = no(Hy()), | |
eA = no(Qy()), | |
tA = no(Tg()), | |
rA = no(zi()), | |
nA = no(Pg()), | |
iA = function iA(t, e, r) { | |
var n = t.options; | |
if (n.protocolVersion === 5 && n.properties && n.properties.maximumPacketSize && n.properties.maximumPacketSize < e.length) return t.emit("error", new Error("exceeding packets size ".concat(e.cmd))), t.end({ | |
reasonCode: 149, | |
properties: { | |
reasonString: "Maximum packet size was exceeded" | |
} | |
}), t; | |
switch (t.log("_handlePacket :: emitting packetreceive"), t.emit("packetreceive", e), e.cmd) { | |
case "publish": | |
(0, Z1["default"])(t, e, r); | |
break; | |
case "puback": | |
case "pubrec": | |
case "pubcomp": | |
case "suback": | |
case "unsuback": | |
t.reschedulePing(), (0, rA["default"])(t, e), r(); | |
break; | |
case "pubrel": | |
t.reschedulePing(), (0, nA["default"])(t, e, r); | |
break; | |
case "connack": | |
(0, tA["default"])(t, e), r(); | |
break; | |
case "auth": | |
t.reschedulePing(), (0, eA["default"])(t, e), r(); | |
break; | |
case "pingresp": | |
t.log("_handlePacket :: received pingresp"), t.reschedulePing(!0), r(); | |
break; | |
case "disconnect": | |
t.emit("disconnect", e), r(); | |
break; | |
default: | |
t.log("_handlePacket :: unknown command"), r(); | |
break; | |
} | |
}; | |
ro["default"] = iA; | |
}); | |
var xg = H(function (_i) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var oA = _i && _i.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(_i, "__esModule", { | |
value: !0 | |
}); | |
_i.TypedEventEmitter = void 0; | |
var sA = oA((qr(), Ie(Lr))), | |
aA = vn(), | |
Og = function () { | |
function t() {} | |
return t; | |
}(); | |
_i.TypedEventEmitter = Og; | |
(0, aA.applyMixin)(Og, sA["default"]); | |
}); | |
var io = H(function (kn) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(kn, "__esModule", { | |
value: !0 | |
}); | |
kn.isReactNativeBrowser = kn.isWebWorker = void 0; | |
var uA = function uA() { | |
var t; | |
if (typeof window != "undefined") { | |
var e = typeof navigator != "undefined" && ((t = navigator.userAgent) === null || t === void 0 ? void 0 : t.toLowerCase().indexOf(" electron/")) > -1; | |
if (e && !(L === null || L === void 0) && L.versions) { | |
var r = Object.prototype.hasOwnProperty.call(L.versions, "electron"); | |
return !r; | |
} | |
return typeof window.document != "undefined"; | |
} | |
return !1; | |
}, | |
Bg = function Bg() { | |
var t, e; | |
return !!((typeof self === "undefined" ? "undefined" : _typeof(self)) == "object" && !((e = (t = self == null ? void 0 : self.constructor) === null || t === void 0 ? void 0 : t.name) === null || e === void 0) && e.includes("WorkerGlobalScope")); | |
}, | |
Cg = function Cg() { | |
return typeof navigator != "undefined" && navigator.product === "ReactNative"; | |
}, | |
lA = uA() || Bg() || Cg(); | |
kn.isWebWorker = Bg(); | |
kn.isReactNativeBrowser = Cg(); | |
kn["default"] = lA; | |
}); | |
var Mg = H(function (Ls, kg) { | |
P(); | |
O(); | |
R(); | |
(function (t, e) { | |
_typeof(Ls) == "object" && typeof kg != "undefined" ? e(Ls) : typeof define == "function" && define.amd ? define(["exports"], e) : (t = typeof globalThis != "undefined" ? globalThis : t || self, e(t.fastUniqueNumbers = {})); | |
})(Ls, function (t) { | |
"use strict"; | |
var e = function e(m) { | |
return function (w) { | |
var T = m(w); | |
return w.add(T), T; | |
}; | |
}, | |
r = function r(m) { | |
return function (w, T) { | |
return m.set(w, T), T; | |
}; | |
}, | |
n = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, | |
i = 536870912, | |
s = i * 2, | |
o = function o(m, w) { | |
return function (T) { | |
var v = w.get(T), | |
b = v === void 0 ? T.size : v < s ? v + 1 : 0; | |
if (!T.has(b)) return m(T, b); | |
if (T.size < i) { | |
for (; T.has(b);) b = Math.floor(Math.random() * s); | |
return m(T, b); | |
} | |
if (T.size > n) throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!"); | |
for (; T.has(b);) b = Math.floor(Math.random() * n); | |
return m(T, b); | |
}; | |
}, | |
a = new WeakMap(), | |
l = r(a), | |
c = o(l, a), | |
d = e(c); | |
t.addUniqueNumber = d, t.generateUniqueNumber = c; | |
}); | |
}); | |
var Lg = H(function (qs, Ng) { | |
P(); | |
O(); | |
R(); | |
(function (t, e) { | |
_typeof(qs) == "object" && typeof Ng != "undefined" ? e(qs, Mg()) : typeof define == "function" && define.amd ? define(["exports", "fast-unique-numbers"], e) : (t = typeof globalThis != "undefined" ? globalThis : t || self, e(t.workerTimersBroker = {}, t.fastUniqueNumbers)); | |
})(qs, function (t, e) { | |
"use strict"; | |
var r = function r(o) { | |
return o.method !== void 0 && o.method === "call"; | |
}, | |
n = function n(o) { | |
return o.error === null && typeof o.id == "number"; | |
}, | |
i = function i(o) { | |
var a = new Map([[0, function () {}]]), | |
l = new Map([[0, function () {}]]), | |
c = new Map(), | |
d = new Worker(o); | |
d.addEventListener("message", function (v) { | |
var b = v.data; | |
if (r(b)) { | |
var p = b.params, | |
_ = p.timerId, | |
x = p.timerType; | |
if (x === "interval") { | |
var I = a.get(_); | |
if (typeof I == "number") { | |
var y = c.get(I); | |
if (y === void 0 || y.timerId !== _ || y.timerType !== x) throw new Error("The timer is in an undefined state."); | |
} else if (typeof I != "undefined") I();else throw new Error("The timer is in an undefined state."); | |
} else if (x === "timeout") { | |
var B = l.get(_); | |
if (typeof B == "number") { | |
var A = c.get(B); | |
if (A === void 0 || A.timerId !== _ || A.timerType !== x) throw new Error("The timer is in an undefined state."); | |
} else if (typeof B != "undefined") B(), l["delete"](_);else throw new Error("The timer is in an undefined state."); | |
} | |
} else if (n(b)) { | |
var q = b.id, | |
$ = c.get(q); | |
if ($ === void 0) throw new Error("The timer is in an undefined state."); | |
var F = $.timerId, | |
Z = $.timerType; | |
c["delete"](q), Z === "interval" ? a["delete"](F) : l["delete"](F); | |
} else { | |
var j = b.error.message; | |
throw new Error(j); | |
} | |
}); | |
var h = function h(b) { | |
var p = e.generateUniqueNumber(c); | |
c.set(p, { | |
timerId: b, | |
timerType: "interval" | |
}), a.set(b, p), d.postMessage({ | |
id: p, | |
method: "clear", | |
params: { | |
timerId: b, | |
timerType: "interval" | |
} | |
}); | |
}, | |
m = function m(b) { | |
var p = e.generateUniqueNumber(c); | |
c.set(p, { | |
timerId: b, | |
timerType: "timeout" | |
}), l.set(b, p), d.postMessage({ | |
id: p, | |
method: "clear", | |
params: { | |
timerId: b, | |
timerType: "timeout" | |
} | |
}); | |
}, | |
w = function w(b) { | |
var p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, | |
_ = e.generateUniqueNumber(a); | |
return a.set(_, function () { | |
b(), typeof a.get(_) == "function" && d.postMessage({ | |
id: null, | |
method: "set", | |
params: { | |
delay: p, | |
now: performance.now(), | |
timerId: _, | |
timerType: "interval" | |
} | |
}); | |
}), d.postMessage({ | |
id: null, | |
method: "set", | |
params: { | |
delay: p, | |
now: performance.now(), | |
timerId: _, | |
timerType: "interval" | |
} | |
}), _; | |
}, | |
T = function T(b) { | |
var p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, | |
_ = e.generateUniqueNumber(l); | |
return l.set(_, b), d.postMessage({ | |
id: null, | |
method: "set", | |
params: { | |
delay: p, | |
now: performance.now(), | |
timerId: _, | |
timerType: "timeout" | |
} | |
}), _; | |
}; | |
return { | |
clearInterval: h, | |
clearTimeout: m, | |
setInterval: w, | |
setTimeout: T | |
}; | |
}; | |
t.load = i; | |
}); | |
}); | |
var Ug = H(function (Us, qg) { | |
P(); | |
O(); | |
R(); | |
(function (t, e) { | |
_typeof(Us) == "object" && typeof qg != "undefined" ? e(Us, Lg()) : typeof define == "function" && define.amd ? define(["exports", "worker-timers-broker"], e) : (t = typeof globalThis != "undefined" ? globalThis : t || self, e(t.workerTimers = {}, t.workerTimersBroker)); | |
})(Us, function (t, e) { | |
"use strict"; | |
var r = function r(d, h) { | |
var m = null; | |
return function () { | |
if (m !== null) return m; | |
var w = new Blob([h], { | |
type: "application/javascript; charset=utf-8" | |
}), | |
T = URL.createObjectURL(w); | |
return m = d(T), setTimeout(function () { | |
return URL.revokeObjectURL(T); | |
}), m; | |
}; | |
}, | |
n = "(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i=\"function\"==typeof(o=function(){\"use strict\";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id \"'.concat(t,'\".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id \"'.concat(e,'\".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:\"call\",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,\"interval\"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,\"timeout\"))};addEventListener(\"message\",(function(e){var t=e.data;try{if(\"clear\"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if(\"interval\"===c)r(d),postMessage({error:null,id:i});else{if(\"timeout\"!==c)throw new Error('The given type \"'.concat(c,'\" is not supported'));o(d),postMessage({error:null,id:i})}}else{if(\"set\"!==t.method)throw new Error('The given method \"'.concat(t.method,'\" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if(\"interval\"===v)a(l,m,p);else{if(\"timeout\"!==v)throw new Error('The given type \"'.concat(v,'\" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{\"use strict\";r(472)})()})();", | |
i = r(e.load, n), | |
s = function s(d) { | |
return i().clearInterval(d); | |
}, | |
o = function o(d) { | |
return i().clearTimeout(d); | |
}, | |
a = function a() { | |
var d; | |
return (d = i()).setInterval.apply(d, arguments); | |
}, | |
l = function l() { | |
var d; | |
return (d = i()).setTimeout.apply(d, arguments); | |
}; | |
t.clearInterval = s, t.clearTimeout = o, t.setInterval = a, t.setTimeout = l; | |
}); | |
}); | |
var Wg = H(function (Rr) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var fA = Rr && Rr.__createBinding || (Object.create ? function (t, e, r, n) { | |
n === void 0 && (n = r); | |
var i = Object.getOwnPropertyDescriptor(e, r); | |
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { | |
enumerable: !0, | |
get: function get() { | |
return e[r]; | |
} | |
}), Object.defineProperty(t, n, i); | |
} : function (t, e, r, n) { | |
n === void 0 && (n = r), t[n] = e[r]; | |
}), | |
cA = Rr && Rr.__setModuleDefault || (Object.create ? function (t, e) { | |
Object.defineProperty(t, "default", { | |
enumerable: !0, | |
value: e | |
}); | |
} : function (t, e) { | |
t["default"] = e; | |
}), | |
hA = Rr && Rr.__importStar || function () { | |
var _t5 = function t(e) { | |
return _t5 = Object.getOwnPropertyNames || function (r) { | |
var n = []; | |
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[n.length] = i); | |
return n; | |
}, _t5(e); | |
}; | |
return function (e) { | |
if (e && e.__esModule) return e; | |
var r = {}; | |
if (e != null) for (var n = _t5(e), i = 0; i < n.length; i++) n[i] !== "default" && fA(r, e, n[i]); | |
return cA(r, e), r; | |
}; | |
}(); | |
Object.defineProperty(Rr, "__esModule", { | |
value: !0 | |
}); | |
var bl = hA(io()), | |
Dg = Ug(), | |
Fg = { | |
set: Dg.setInterval, | |
clear: Dg.clearInterval | |
}, | |
jg = { | |
set: function set(t, e) { | |
return setInterval(t, e); | |
}, | |
clear: function clear(t) { | |
return clearInterval(t); | |
} | |
}, | |
dA = function dA(t) { | |
switch (t) { | |
case "native": | |
return jg; | |
case "worker": | |
return Fg; | |
case "auto": | |
default: | |
return bl["default"] && !bl.isWebWorker && !bl.isReactNativeBrowser ? Fg : jg; | |
} | |
}; | |
Rr["default"] = dA; | |
}); | |
var _l = H(function (oo) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var pA = oo && oo.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(oo, "__esModule", { | |
value: !0 | |
}); | |
var yA = pA(Wg()), | |
gA = function () { | |
function t(e, r) { | |
this.destroyed = !1, this.client = e, this.timer = _typeof(r) == "object" && "set" in r && "clear" in r ? r : (0, yA["default"])(r), this.setKeepalive(e.options.keepalive); | |
} | |
return Object.defineProperty(t.prototype, "keepaliveTimeoutTimestamp", { | |
get: function get() { | |
return this._keepaliveTimeoutTimestamp; | |
}, | |
enumerable: !1, | |
configurable: !0 | |
}), Object.defineProperty(t.prototype, "intervalEvery", { | |
get: function get() { | |
return this._intervalEvery; | |
}, | |
enumerable: !1, | |
configurable: !0 | |
}), Object.defineProperty(t.prototype, "keepalive", { | |
get: function get() { | |
return this._keepalive; | |
}, | |
enumerable: !1, | |
configurable: !0 | |
}), t.prototype.clear = function () { | |
this.timerId && (this.timer.clear(this.timerId), this.timerId = null); | |
}, t.prototype.setKeepalive = function (e) { | |
if (e *= 1e3, isNaN(e) || e <= 0 || e > 2147483647) throw new Error("Keepalive value must be an integer between 0 and 2147483647. Provided value is ".concat(e)); | |
this._keepalive = e, this.reschedule(), this.client.log("KeepaliveManager: set keepalive to ".concat(e, "ms")); | |
}, t.prototype.destroy = function () { | |
this.clear(), this.destroyed = !0; | |
}, t.prototype.reschedule = function () { | |
var e = this; | |
if (!this.destroyed) { | |
this.clear(), this.counter = 0; | |
var r = Math.ceil(this._keepalive * 1.5); | |
this._keepaliveTimeoutTimestamp = Date.now() + r, this._intervalEvery = Math.ceil(this._keepalive / 2), this.timerId = this.timer.set(function () { | |
e.destroyed || (e.counter += 1, e.counter === 2 ? e.client.sendPing() : e.counter > 2 && e.client.onKeepaliveTimeout()); | |
}, this._intervalEvery); | |
} | |
}, t; | |
}(); | |
oo["default"] = gA; | |
}); | |
var Fs = H(function (je) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var wA = je && je.__extends || function () { | |
var _t6 = function t(e, r) { | |
return _t6 = Object.setPrototypeOf || { | |
__proto__: [] | |
} instanceof Array && function (n, i) { | |
n.__proto__ = i; | |
} || function (n, i) { | |
for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (n[s] = i[s]); | |
}, _t6(e, r); | |
}; | |
return function (e, r) { | |
if (typeof r != "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); | |
_t6(e, r); | |
function n() { | |
this.constructor = e; | |
} | |
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n()); | |
}; | |
}(), | |
ut = je && je.__assign || function () { | |
return ut = Object.assign || function (t) { | |
for (var e, r = 1, n = arguments.length; r < n; r++) { | |
e = arguments[r]; | |
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); | |
} | |
return t; | |
}, ut.apply(this, arguments); | |
}, | |
bA = je && je.__createBinding || (Object.create ? function (t, e, r, n) { | |
n === void 0 && (n = r); | |
var i = Object.getOwnPropertyDescriptor(e, r); | |
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { | |
enumerable: !0, | |
get: function get() { | |
return e[r]; | |
} | |
}), Object.defineProperty(t, n, i); | |
} : function (t, e, r, n) { | |
n === void 0 && (n = r), t[n] = e[r]; | |
}), | |
_A = je && je.__setModuleDefault || (Object.create ? function (t, e) { | |
Object.defineProperty(t, "default", { | |
enumerable: !0, | |
value: e | |
}); | |
} : function (t, e) { | |
t["default"] = e; | |
}), | |
Kg = je && je.__importStar || function () { | |
var _t7 = function t(e) { | |
return _t7 = Object.getOwnPropertyNames || function (r) { | |
var n = []; | |
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[n.length] = i); | |
return n; | |
}, _t7(e); | |
}; | |
return function (e) { | |
if (e && e.__esModule) return e; | |
var r = {}; | |
if (e != null) for (var n = _t7(e), i = 0; i < n.length; i++) n[i] !== "default" && bA(r, e, n[i]); | |
return _A(r, e), r; | |
}; | |
}(), | |
mA = je && je.__read || function (t, e) { | |
var r = typeof Symbol == "function" && t[Symbol.iterator]; | |
if (!r) return t; | |
var n = r.call(t), | |
i, | |
s = [], | |
o; | |
try { | |
for (; (e === void 0 || e-- > 0) && !(i = n.next()).done;) s.push(i.value); | |
} catch (a) { | |
o = { | |
error: a | |
}; | |
} finally { | |
try { | |
i && !i.done && (r = n["return"]) && r.call(n); | |
} finally { | |
if (o) throw o.error; | |
} | |
} | |
return s; | |
}, | |
vA = je && je.__spreadArray || function (t, e, r) { | |
if (r || arguments.length === 2) for (var n = 0, i = e.length, s; n < i; n++) (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]); | |
return t.concat(s || Array.prototype.slice.call(e)); | |
}, | |
SA = je && je.__values || function (t) { | |
var e = typeof Symbol == "function" && Symbol.iterator, | |
r = e && t[e], | |
n = 0; | |
if (r) return r.call(t); | |
if (t && typeof t.length == "number") return { | |
next: function next() { | |
return t && n >= t.length && (t = void 0), { | |
value: t && t[n++], | |
done: !t | |
}; | |
} | |
}; | |
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); | |
}, | |
Jr = je && je.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(je, "__esModule", { | |
value: !0 | |
}); | |
var EA = Jr(oh()), | |
ml = Jr(Ly()), | |
AA = Jr(Bu()), | |
IA = Tr(), | |
$g = Jr(Fy()), | |
Hg = Kg(Wy()), | |
TA = Jr(sr()), | |
mi = Jr(Cu()), | |
PA = Jr(Rg()), | |
Ds = vn(), | |
RA = xg(), | |
OA = Jr(_l()), | |
Vg = Kg(io()), | |
vl = globalThis.setImmediate || function () { | |
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; | |
var r = t.shift(); | |
(0, Ds.nextTick)(function () { | |
r.apply(void 0, vA([], mA(t), !1)); | |
}); | |
}, | |
zg = { | |
keepalive: 60, | |
reschedulePings: !0, | |
protocolId: "MQTT", | |
protocolVersion: 4, | |
reconnectPeriod: 1e3, | |
connectTimeout: 30 * 1e3, | |
clean: !0, | |
resubscribe: !0, | |
writeCache: !0, | |
timerVariant: "auto" | |
}, | |
xA = function (t) { | |
wA(e, t); | |
function e(r, n) { | |
var i = t.call(this) || this; | |
i.options = n || {}; | |
for (var s in zg) typeof i.options[s] == "undefined" ? i.options[s] = zg[s] : i.options[s] = n[s]; | |
return i.log = i.options.log || (0, TA["default"])("mqttjs:client"), i.noop = i._noop.bind(i), i.log("MqttClient :: version:", e.VERSION), Vg.isWebWorker ? i.log("MqttClient :: environment", "webworker") : i.log("MqttClient :: environment", Vg["default"] ? "browser" : "node"), i.log("MqttClient :: options.protocol", n.protocol), i.log("MqttClient :: options.protocolVersion", n.protocolVersion), i.log("MqttClient :: options.username", n.username), i.log("MqttClient :: options.keepalive", n.keepalive), i.log("MqttClient :: options.reconnectPeriod", n.reconnectPeriod), i.log("MqttClient :: options.rejectUnauthorized", n.rejectUnauthorized), i.log("MqttClient :: options.properties.topicAliasMaximum", n.properties ? n.properties.topicAliasMaximum : void 0), i.options.clientId = typeof n.clientId == "string" ? n.clientId : e.defaultId(), i.log("MqttClient :: clientId", i.options.clientId), i.options.customHandleAcks = n.protocolVersion === 5 && n.customHandleAcks ? n.customHandleAcks : function () { | |
for (var o = [], a = 0; a < arguments.length; a++) o[a] = arguments[a]; | |
o[3](null, 0); | |
}, i.options.writeCache || (ml["default"].writeToStream.cacheNumbers = !1), i.streamBuilder = r, i.messageIdProvider = typeof i.options.messageIdProvider == "undefined" ? new AA["default"]() : i.options.messageIdProvider, i.outgoingStore = n.outgoingStore || new mi["default"](), i.incomingStore = n.incomingStore || new mi["default"](), i.queueQoSZero = n.queueQoSZero === void 0 ? !0 : n.queueQoSZero, i._resubscribeTopics = {}, i.messageIdToTopic = {}, i.keepaliveManager = null, i.connected = !1, i.disconnecting = !1, i.reconnecting = !1, i.queue = [], i.connackTimer = null, i.reconnectTimer = null, i._storeProcessing = !1, i._packetIdsDuringStoreProcessing = {}, i._storeProcessingQueue = [], i.outgoing = {}, i._firstConnection = !0, n.properties && n.properties.topicAliasMaximum > 0 && (n.properties.topicAliasMaximum > 65535 ? i.log("MqttClient :: options.properties.topicAliasMaximum is out of range") : i.topicAliasRecv = new EA["default"](n.properties.topicAliasMaximum)), i.on("connect", function () { | |
var o = i.queue, | |
a = function (_a15) { | |
function a() { | |
return _a15.apply(this, arguments); | |
} | |
a.toString = function () { | |
return _a15.toString(); | |
}; | |
return a; | |
}(function () { | |
var l = o.shift(); | |
i.log("deliver :: entry %o", l); | |
var c = null; | |
if (!l) { | |
i._resubscribe(); | |
return; | |
} | |
c = l.packet, i.log("deliver :: call _sendPacket for %o", c); | |
var d = !0; | |
c.messageId && c.messageId !== 0 && (i.messageIdProvider.register(c.messageId) || (d = !1)), d ? i._sendPacket(c, function (h) { | |
l.cb && l.cb(h), a(); | |
}) : (i.log("messageId: %d has already used. The message is skipped and removed.", c.messageId), a()); | |
}); | |
i.log("connect :: sending queued packets"), a(); | |
}), i.on("close", function () { | |
i.log("close :: connected set to `false`"), i.connected = !1, i.log("close :: clearing connackTimer"), clearTimeout(i.connackTimer), i._destroyKeepaliveManager(), i.topicAliasRecv && i.topicAliasRecv.clear(), i.log("close :: calling _setupReconnect"), i._setupReconnect(); | |
}), i.options.manualConnect || (i.log("MqttClient :: setting up stream"), i.connect()), i; | |
} | |
return e.defaultId = function () { | |
return "mqttjs_".concat(Math.random().toString(16).substr(2, 8)); | |
}, e.prototype.handleAuth = function (r, n) { | |
n(); | |
}, e.prototype.handleMessage = function (r, n) { | |
n(); | |
}, e.prototype._nextId = function () { | |
return this.messageIdProvider.allocate(); | |
}, e.prototype.getLastMessageId = function () { | |
return this.messageIdProvider.getLastAllocated(); | |
}, e.prototype.connect = function () { | |
var r = this, | |
n, | |
i = new IA.Writable(), | |
s = ml["default"].parser(this.options), | |
o = null, | |
a = []; | |
this.log("connect :: calling method to clear reconnect"), this._clearReconnect(), this.disconnected && !this.reconnecting && (this.incomingStore = this.options.incomingStore || new mi["default"](), this.outgoingStore = this.options.outgoingStore || new mi["default"](), this.disconnecting = !1, this.disconnected = !1), this.log("connect :: using streamBuilder provided to client to create stream"), this.stream = this.streamBuilder(this), s.on("packet", function (w) { | |
r.log("parser :: on packet push to packets array."), a.push(w); | |
}); | |
var l = function l() { | |
r.log("work :: getting next packet in queue"); | |
var w = a.shift(); | |
if (w) r.log("work :: packet pulled from queue"), (0, PA["default"])(r, w, c);else { | |
r.log("work :: no packets in queue"); | |
var T = o; | |
o = null, r.log("work :: done flag is %s", !!T), T && T(); | |
} | |
}, | |
c = function c() { | |
if (a.length) (0, Ds.nextTick)(l);else { | |
var w = o; | |
o = null, w(); | |
} | |
}; | |
i._write = function (w, T, v) { | |
o = v, r.log("writable stream :: parsing buffer"), s.parse(w), l(); | |
}; | |
var d = function d(w) { | |
r.log("streamErrorHandler :: error", w.message), w.code ? (r.log("streamErrorHandler :: emitting error"), r.emit("error", w)) : r.noop(w); | |
}; | |
this.log("connect :: pipe stream to writable stream"), this.stream.pipe(i), this.stream.on("error", d), this.stream.on("close", function () { | |
r.log("(%s)stream :: on close", r.options.clientId), r._flushVolatile(), r.log("stream: emit close to MqttClient"), r.emit("close"); | |
}), this.log("connect: sending packet `connect`"); | |
var h = { | |
cmd: "connect", | |
protocolId: this.options.protocolId, | |
protocolVersion: this.options.protocolVersion, | |
clean: this.options.clean, | |
clientId: this.options.clientId, | |
keepalive: this.options.keepalive, | |
username: this.options.username, | |
password: this.options.password, | |
properties: this.options.properties | |
}; | |
if (this.options.will && (h.will = ut(ut({}, this.options.will), { | |
payload: (n = this.options.will) === null || n === void 0 ? void 0 : n.payload | |
})), this.topicAliasRecv && (h.properties || (h.properties = {}), this.topicAliasRecv && (h.properties.topicAliasMaximum = this.topicAliasRecv.max)), this._writePacket(h), s.on("error", this.emit.bind(this, "error")), this.options.properties) { | |
if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData) return this.end(function () { | |
return r.emit("error", new Error("Packet has no Authentication Method")); | |
}), this; | |
if (this.options.properties.authenticationMethod && this.options.authPacket && _typeof(this.options.authPacket) == "object") { | |
var m = ut({ | |
cmd: "auth", | |
reasonCode: 0 | |
}, this.options.authPacket); | |
this._writePacket(m); | |
} | |
} | |
return this.stream.setMaxListeners(1e3), clearTimeout(this.connackTimer), this.connackTimer = setTimeout(function () { | |
r.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"), r.emit("error", new Error("connack timeout")), r._cleanUp(!0); | |
}, this.options.connectTimeout), this; | |
}, e.prototype.publish = function (r, n, i, s) { | |
var o = this; | |
this.log("publish :: message `%s` to topic `%s`", n, r); | |
var a = this.options; | |
typeof i == "function" && (s = i, i = null), i = i || {}; | |
var l = { | |
qos: 0, | |
retain: !1, | |
dup: !1 | |
}; | |
i = ut(ut({}, l), i); | |
var c = i.qos, | |
d = i.retain, | |
h = i.dup, | |
m = i.properties, | |
w = i.cbStorePut; | |
if (this._checkDisconnecting(s)) return this; | |
var T = function T() { | |
var v = 0; | |
if ((c === 1 || c === 2) && (v = o._nextId(), v === null)) return o.log("No messageId left"), !1; | |
var b = { | |
cmd: "publish", | |
topic: r, | |
payload: n, | |
qos: c, | |
retain: d, | |
messageId: v, | |
dup: h | |
}; | |
switch (a.protocolVersion === 5 && (b.properties = m), o.log("publish :: qos", c), c) { | |
case 1: | |
case 2: | |
o.outgoing[b.messageId] = { | |
"volatile": !1, | |
cb: s || o.noop | |
}, o.log("MqttClient:publish: packet cmd: %s", b.cmd), o._sendPacket(b, void 0, w); | |
break; | |
default: | |
o.log("MqttClient:publish: packet cmd: %s", b.cmd), o._sendPacket(b, s, w); | |
break; | |
} | |
return !0; | |
}; | |
return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !T()) && this._storeProcessingQueue.push({ | |
invoke: T, | |
cbStorePut: i.cbStorePut, | |
callback: s | |
}), this; | |
}, e.prototype.publishAsync = function (r, n, i) { | |
var s = this; | |
return new Promise(function (o, a) { | |
s.publish(r, n, i, function (l, c) { | |
l ? a(l) : o(c); | |
}); | |
}); | |
}, e.prototype.subscribe = function (r, n, i) { | |
var s = this, | |
o = this.options.protocolVersion; | |
typeof n == "function" && (i = n), i = i || this.noop; | |
var a = !1, | |
l = []; | |
typeof r == "string" ? (r = [r], l = r) : Array.isArray(r) ? l = r : _typeof(r) == "object" && (a = r.resubscribe, delete r.resubscribe, l = Object.keys(r)); | |
var c = Hg.validateTopics(l); | |
if (c !== null) return vl(i, new Error("Invalid topic ".concat(c))), this; | |
if (this._checkDisconnecting(i)) return this.log("subscribe: discconecting true"), this; | |
var d = { | |
qos: 0 | |
}; | |
o === 5 && (d.nl = !1, d.rap = !1, d.rh = 0), n = ut(ut({}, d), n); | |
var h = n.properties, | |
m = [], | |
w = function w(v, b) { | |
if (b = b || n, !Object.prototype.hasOwnProperty.call(s._resubscribeTopics, v) || s._resubscribeTopics[v].qos < b.qos || a) { | |
var p = { | |
topic: v, | |
qos: b.qos | |
}; | |
o === 5 && (p.nl = b.nl, p.rap = b.rap, p.rh = b.rh, p.properties = h), s.log("subscribe: pushing topic `%s` and qos `%s` to subs list", p.topic, p.qos), m.push(p); | |
} | |
}; | |
if (Array.isArray(r) ? r.forEach(function (v) { | |
s.log("subscribe: array topic %s", v), w(v); | |
}) : Object.keys(r).forEach(function (v) { | |
s.log("subscribe: object topic %s, %o", v, r[v]), w(v, r[v]); | |
}), !m.length) return i(null, []), this; | |
var T = function T() { | |
var v = s._nextId(); | |
if (v === null) return s.log("No messageId left"), !1; | |
var b = { | |
cmd: "subscribe", | |
subscriptions: m, | |
messageId: v | |
}; | |
if (h && (b.properties = h), s.options.resubscribe) { | |
s.log("subscribe :: resubscribe true"); | |
var p = []; | |
m.forEach(function (_) { | |
if (s.options.reconnectPeriod > 0) { | |
var x = { | |
qos: _.qos | |
}; | |
o === 5 && (x.nl = _.nl || !1, x.rap = _.rap || !1, x.rh = _.rh || 0, x.properties = _.properties), s._resubscribeTopics[_.topic] = x, p.push(_.topic); | |
} | |
}), s.messageIdToTopic[b.messageId] = p; | |
} | |
return s.outgoing[b.messageId] = { | |
"volatile": !0, | |
cb: function cb(_, x) { | |
if (!_) for (var I = x.granted, y = 0; y < I.length; y += 1) m[y].qos = I[y]; | |
i(_, m, x); | |
} | |
}, s.log("subscribe :: call _sendPacket"), s._sendPacket(b), !0; | |
}; | |
return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !T()) && this._storeProcessingQueue.push({ | |
invoke: T, | |
callback: i | |
}), this; | |
}, e.prototype.subscribeAsync = function (r, n) { | |
var i = this; | |
return new Promise(function (s, o) { | |
i.subscribe(r, n, function (a, l) { | |
a ? o(a) : s(l); | |
}); | |
}); | |
}, e.prototype.unsubscribe = function (r, n, i) { | |
var s = this; | |
typeof r == "string" && (r = [r]), typeof n == "function" && (i = n), i = i || this.noop; | |
var o = Hg.validateTopics(r); | |
if (o !== null) return vl(i, new Error("Invalid topic ".concat(o))), this; | |
if (this._checkDisconnecting(i)) return this; | |
var a = function a() { | |
var l = s._nextId(); | |
if (l === null) return s.log("No messageId left"), !1; | |
var c = { | |
cmd: "unsubscribe", | |
messageId: l, | |
unsubscriptions: [] | |
}; | |
return typeof r == "string" ? c.unsubscriptions = [r] : Array.isArray(r) && (c.unsubscriptions = r), s.options.resubscribe && c.unsubscriptions.forEach(function (d) { | |
delete s._resubscribeTopics[d]; | |
}), _typeof(n) == "object" && n.properties && (c.properties = n.properties), s.outgoing[c.messageId] = { | |
"volatile": !0, | |
cb: i | |
}, s.log("unsubscribe: call _sendPacket"), s._sendPacket(c), !0; | |
}; | |
return (this._storeProcessing || this._storeProcessingQueue.length > 0 || !a()) && this._storeProcessingQueue.push({ | |
invoke: a, | |
callback: i | |
}), this; | |
}, e.prototype.unsubscribeAsync = function (r, n) { | |
var i = this; | |
return new Promise(function (s, o) { | |
i.unsubscribe(r, n, function (a, l) { | |
a ? o(a) : s(l); | |
}); | |
}); | |
}, e.prototype.end = function (r, n, i) { | |
var s = this; | |
this.log("end :: (%s)", this.options.clientId), (r == null || typeof r != "boolean") && (i = i || n, n = r, r = !1), _typeof(n) != "object" && (i = i || n, n = null), this.log("end :: cb? %s", !!i), (!i || typeof i != "function") && (i = this.noop); | |
var o = function o() { | |
s.log("end :: closeStores: closing incoming and outgoing stores"), s.disconnected = !0, s.incomingStore.close(function (l) { | |
s.outgoingStore.close(function (c) { | |
if (s.log("end :: closeStores: emitting end"), s.emit("end"), i) { | |
var d = l || c; | |
s.log("end :: closeStores: invoking callback with args"), i(d); | |
} | |
}); | |
}), s._deferredReconnect ? s._deferredReconnect() : (s.options.reconnectPeriod === 0 || s.options.manualConnect) && (s.disconnecting = !1); | |
}, | |
a = function a() { | |
s.log("end :: (%s) :: finish :: calling _cleanUp with force %s", s.options.clientId, r), s._cleanUp(r, function () { | |
s.log("end :: finish :: calling process.nextTick on closeStores"), (0, Ds.nextTick)(o); | |
}, n); | |
}; | |
return this.disconnecting ? (i(), this) : (this._clearReconnect(), this.disconnecting = !0, !r && Object.keys(this.outgoing).length > 0 ? (this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty", this.options.clientId), this.once("outgoingEmpty", setTimeout.bind(null, a, 10))) : (this.log("end :: (%s) :: immediately calling finish", this.options.clientId), a()), this); | |
}, e.prototype.endAsync = function (r, n) { | |
var i = this; | |
return new Promise(function (s, o) { | |
i.end(r, n, function (a) { | |
a ? o(a) : s(); | |
}); | |
}); | |
}, e.prototype.removeOutgoingMessage = function (r) { | |
if (this.outgoing[r]) { | |
var n = this.outgoing[r].cb; | |
this._removeOutgoingAndStoreMessage(r, function () { | |
n(new Error("Message removed")); | |
}); | |
} | |
return this; | |
}, e.prototype.reconnect = function (r) { | |
var n = this; | |
this.log("client reconnect"); | |
var i = function i() { | |
r ? (n.options.incomingStore = r.incomingStore, n.options.outgoingStore = r.outgoingStore) : (n.options.incomingStore = null, n.options.outgoingStore = null), n.incomingStore = n.options.incomingStore || new mi["default"](), n.outgoingStore = n.options.outgoingStore || new mi["default"](), n.disconnecting = !1, n.disconnected = !1, n._deferredReconnect = null, n._reconnect(); | |
}; | |
return this.disconnecting && !this.disconnected ? this._deferredReconnect = i : i(), this; | |
}, e.prototype._flushVolatile = function () { | |
var r = this; | |
this.outgoing && (this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"), Object.keys(this.outgoing).forEach(function (n) { | |
r.outgoing[n]["volatile"] && typeof r.outgoing[n].cb == "function" && (r.outgoing[n].cb(new Error("Connection closed")), delete r.outgoing[n]); | |
})); | |
}, e.prototype._flush = function () { | |
var r = this; | |
this.outgoing && (this.log("_flush: queue exists? %b", !!this.outgoing), Object.keys(this.outgoing).forEach(function (n) { | |
typeof r.outgoing[n].cb == "function" && (r.outgoing[n].cb(new Error("Connection closed")), delete r.outgoing[n]); | |
})); | |
}, e.prototype._removeTopicAliasAndRecoverTopicName = function (r) { | |
var n; | |
r.properties && (n = r.properties.topicAlias); | |
var i = r.topic.toString(); | |
if (this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o", n, i), i.length === 0) { | |
if (typeof n == "undefined") return new Error("Unregistered Topic Alias"); | |
if (i = this.topicAliasSend.getTopicByAlias(n), typeof i == "undefined") return new Error("Unregistered Topic Alias"); | |
r.topic = i; | |
} | |
n && delete r.properties.topicAlias; | |
}, e.prototype._checkDisconnecting = function (r) { | |
return this.disconnecting && (r && r !== this.noop ? r(new Error("client disconnecting")) : this.emit("error", new Error("client disconnecting"))), this.disconnecting; | |
}, e.prototype._reconnect = function () { | |
var r = this; | |
this.log("_reconnect: emitting reconnect to client"), this.emit("reconnect"), this.connected ? (this.end(function () { | |
r.connect(); | |
}), this.log("client already connected. disconnecting first.")) : (this.log("_reconnect: calling connect"), this.connect()); | |
}, e.prototype._setupReconnect = function () { | |
var r = this; | |
!this.disconnecting && !this.reconnectTimer && this.options.reconnectPeriod > 0 ? (this.reconnecting || (this.log("_setupReconnect :: emit `offline` state"), this.emit("offline"), this.log("_setupReconnect :: set `reconnecting` to `true`"), this.reconnecting = !0), this.log("_setupReconnect :: setting reconnectTimer for %d ms", this.options.reconnectPeriod), this.reconnectTimer = setInterval(function () { | |
r.log("reconnectTimer :: reconnect triggered!"), r._reconnect(); | |
}, this.options.reconnectPeriod)) : this.log("_setupReconnect :: doing nothing..."); | |
}, e.prototype._clearReconnect = function () { | |
this.log("_clearReconnect : clearing reconnect timer"), this.reconnectTimer && (clearInterval(this.reconnectTimer), this.reconnectTimer = null); | |
}, e.prototype._cleanUp = function (r, n, i) { | |
var s = this; | |
if (i === void 0 && (i = {}), n && (this.log("_cleanUp :: done callback provided for on stream close"), this.stream.on("close", n)), this.log("_cleanUp :: forced? %s", r), r) this.options.reconnectPeriod === 0 && this.options.clean && this._flush(), this.log("_cleanUp :: (%s) :: destroying stream", this.options.clientId), this.stream.destroy();else { | |
var o = ut({ | |
cmd: "disconnect" | |
}, i); | |
this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet", this.options.clientId), this._sendPacket(o, function () { | |
s.log("_cleanUp :: (%s) :: destroying stream", s.options.clientId), vl(function () { | |
s.stream.end(function () { | |
s.log("_cleanUp :: (%s) :: stream destroyed", s.options.clientId); | |
}); | |
}); | |
}); | |
} | |
!this.disconnecting && !this.reconnecting && (this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."), this._clearReconnect(), this._setupReconnect()), this._destroyKeepaliveManager(), n && !this.connected && (this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener", this.options.clientId), this.stream.removeListener("close", n), n()); | |
}, e.prototype._storeAndSend = function (r, n, i) { | |
var s = this; | |
this.log("storeAndSend :: store packet with cmd %s to outgoingStore", r.cmd); | |
var o = r, | |
a; | |
if (o.cmd === "publish" && (o = (0, $g["default"])(r), a = this._removeTopicAliasAndRecoverTopicName(o), a)) return n && n(a); | |
this.outgoingStore.put(o, function (l) { | |
if (l) return n && n(l); | |
i(), s._writePacket(r, n); | |
}); | |
}, e.prototype._applyTopicAlias = function (r) { | |
if (this.options.protocolVersion === 5 && r.cmd === "publish") { | |
var n = void 0; | |
r.properties && (n = r.properties.topicAlias); | |
var i = r.topic.toString(); | |
if (this.topicAliasSend) { | |
if (n) { | |
if (i.length !== 0 && (this.log("applyTopicAlias :: register topic: %s - alias: %d", i, n), !this.topicAliasSend.put(i, n))) return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d", i, n), new Error("Sending Topic Alias out of range"); | |
} else i.length !== 0 && (this.options.autoAssignTopicAlias ? (n = this.topicAliasSend.getAliasByTopic(i), n ? (r.topic = "", r.properties = ut(ut({}, r.properties), { | |
topicAlias: n | |
}), this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d", i, n)) : (n = this.topicAliasSend.getLruAlias(), this.topicAliasSend.put(i, n), r.properties = ut(ut({}, r.properties), { | |
topicAlias: n | |
}), this.log("applyTopicAlias :: auto assign topic: %s - alias: %d", i, n))) : this.options.autoUseTopicAlias && (n = this.topicAliasSend.getAliasByTopic(i), n && (r.topic = "", r.properties = ut(ut({}, r.properties), { | |
topicAlias: n | |
}), this.log("applyTopicAlias :: auto use topic: %s - alias: %d", i, n)))); | |
} else if (n) return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d", i, n), new Error("Sending Topic Alias out of range"); | |
} | |
}, e.prototype._noop = function (r) { | |
this.log("noop ::", r); | |
}, e.prototype._writePacket = function (r, n) { | |
this.log("_writePacket :: packet: %O", r), this.log("_writePacket :: emitting `packetsend`"), this.emit("packetsend", r), this.log("_writePacket :: writing to stream"); | |
var i = ml["default"].writeToStream(r, this.stream, this.options); | |
this.log("_writePacket :: writeToStream result %s", i), !i && n && n !== this.noop ? (this.log("_writePacket :: handle events on `drain` once through callback."), this.stream.once("drain", n)) : n && (this.log("_writePacket :: invoking cb"), n()); | |
}, e.prototype._sendPacket = function (r, n, i, s) { | |
this.log("_sendPacket :: (%s) :: start", this.options.clientId), i = i || this.noop, n = n || this.noop; | |
var o = this._applyTopicAlias(r); | |
if (o) { | |
n(o); | |
return; | |
} | |
if (!this.connected) { | |
if (r.cmd === "auth") { | |
this._writePacket(r, n); | |
return; | |
} | |
this.log("_sendPacket :: client not connected. Storing packet offline."), this._storePacket(r, n, i); | |
return; | |
} | |
if (s) { | |
this._writePacket(r, n); | |
return; | |
} | |
switch (r.cmd) { | |
case "publish": | |
break; | |
case "pubrel": | |
this._storeAndSend(r, n, i); | |
return; | |
default: | |
this._writePacket(r, n); | |
return; | |
} | |
switch (r.qos) { | |
case 2: | |
case 1: | |
this._storeAndSend(r, n, i); | |
break; | |
case 0: | |
default: | |
this._writePacket(r, n); | |
break; | |
} | |
this.log("_sendPacket :: (%s) :: end", this.options.clientId); | |
}, e.prototype._storePacket = function (r, n, i) { | |
this.log("_storePacket :: packet: %o", r), this.log("_storePacket :: cb? %s", !!n), i = i || this.noop; | |
var s = r; | |
if (s.cmd === "publish") { | |
s = (0, $g["default"])(r); | |
var o = this._removeTopicAliasAndRecoverTopicName(s); | |
if (o) return n && n(o); | |
} | |
var a = s.qos || 0; | |
a === 0 && this.queueQoSZero || s.cmd !== "publish" ? this.queue.push({ | |
packet: s, | |
cb: n | |
}) : a > 0 ? (n = this.outgoing[s.messageId] ? this.outgoing[s.messageId].cb : null, this.outgoingStore.put(s, function (l) { | |
if (l) return n && n(l); | |
i(); | |
})) : n && n(new Error("No connection to broker")); | |
}, e.prototype._setupKeepaliveManager = function () { | |
this.log("_setupKeepaliveManager :: keepalive %d (seconds)", this.options.keepalive), !this.keepaliveManager && this.options.keepalive && (this.keepaliveManager = new OA["default"](this, this.options.timerVariant)); | |
}, e.prototype._destroyKeepaliveManager = function () { | |
this.keepaliveManager && (this.log("_destroyKeepaliveManager :: destroying keepalive manager"), this.keepaliveManager.destroy(), this.keepaliveManager = null); | |
}, e.prototype.reschedulePing = function (r) { | |
r === void 0 && (r = !1), this.keepaliveManager && this.options.keepalive && (r || this.options.reschedulePings) && this._reschedulePing(); | |
}, e.prototype._reschedulePing = function () { | |
this.log("_reschedulePing :: rescheduling ping"), this.keepaliveManager.reschedule(); | |
}, e.prototype.sendPing = function () { | |
this.log("_sendPing :: sending pingreq"), this._sendPacket({ | |
cmd: "pingreq" | |
}); | |
}, e.prototype.onKeepaliveTimeout = function () { | |
this.emit("error", new Error("Keepalive timeout")), this.log("onKeepaliveTimeout :: calling _cleanUp with force true"), this._cleanUp(!0); | |
}, e.prototype._resubscribe = function () { | |
this.log("_resubscribe"); | |
var r = Object.keys(this._resubscribeTopics); | |
if (!this._firstConnection && (this.options.clean || this.options.protocolVersion >= 4 && !this.connackPacket.sessionPresent) && r.length > 0) if (this.options.resubscribe) { | |
if (this.options.protocolVersion === 5) { | |
this.log("_resubscribe: protocolVersion 5"); | |
for (var n = 0; n < r.length; n++) { | |
var i = {}; | |
i[r[n]] = this._resubscribeTopics[r[n]], i.resubscribe = !0, this.subscribe(i, { | |
properties: i[r[n]].properties | |
}); | |
} | |
} else this._resubscribeTopics.resubscribe = !0, this.subscribe(this._resubscribeTopics); | |
} else this._resubscribeTopics = {}; | |
this._firstConnection = !1; | |
}, e.prototype._onConnect = function (r) { | |
var n = this; | |
if (this.disconnected) { | |
this.emit("connect", r); | |
return; | |
} | |
this.connackPacket = r, this.messageIdProvider.clear(), this._setupKeepaliveManager(), this.connected = !0; | |
var _i9 = function i() { | |
var s = n.outgoingStore.createStream(), | |
o = function o() { | |
s.destroy(), s = null, n._flushStoreProcessingQueue(), a(); | |
}, | |
a = function a() { | |
n._storeProcessing = !1, n._packetIdsDuringStoreProcessing = {}; | |
}; | |
n.once("close", o), s.on("error", function (c) { | |
a(), n._flushStoreProcessingQueue(), n.removeListener("close", o), n.emit("error", c); | |
}); | |
var l = function (_l26) { | |
function l() { | |
return _l26.apply(this, arguments); | |
} | |
l.toString = function () { | |
return _l26.toString(); | |
}; | |
return l; | |
}(function () { | |
if (s) { | |
var c = s.read(1), | |
d; | |
if (!c) { | |
s.once("readable", l); | |
return; | |
} | |
if (n._storeProcessing = !0, n._packetIdsDuringStoreProcessing[c.messageId]) { | |
l(); | |
return; | |
} | |
!n.disconnecting && !n.reconnectTimer ? (d = n.outgoing[c.messageId] ? n.outgoing[c.messageId].cb : null, n.outgoing[c.messageId] = { | |
"volatile": !1, | |
cb: function cb(h, m) { | |
d && d(h, m), l(); | |
} | |
}, n._packetIdsDuringStoreProcessing[c.messageId] = !0, n.messageIdProvider.register(c.messageId) ? n._sendPacket(c, void 0, void 0, !0) : n.log("messageId: %d has already used.", c.messageId)) : s.destroy && s.destroy(); | |
} | |
}); | |
s.on("end", function () { | |
var c = !0; | |
for (var d in n._packetIdsDuringStoreProcessing) if (!n._packetIdsDuringStoreProcessing[d]) { | |
c = !1; | |
break; | |
} | |
n.removeListener("close", o), c ? (a(), n._invokeAllStoreProcessingQueue(), n.emit("connect", r)) : _i9(); | |
}), l(); | |
}; | |
_i9(); | |
}, e.prototype._invokeStoreProcessingQueue = function () { | |
if (!this._storeProcessing && this._storeProcessingQueue.length > 0) { | |
var r = this._storeProcessingQueue[0]; | |
if (r && r.invoke()) return this._storeProcessingQueue.shift(), !0; | |
} | |
return !1; | |
}, e.prototype._invokeAllStoreProcessingQueue = function () { | |
for (; this._invokeStoreProcessingQueue();); | |
}, e.prototype._flushStoreProcessingQueue = function () { | |
var r, n; | |
try { | |
for (var i = SA(this._storeProcessingQueue), s = i.next(); !s.done; s = i.next()) { | |
var o = s.value; | |
o.cbStorePut && o.cbStorePut(new Error("Connection closed")), o.callback && o.callback(new Error("Connection closed")); | |
} | |
} catch (a) { | |
r = { | |
error: a | |
}; | |
} finally { | |
try { | |
s && !s.done && (n = i["return"]) && n.call(i); | |
} finally { | |
if (r) throw r.error; | |
} | |
} | |
this._storeProcessingQueue.splice(0); | |
}, e.prototype._removeOutgoingAndStoreMessage = function (r, n) { | |
var i = this; | |
delete this.outgoing[r], this.outgoingStore.del({ | |
messageId: r | |
}, function (s, o) { | |
n(s, o), i.messageIdProvider.deallocate(r), i._invokeStoreProcessingQueue(); | |
}); | |
}, e.VERSION = Ds.MQTTJS_VERSION, e; | |
}(RA.TypedEventEmitter); | |
je["default"] = xA; | |
}); | |
var Gg = H(function (Sl) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Sl, "__esModule", { | |
value: !0 | |
}); | |
var BA = gl(), | |
CA = function () { | |
function t() { | |
this.numberAllocator = new BA.NumberAllocator(1, 65535); | |
} | |
return t.prototype.allocate = function () { | |
return this.lastId = this.numberAllocator.alloc(), this.lastId; | |
}, t.prototype.getLastAllocated = function () { | |
return this.lastId; | |
}, t.prototype.register = function (e) { | |
return this.numberAllocator.use(e); | |
}, t.prototype.deallocate = function (e) { | |
this.numberAllocator.free(e); | |
}, t.prototype.clear = function () { | |
this.numberAllocator.clear(); | |
}, t; | |
}(); | |
Sl["default"] = CA; | |
}); | |
function kA() { | |
if (Qg) return El; | |
Qg = !0; | |
var t = 2147483647, | |
e = 36, | |
r = 1, | |
n = 26, | |
i = 38, | |
s = 700, | |
o = 72, | |
a = 128, | |
l = "-", | |
c = /^xn--/, | |
d = /[^\0-\x7F]/, | |
h = /[\x2E\u3002\uFF0E\uFF61]/g, | |
m = { | |
overflow: "Overflow: input needs wider integers to process", | |
"not-basic": "Illegal input >= 0x80 (not a basic code point)", | |
"invalid-input": "Invalid input" | |
}, | |
w = e - r, | |
T = Math.floor, | |
v = String.fromCharCode; | |
function b(V) { | |
throw new RangeError(m[V]); | |
} | |
function p(V, G) { | |
var ne = [], | |
ue = V.length; | |
for (; ue--;) ne[ue] = G(V[ue]); | |
return ne; | |
} | |
function _(V, G) { | |
var ne = V.split("@"), | |
ue = ""; | |
ne.length > 1 && (ue = ne[0] + "@", V = ne[1]), V = V.replace(h, "."); | |
var ee = V.split("."), | |
z = p(ee, G).join("."); | |
return ue + z; | |
} | |
function x(V) { | |
var G = [], | |
ne = 0, | |
ue = V.length; | |
for (; ne < ue;) { | |
var ee = V.charCodeAt(ne++); | |
if (ee >= 55296 && ee <= 56319 && ne < ue) { | |
var z = V.charCodeAt(ne++); | |
(z & 64512) == 56320 ? G.push(((ee & 1023) << 10) + (z & 1023) + 65536) : (G.push(ee), ne--); | |
} else G.push(ee); | |
} | |
return G; | |
} | |
var I = function I(V) { | |
return String.fromCodePoint.apply(String, _toConsumableArray(V)); | |
}, | |
y = function y(V) { | |
return V >= 48 && V < 58 ? 26 + (V - 48) : V >= 65 && V < 91 ? V - 65 : V >= 97 && V < 123 ? V - 97 : e; | |
}, | |
B = function B(V, G) { | |
return V + 22 + 75 * (V < 26) - ((G != 0) << 5); | |
}, | |
A = function A(V, G, ne) { | |
var ue = 0; | |
for (V = ne ? T(V / s) : V >> 1, V += T(V / G); V > w * n >> 1; ue += e) V = T(V / w); | |
return T(ue + (w + 1) * V / (V + i)); | |
}, | |
q = function q(V) { | |
var G = [], | |
ne = V.length, | |
ue = 0, | |
ee = a, | |
z = o, | |
le = V.lastIndexOf(l); | |
le < 0 && (le = 0); | |
for (var Q = 0; Q < le; ++Q) V.charCodeAt(Q) >= 128 && b("not-basic"), G.push(V.charCodeAt(Q)); | |
for (var _Q = le > 0 ? le + 1 : 0; _Q < ne;) { | |
var X = ue; | |
for (var Y = 1, re = e;; re += e) { | |
_Q >= ne && b("invalid-input"); | |
var ge = y(V.charCodeAt(_Q++)); | |
ge >= e && b("invalid-input"), ge > T((t - ue) / Y) && b("overflow"), ue += ge * Y; | |
var ve = re <= z ? r : re >= z + n ? n : re - z; | |
if (ge < ve) break; | |
var me = e - ve; | |
Y > T(t / me) && b("overflow"), Y *= me; | |
} | |
var _e = G.length + 1; | |
z = A(ue - X, _e, X == 0), T(ue / _e) > t - ee && b("overflow"), ee += T(ue / _e), ue %= _e, G.splice(ue++, 0, ee); | |
} | |
return String.fromCodePoint.apply(String, G); | |
}, | |
$ = function $(V) { | |
var G = []; | |
V = x(V); | |
var ne = V.length, | |
ue = a, | |
ee = 0, | |
z = o; | |
var _iterator28 = _createForOfIteratorHelper(V), | |
_step28; | |
try { | |
for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) { | |
var _X = _step28.value; | |
_X < 128 && G.push(v(_X)); | |
} | |
} catch (err) { | |
_iterator28.e(err); | |
} finally { | |
_iterator28.f(); | |
} | |
var le = G.length, | |
Q = le; | |
for (le && G.push(l); Q < ne;) { | |
var X = t; | |
var _iterator29 = _createForOfIteratorHelper(V), | |
_step29; | |
try { | |
for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) { | |
var Y = _step29.value; | |
Y >= ue && Y < X && (X = Y); | |
} | |
} catch (err) { | |
_iterator29.e(err); | |
} finally { | |
_iterator29.f(); | |
} | |
var _e = Q + 1; | |
X - ue > T((t - ee) / _e) && b("overflow"), ee += (X - ue) * _e, ue = X; | |
var _iterator30 = _createForOfIteratorHelper(V), | |
_step30; | |
try { | |
for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) { | |
var _Y = _step30.value; | |
if (_Y < ue && ++ee > t && b("overflow"), _Y === ue) { | |
var re = ee; | |
for (var ge = e;; ge += e) { | |
var ve = ge <= z ? r : ge >= z + n ? n : ge - z; | |
if (re < ve) break; | |
var me = re - ve, | |
Me = e - ve; | |
G.push(v(B(ve + me % Me, 0))), re = T(me / Me); | |
} | |
G.push(v(B(re, 0))), z = A(ee, _e, Q === le), ee = 0, ++Q; | |
} | |
} | |
} catch (err) { | |
_iterator30.e(err); | |
} finally { | |
_iterator30.f(); | |
} | |
++ee, ++ue; | |
} | |
return G.join(""); | |
}; | |
return El = { | |
version: "2.3.1", | |
ucs2: { | |
decode: x, | |
encode: I | |
}, | |
decode: q, | |
encode: $, | |
toASCII: function toASCII(V) { | |
return _(V, function (G) { | |
return d.test(G) ? "xn--" + $(G) : G; | |
}); | |
}, | |
toUnicode: function toUnicode(V) { | |
return _(V, function (G) { | |
return c.test(G) ? q(G.slice(4).toLowerCase()) : G; | |
}); | |
} | |
}, El; | |
} | |
var El, | |
Qg, | |
Xr, | |
fD, | |
cD, | |
hD, | |
dD, | |
pD, | |
yD, | |
Yg = rt(function () { | |
P(); | |
O(); | |
R(); | |
El = {}, Qg = !1; | |
Xr = kA(), fD = Xr.decode, cD = Xr.encode, hD = Xr.toASCII, dD = Xr.toUnicode, pD = Xr.ucs2, yD = Xr.version; | |
}); | |
function MA() { | |
return Jg || (Jg = !0, Al = function Al() { | |
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1; | |
if (_typeof(Symbol.iterator) == "symbol") return !0; | |
var e = {}, | |
r = Symbol("test"), | |
n = Object(r); | |
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]") return !1; | |
var i = 42; | |
e[r] = i; | |
for (r in e) return !1; | |
if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) return !1; | |
var s = Object.getOwnPropertySymbols(e); | |
if (s.length !== 1 || s[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r)) return !1; | |
if (typeof Object.getOwnPropertyDescriptor == "function") { | |
var o = Object.getOwnPropertyDescriptor(e, r); | |
if (o.value !== i || o.enumerable !== !0) return !1; | |
} | |
return !0; | |
}), Al; | |
} | |
function NA() { | |
return Xg || (Xg = !0, Il = Error), Il; | |
} | |
function LA() { | |
return Zg || (Zg = !0, Tl = EvalError), Tl; | |
} | |
function qA() { | |
return ew || (ew = !0, Pl = RangeError), Pl; | |
} | |
function UA() { | |
return tw || (tw = !0, Rl = ReferenceError), Rl; | |
} | |
function bw() { | |
return rw || (rw = !0, Ol = SyntaxError), Ol; | |
} | |
function vi() { | |
return nw || (nw = !0, xl = TypeError), xl; | |
} | |
function DA() { | |
return iw || (iw = !0, Bl = URIError), Bl; | |
} | |
function FA() { | |
if (ow) return Cl; | |
ow = !0; | |
var t = typeof Symbol != "undefined" && Symbol, | |
e = MA(); | |
return Cl = function Cl() { | |
return typeof t != "function" || typeof Symbol != "function" || _typeof(t("foo")) != "symbol" || _typeof(Symbol("bar")) != "symbol" ? !1 : e(); | |
}, Cl; | |
} | |
function jA() { | |
if (sw) return kl; | |
sw = !0; | |
var t = { | |
__proto__: null, | |
foo: {} | |
}, | |
e = Object; | |
return kl = function kl() { | |
return { | |
__proto__: t | |
}.foo === t.foo && !(t instanceof e); | |
}, kl; | |
} | |
function WA() { | |
if (aw) return Ml; | |
aw = !0; | |
var t = "Function.prototype.bind called on incompatible ", | |
e = Object.prototype.toString, | |
r = Math.max, | |
n = "[object Function]", | |
i = function i(l, c) { | |
for (var d = [], h = 0; h < l.length; h += 1) d[h] = l[h]; | |
for (var m = 0; m < c.length; m += 1) d[m + l.length] = c[m]; | |
return d; | |
}, | |
s = function s(l, c) { | |
for (var d = [], h = c, m = 0; h < l.length; h += 1, m += 1) d[m] = l[h]; | |
return d; | |
}, | |
o = function o(a, l) { | |
for (var c = "", d = 0; d < a.length; d += 1) c += a[d], d + 1 < a.length && (c += l); | |
return c; | |
}; | |
return Ml = function Ml(l) { | |
var c = this; | |
if (typeof c != "function" || e.apply(c) !== n) throw new TypeError(t + c); | |
for (var d = s(arguments, 1), h, m = function m() { | |
if (this instanceof h) { | |
var p = c.apply(this, i(d, arguments)); | |
return Object(p) === p ? p : this; | |
} | |
return c.apply(l, i(d, arguments)); | |
}, w = r(0, c.length - d.length), T = [], v = 0; v < w; v++) T[v] = "$" + v; | |
if (h = Function("binder", "return function (" + o(T, ",") + "){ return binder.apply(this,arguments); }")(m), c.prototype) { | |
var b = function b() {}; | |
b.prototype = c.prototype, h.prototype = new b(), b.prototype = null; | |
} | |
return h; | |
}, Ml; | |
} | |
function Hl() { | |
if (uw) return Nl; | |
uw = !0; | |
var t = WA(); | |
return Nl = Function.prototype.bind || t, Nl; | |
} | |
function $A() { | |
if (lw) return Ll; | |
lw = !0; | |
var t = Function.prototype.call, | |
e = Object.prototype.hasOwnProperty, | |
r = Hl(); | |
return Ll = r.call(t, e), Ll; | |
} | |
function Mn() { | |
if (fw) return ql; | |
fw = !0; | |
var t, | |
e = NA(), | |
r = LA(), | |
n = qA(), | |
i = UA(), | |
s = bw(), | |
o = vi(), | |
a = DA(), | |
l = Function, | |
c = function c(ee) { | |
try { | |
return l('"use strict"; return (' + ee + ").constructor;")(); | |
} catch (z) {} | |
}, | |
d = Object.getOwnPropertyDescriptor; | |
if (d) try { | |
d({}, ""); | |
} catch (ee) { | |
d = null; | |
} | |
var h = function h() { | |
throw new o(); | |
}, | |
m = d ? function () { | |
try { | |
return arguments.callee, h; | |
} catch (ee) { | |
try { | |
return d(arguments, "callee").get; | |
} catch (z) { | |
return h; | |
} | |
} | |
}() : h, | |
w = FA()(), | |
T = jA()(), | |
v = Object.getPrototypeOf || (T ? function (ee) { | |
return ee.__proto__; | |
} : null), | |
b = {}, | |
p = typeof Uint8Array == "undefined" || !v ? t : v(Uint8Array), | |
_ = { | |
__proto__: null, | |
"%AggregateError%": typeof AggregateError == "undefined" ? t : AggregateError, | |
"%Array%": Array, | |
"%ArrayBuffer%": typeof ArrayBuffer == "undefined" ? t : ArrayBuffer, | |
"%ArrayIteratorPrototype%": w && v ? v([][Symbol.iterator]()) : t, | |
"%AsyncFromSyncIteratorPrototype%": t, | |
"%AsyncFunction%": b, | |
"%AsyncGenerator%": b, | |
"%AsyncGeneratorFunction%": b, | |
"%AsyncIteratorPrototype%": b, | |
"%Atomics%": typeof Atomics == "undefined" ? t : Atomics, | |
"%BigInt%": typeof BigInt == "undefined" ? t : BigInt, | |
"%BigInt64Array%": typeof BigInt64Array == "undefined" ? t : BigInt64Array, | |
"%BigUint64Array%": typeof BigUint64Array == "undefined" ? t : BigUint64Array, | |
"%Boolean%": Boolean, | |
"%DataView%": typeof DataView == "undefined" ? t : DataView, | |
"%Date%": Date, | |
"%decodeURI%": decodeURI, | |
"%decodeURIComponent%": decodeURIComponent, | |
"%encodeURI%": encodeURI, | |
"%encodeURIComponent%": encodeURIComponent, | |
"%Error%": e, | |
"%eval%": eval, | |
"%EvalError%": r, | |
"%Float32Array%": typeof Float32Array == "undefined" ? t : Float32Array, | |
"%Float64Array%": typeof Float64Array == "undefined" ? t : Float64Array, | |
"%FinalizationRegistry%": typeof FinalizationRegistry == "undefined" ? t : FinalizationRegistry, | |
"%Function%": l, | |
"%GeneratorFunction%": b, | |
"%Int8Array%": typeof Int8Array == "undefined" ? t : Int8Array, | |
"%Int16Array%": typeof Int16Array == "undefined" ? t : Int16Array, | |
"%Int32Array%": typeof Int32Array == "undefined" ? t : Int32Array, | |
"%isFinite%": isFinite, | |
"%isNaN%": isNaN, | |
"%IteratorPrototype%": w && v ? v(v([][Symbol.iterator]())) : t, | |
"%JSON%": (typeof JSON === "undefined" ? "undefined" : _typeof(JSON)) == "object" ? JSON : t, | |
"%Map%": typeof Map == "undefined" ? t : Map, | |
"%MapIteratorPrototype%": typeof Map == "undefined" || !w || !v ? t : v(new Map()[Symbol.iterator]()), | |
"%Math%": Math, | |
"%Number%": Number, | |
"%Object%": Object, | |
"%parseFloat%": parseFloat, | |
"%parseInt%": parseInt, | |
"%Promise%": typeof Promise == "undefined" ? t : Promise, | |
"%Proxy%": typeof Proxy == "undefined" ? t : Proxy, | |
"%RangeError%": n, | |
"%ReferenceError%": i, | |
"%Reflect%": typeof Reflect == "undefined" ? t : Reflect, | |
"%RegExp%": RegExp, | |
"%Set%": typeof Set == "undefined" ? t : Set, | |
"%SetIteratorPrototype%": typeof Set == "undefined" || !w || !v ? t : v(new Set()[Symbol.iterator]()), | |
"%SharedArrayBuffer%": typeof SharedArrayBuffer == "undefined" ? t : SharedArrayBuffer, | |
"%String%": String, | |
"%StringIteratorPrototype%": w && v ? v(""[Symbol.iterator]()) : t, | |
"%Symbol%": w ? Symbol : t, | |
"%SyntaxError%": s, | |
"%ThrowTypeError%": m, | |
"%TypedArray%": p, | |
"%TypeError%": o, | |
"%Uint8Array%": typeof Uint8Array == "undefined" ? t : Uint8Array, | |
"%Uint8ClampedArray%": typeof Uint8ClampedArray == "undefined" ? t : Uint8ClampedArray, | |
"%Uint16Array%": typeof Uint16Array == "undefined" ? t : Uint16Array, | |
"%Uint32Array%": typeof Uint32Array == "undefined" ? t : Uint32Array, | |
"%URIError%": a, | |
"%WeakMap%": typeof WeakMap == "undefined" ? t : WeakMap, | |
"%WeakRef%": typeof WeakRef == "undefined" ? t : WeakRef, | |
"%WeakSet%": typeof WeakSet == "undefined" ? t : WeakSet | |
}; | |
if (v) try { | |
null.error; | |
} catch (ee) { | |
var x = v(v(ee)); | |
_["%Error.prototype%"] = x; | |
} | |
var I = function ee(z) { | |
var le; | |
if (z === "%AsyncFunction%") le = c("async function () {}");else if (z === "%GeneratorFunction%") le = c("function* () {}");else if (z === "%AsyncGeneratorFunction%") le = c("async function* () {}");else if (z === "%AsyncGenerator%") { | |
var Q = ee("%AsyncGeneratorFunction%"); | |
Q && (le = Q.prototype); | |
} else if (z === "%AsyncIteratorPrototype%") { | |
var X = ee("%AsyncGenerator%"); | |
X && v && (le = v(X.prototype)); | |
} | |
return _[z] = le, le; | |
}, | |
y = { | |
__proto__: null, | |
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], | |
"%ArrayPrototype%": ["Array", "prototype"], | |
"%ArrayProto_entries%": ["Array", "prototype", "entries"], | |
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"], | |
"%ArrayProto_keys%": ["Array", "prototype", "keys"], | |
"%ArrayProto_values%": ["Array", "prototype", "values"], | |
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], | |
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], | |
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], | |
"%BooleanPrototype%": ["Boolean", "prototype"], | |
"%DataViewPrototype%": ["DataView", "prototype"], | |
"%DatePrototype%": ["Date", "prototype"], | |
"%ErrorPrototype%": ["Error", "prototype"], | |
"%EvalErrorPrototype%": ["EvalError", "prototype"], | |
"%Float32ArrayPrototype%": ["Float32Array", "prototype"], | |
"%Float64ArrayPrototype%": ["Float64Array", "prototype"], | |
"%FunctionPrototype%": ["Function", "prototype"], | |
"%Generator%": ["GeneratorFunction", "prototype"], | |
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], | |
"%Int8ArrayPrototype%": ["Int8Array", "prototype"], | |
"%Int16ArrayPrototype%": ["Int16Array", "prototype"], | |
"%Int32ArrayPrototype%": ["Int32Array", "prototype"], | |
"%JSONParse%": ["JSON", "parse"], | |
"%JSONStringify%": ["JSON", "stringify"], | |
"%MapPrototype%": ["Map", "prototype"], | |
"%NumberPrototype%": ["Number", "prototype"], | |
"%ObjectPrototype%": ["Object", "prototype"], | |
"%ObjProto_toString%": ["Object", "prototype", "toString"], | |
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], | |
"%PromisePrototype%": ["Promise", "prototype"], | |
"%PromiseProto_then%": ["Promise", "prototype", "then"], | |
"%Promise_all%": ["Promise", "all"], | |
"%Promise_reject%": ["Promise", "reject"], | |
"%Promise_resolve%": ["Promise", "resolve"], | |
"%RangeErrorPrototype%": ["RangeError", "prototype"], | |
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], | |
"%RegExpPrototype%": ["RegExp", "prototype"], | |
"%SetPrototype%": ["Set", "prototype"], | |
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], | |
"%StringPrototype%": ["String", "prototype"], | |
"%SymbolPrototype%": ["Symbol", "prototype"], | |
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], | |
"%TypedArrayPrototype%": ["TypedArray", "prototype"], | |
"%TypeErrorPrototype%": ["TypeError", "prototype"], | |
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], | |
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], | |
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], | |
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], | |
"%URIErrorPrototype%": ["URIError", "prototype"], | |
"%WeakMapPrototype%": ["WeakMap", "prototype"], | |
"%WeakSetPrototype%": ["WeakSet", "prototype"] | |
}, | |
B = Hl(), | |
A = $A(), | |
q = B.call(Function.call, Array.prototype.concat), | |
$ = B.call(Function.apply, Array.prototype.splice), | |
F = B.call(Function.call, String.prototype.replace), | |
Z = B.call(Function.call, String.prototype.slice), | |
j = B.call(Function.call, RegExp.prototype.exec), | |
V = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, | |
G = /\\(\\)?/g, | |
ne = function ne(z) { | |
var le = Z(z, 0, 1), | |
Q = Z(z, -1); | |
if (le === "%" && Q !== "%") throw new s("invalid intrinsic syntax, expected closing `%`"); | |
if (Q === "%" && le !== "%") throw new s("invalid intrinsic syntax, expected opening `%`"); | |
var X = []; | |
return F(z, V, function (_e, Y, re, ge) { | |
X[X.length] = re ? F(ge, G, "$1") : Y || _e; | |
}), X; | |
}, | |
ue = function ue(z, le) { | |
var Q = z, | |
X; | |
if (A(y, Q) && (X = y[Q], Q = "%" + X[0] + "%"), A(_, Q)) { | |
var _e = _[Q]; | |
if (_e === b && (_e = I(Q)), typeof _e == "undefined" && !le) throw new o("intrinsic " + z + " exists, but is not available. Please file an issue!"); | |
return { | |
alias: X, | |
name: Q, | |
value: _e | |
}; | |
} | |
throw new s("intrinsic " + z + " does not exist!"); | |
}; | |
return ql = function ql(z, le) { | |
if (typeof z != "string" || z.length === 0) throw new o("intrinsic name must be a non-empty string"); | |
if (arguments.length > 1 && typeof le != "boolean") throw new o('"allowMissing" argument must be a boolean'); | |
if (j(/^%?[^%]*%?$/, z) === null) throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); | |
var Q = ne(z), | |
X = Q.length > 0 ? Q[0] : "", | |
_e = ue("%" + X + "%", le), | |
Y = _e.name, | |
re = _e.value, | |
ge = !1, | |
ve = _e.alias; | |
ve && (X = ve[0], $(Q, q([0, 1], ve))); | |
for (var me = 1, Me = !0; me < Q.length; me += 1) { | |
var Te = Q[me], | |
Re = Z(Te, 0, 1), | |
$e = Z(Te, -1); | |
if ((Re === '"' || Re === "'" || Re === "`" || $e === '"' || $e === "'" || $e === "`") && Re !== $e) throw new s("property names with quotes must have matching quotes"); | |
if ((Te === "constructor" || !Me) && (ge = !0), X += "." + Te, Y = "%" + X + "%", A(_, Y)) re = _[Y];else if (re != null) { | |
if (!(Te in re)) { | |
if (!le) throw new o("base intrinsic for " + z + " exists, but the property is not available."); | |
return; | |
} | |
if (d && me + 1 >= Q.length) { | |
var qe = d(re, Te); | |
Me = !!qe, Me && "get" in qe && !("originalValue" in qe.get) ? re = qe.get : re = re[Te]; | |
} else Me = A(re, Te), re = re[Te]; | |
Me && !ge && (_[Y] = re); | |
} | |
} | |
return re; | |
}, ql; | |
} | |
function Vl() { | |
if (cw) return Ul; | |
cw = !0; | |
var t = Mn(), | |
e = t("%Object.defineProperty%", !0) || !1; | |
if (e) try { | |
e({}, "a", { | |
value: 1 | |
}); | |
} catch (r) { | |
e = !1; | |
} | |
return Ul = e, Ul; | |
} | |
function _w() { | |
if (hw) return Dl; | |
hw = !0; | |
var t = Mn(), | |
e = t("%Object.getOwnPropertyDescriptor%", !0); | |
if (e) try { | |
e([], "length"); | |
} catch (r) { | |
e = null; | |
} | |
return Dl = e, Dl; | |
} | |
function HA() { | |
if (dw) return Fl; | |
dw = !0; | |
var t = Vl(), | |
e = bw(), | |
r = vi(), | |
n = _w(); | |
return Fl = function Fl(s, o, a) { | |
if (!s || _typeof(s) != "object" && typeof s != "function") throw new r("`obj` must be an object or a function`"); | |
if (typeof o != "string" && _typeof(o) != "symbol") throw new r("`property` must be a string or a symbol`"); | |
if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) throw new r("`nonEnumerable`, if provided, must be a boolean or null"); | |
if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) throw new r("`nonWritable`, if provided, must be a boolean or null"); | |
if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) throw new r("`nonConfigurable`, if provided, must be a boolean or null"); | |
if (arguments.length > 6 && typeof arguments[6] != "boolean") throw new r("`loose`, if provided, must be a boolean"); | |
var l = arguments.length > 3 ? arguments[3] : null, | |
c = arguments.length > 4 ? arguments[4] : null, | |
d = arguments.length > 5 ? arguments[5] : null, | |
h = arguments.length > 6 ? arguments[6] : !1, | |
m = !!n && n(s, o); | |
if (t) t(s, o, { | |
configurable: d === null && m ? m.configurable : !d, | |
enumerable: l === null && m ? m.enumerable : !l, | |
value: a, | |
writable: c === null && m ? m.writable : !c | |
});else if (h || !l && !c && !d) s[o] = a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); | |
}, Fl; | |
} | |
function VA() { | |
if (pw) return jl; | |
pw = !0; | |
var t = Vl(), | |
e = function e() { | |
return !!t; | |
}; | |
return e.hasArrayLengthDefineBug = function () { | |
if (!t) return null; | |
try { | |
return t([], "length", { | |
value: 1 | |
}).length !== 1; | |
} catch (n) { | |
return !0; | |
} | |
}, jl = e, jl; | |
} | |
function zA() { | |
if (yw) return Wl; | |
yw = !0; | |
var t = Mn(), | |
e = HA(), | |
r = VA()(), | |
n = _w(), | |
i = vi(), | |
s = t("%Math.floor%"); | |
return Wl = function Wl(a, l) { | |
if (typeof a != "function") throw new i("`fn` is not a function"); | |
if (typeof l != "number" || l < 0 || l > 4294967295 || s(l) !== l) throw new i("`length` must be a positive 32-bit integer"); | |
var c = arguments.length > 2 && !!arguments[2], | |
d = !0, | |
h = !0; | |
if ("length" in a && n) { | |
var m = n(a, "length"); | |
m && !m.configurable && (d = !1), m && !m.writable && (h = !1); | |
} | |
return (d || h || !c) && (r ? e(a, "length", l, !0, !0) : e(a, "length", l)), a; | |
}, Wl; | |
} | |
function KA() { | |
if (gw) return so; | |
gw = !0; | |
var t = Hl(), | |
e = Mn(), | |
r = zA(), | |
n = vi(), | |
i = e("%Function.prototype.apply%"), | |
s = e("%Function.prototype.call%"), | |
o = e("%Reflect.apply%", !0) || t.call(s, i), | |
a = Vl(), | |
l = e("%Math.max%"); | |
so = function so(h) { | |
if (typeof h != "function") throw new n("a function is required"); | |
var m = o(t, s, arguments); | |
return r(m, 1 + l(0, h.length - (arguments.length - 1)), !0); | |
}; | |
var c = function c() { | |
return o(t, i, arguments); | |
}; | |
return a ? a(so, "apply", { | |
value: c | |
}) : so.apply = c, so; | |
} | |
function mw() { | |
if (ww) return $l; | |
ww = !0; | |
var t = Mn(), | |
e = KA(), | |
r = e(t("String.prototype.indexOf")); | |
return $l = function $l(i, s) { | |
var o = t(i, !!s); | |
return typeof o == "function" && r(i, ".prototype.") > -1 ? e(o) : o; | |
}, $l; | |
} | |
var Al, | |
Jg, | |
Il, | |
Xg, | |
Tl, | |
Zg, | |
Pl, | |
ew, | |
Rl, | |
tw, | |
Ol, | |
rw, | |
xl, | |
nw, | |
Bl, | |
iw, | |
Cl, | |
ow, | |
kl, | |
sw, | |
Ml, | |
aw, | |
Nl, | |
uw, | |
Ll, | |
lw, | |
ql, | |
fw, | |
Ul, | |
cw, | |
Dl, | |
hw, | |
Fl, | |
dw, | |
jl, | |
pw, | |
Wl, | |
yw, | |
so, | |
gw, | |
$l, | |
ww, | |
vw = rt(function () { | |
P(); | |
O(); | |
R(); | |
Al = {}, Jg = !1; | |
Il = {}, Xg = !1; | |
Tl = {}, Zg = !1; | |
Pl = {}, ew = !1; | |
Rl = {}, tw = !1; | |
Ol = {}, rw = !1; | |
xl = {}, nw = !1; | |
Bl = {}, iw = !1; | |
Cl = {}, ow = !1; | |
kl = {}, sw = !1; | |
Ml = {}, aw = !1; | |
Nl = {}, uw = !1; | |
Ll = {}, lw = !1; | |
ql = {}, fw = !1; | |
Ul = {}, cw = !1; | |
Dl = {}, hw = !1; | |
Fl = {}, dw = !1; | |
jl = {}, pw = !1; | |
Wl = {}, yw = !1; | |
so = {}, gw = !1; | |
$l = {}, ww = !1; | |
}); | |
function Ql(t) { | |
throw new Error("Node.js process " + t + " is not supported by JSPM core outside of Node.js"); | |
} | |
function GA() { | |
!Si || !Nn || (Si = !1, Nn.length ? Or = Nn.concat(Or) : js = -1, Or.length && Sw()); | |
} | |
function Sw() { | |
if (!Si) { | |
var t = setTimeout(GA, 0); | |
Si = !0; | |
for (var e = Or.length; e;) { | |
for (Nn = Or, Or = []; ++js < e;) Nn && Nn[js].run(); | |
js = -1, e = Or.length; | |
} | |
Nn = null, Si = !1, clearTimeout(t); | |
} | |
} | |
function QA(t) { | |
var e = new Array(arguments.length - 1); | |
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; | |
Or.push(new Ew(t, e)), Or.length === 1 && !Si && setTimeout(Sw, 0); | |
} | |
function Ew(t, e) { | |
this.fun = t, this.array = e; | |
} | |
function lt() {} | |
function hI(t) { | |
Ql("_linkedBinding"); | |
} | |
function gI(t) { | |
Ql("dlopen"); | |
} | |
function wI() { | |
return []; | |
} | |
function bI() { | |
return []; | |
} | |
function PI(t, e) { | |
if (!t) throw new Error(e || "assertion error"); | |
} | |
function BI() { | |
return !1; | |
} | |
function GI() { | |
return Zr.now() / 1e3; | |
} | |
function Gl(t) { | |
var e = Math.floor((Date.now() - Zr.now()) * .001), | |
r = Zr.now() * .001, | |
n = Math.floor(r) + e, | |
i = Math.floor(r % 1 * 1e9); | |
return t && (n = n - t[0], i = i - t[1], i < 0 && (n--, i += Kl)), [n, i]; | |
} | |
function en() { | |
return Jl; | |
} | |
function sT(t) { | |
return []; | |
} | |
var Or, | |
Si, | |
Nn, | |
js, | |
YA, | |
JA, | |
XA, | |
ZA, | |
eI, | |
tI, | |
rI, | |
nI, | |
iI, | |
oI, | |
sI, | |
aI, | |
uI, | |
lI, | |
fI, | |
cI, | |
dI, | |
pI, | |
yI, | |
_I, | |
mI, | |
Yl, | |
vI, | |
SI, | |
EI, | |
AI, | |
II, | |
TI, | |
RI, | |
OI, | |
xI, | |
CI, | |
kI, | |
MI, | |
NI, | |
LI, | |
qI, | |
UI, | |
DI, | |
FI, | |
jI, | |
WI, | |
$I, | |
HI, | |
VI, | |
zI, | |
KI, | |
Zr, | |
zl, | |
Kl, | |
QI, | |
YI, | |
JI, | |
XI, | |
ZI, | |
eT, | |
tT, | |
rT, | |
nT, | |
iT, | |
oT, | |
Jl, | |
Xl = rt(function () { | |
P(); | |
O(); | |
R(); | |
Or = [], Si = !1, js = -1; | |
Ew.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
YA = "browser", JA = "x64", XA = "browser", ZA = { | |
PATH: "/usr/bin", | |
LANG: navigator.language + ".UTF-8", | |
PWD: "/", | |
HOME: "/home", | |
TMP: "/tmp" | |
}, eI = ["/usr/bin/node"], tI = [], rI = "v16.8.0", nI = {}, iI = function iI(t, e) { | |
console.warn((e ? e + ": " : "") + t); | |
}, oI = function oI(t) { | |
Ql("binding"); | |
}, sI = function sI(t) { | |
return 0; | |
}, aI = function aI() { | |
return "/"; | |
}, uI = function uI(t) {}, lI = { | |
name: "node", | |
sourceUrl: "", | |
headersUrl: "", | |
libUrl: "" | |
}; | |
fI = lt, cI = []; | |
dI = {}, pI = !1, yI = {}; | |
_I = lt, mI = lt, Yl = function Yl() { | |
return {}; | |
}, vI = Yl, SI = Yl, EI = lt, AI = lt, II = lt, TI = {}; | |
RI = { | |
inspector: !1, | |
debug: !1, | |
uv: !1, | |
ipv6: !1, | |
tls_alpn: !1, | |
tls_sni: !1, | |
tls_ocsp: !1, | |
tls: !1, | |
cached_builtins: !0 | |
}, OI = lt, xI = lt; | |
CI = lt, kI = lt, MI = lt, NI = lt, LI = lt, qI = void 0, UI = void 0, DI = void 0, FI = lt, jI = 2, WI = 1, $I = "/bin/usr/node", HI = 9229, VI = "node", zI = [], KI = lt, Zr = { | |
now: typeof performance != "undefined" ? performance.now.bind(performance) : void 0, | |
timing: typeof performance != "undefined" ? performance.timing : void 0 | |
}; | |
Zr.now === void 0 && (zl = Date.now(), Zr.timing && Zr.timing.navigationStart && (zl = Zr.timing.navigationStart), Zr.now = function () { | |
return Date.now() - zl; | |
}); | |
Kl = 1e9; | |
Gl.bigint = function (t) { | |
var e = Gl(t); | |
return typeof BigInt == "undefined" ? e[0] * Kl + e[1] : BigInt(e[0] * Kl) + BigInt(e[1]); | |
}; | |
QI = 10, YI = {}, JI = 0; | |
XI = en, ZI = en, eT = en, tT = en, rT = en, nT = lt, iT = en, oT = en; | |
Jl = { | |
version: rI, | |
versions: nI, | |
arch: JA, | |
platform: XA, | |
release: lI, | |
_rawDebug: fI, | |
moduleLoadList: cI, | |
binding: oI, | |
_linkedBinding: hI, | |
_events: YI, | |
_eventsCount: JI, | |
_maxListeners: QI, | |
on: en, | |
addListener: XI, | |
once: ZI, | |
off: eT, | |
removeListener: tT, | |
removeAllListeners: rT, | |
emit: nT, | |
prependListener: iT, | |
prependOnceListener: oT, | |
listeners: sT, | |
domain: dI, | |
_exiting: pI, | |
config: yI, | |
dlopen: gI, | |
uptime: GI, | |
_getActiveRequests: wI, | |
_getActiveHandles: bI, | |
reallyExit: _I, | |
_kill: mI, | |
cpuUsage: Yl, | |
resourceUsage: vI, | |
memoryUsage: SI, | |
kill: EI, | |
exit: AI, | |
openStdin: II, | |
allowedNodeEnvironmentFlags: TI, | |
assert: PI, | |
features: RI, | |
_fatalExceptions: OI, | |
setUncaughtExceptionCaptureCallback: xI, | |
hasUncaughtExceptionCaptureCallback: BI, | |
emitWarning: iI, | |
nextTick: QA, | |
_tickCallback: CI, | |
_debugProcess: kI, | |
_debugEnd: MI, | |
_startProfilerIdleNotifier: NI, | |
_stopProfilerIdleNotifier: LI, | |
stdout: qI, | |
stdin: DI, | |
stderr: UI, | |
abort: FI, | |
umask: sI, | |
chdir: uI, | |
cwd: aI, | |
env: ZA, | |
title: YA, | |
argv: eI, | |
execArgv: tI, | |
pid: jI, | |
ppid: WI, | |
execPath: $I, | |
debugPort: HI, | |
hrtime: Gl, | |
argv0: VI, | |
_preload_modules: zI, | |
setSourceMapsEnabled: KI | |
}; | |
}); | |
function aT() { | |
if (Aw) return Zl; | |
Aw = !0; | |
var t = Jl; | |
function e(s) { | |
if (typeof s != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(s)); | |
} | |
function r(s, o) { | |
for (var a = "", l = 0, c = -1, d = 0, h, m = 0; m <= s.length; ++m) { | |
if (m < s.length) h = s.charCodeAt(m);else { | |
if (h === 47) break; | |
h = 47; | |
} | |
if (h === 47) { | |
if (!(c === m - 1 || d === 1)) if (c !== m - 1 && d === 2) { | |
if (a.length < 2 || l !== 2 || a.charCodeAt(a.length - 1) !== 46 || a.charCodeAt(a.length - 2) !== 46) { | |
if (a.length > 2) { | |
var w = a.lastIndexOf("/"); | |
if (w !== a.length - 1) { | |
w === -1 ? (a = "", l = 0) : (a = a.slice(0, w), l = a.length - 1 - a.lastIndexOf("/")), c = m, d = 0; | |
continue; | |
} | |
} else if (a.length === 2 || a.length === 1) { | |
a = "", l = 0, c = m, d = 0; | |
continue; | |
} | |
} | |
o && (a.length > 0 ? a += "/.." : a = "..", l = 2); | |
} else a.length > 0 ? a += "/" + s.slice(c + 1, m) : a = s.slice(c + 1, m), l = m - c - 1; | |
c = m, d = 0; | |
} else h === 46 && d !== -1 ? ++d : d = -1; | |
} | |
return a; | |
} | |
function n(s, o) { | |
var a = o.dir || o.root, | |
l = o.base || (o.name || "") + (o.ext || ""); | |
return a ? a === o.root ? a + l : a + s + l : l; | |
} | |
var i = { | |
resolve: function resolve() { | |
for (var o = "", a = !1, l, c = arguments.length - 1; c >= -1 && !a; c--) { | |
var d; | |
c >= 0 ? d = arguments[c] : (l === void 0 && (l = t.cwd()), d = l), e(d), d.length !== 0 && (o = d + "/" + o, a = d.charCodeAt(0) === 47); | |
} | |
return o = r(o, !a), a ? o.length > 0 ? "/" + o : "/" : o.length > 0 ? o : "."; | |
}, | |
normalize: function normalize(o) { | |
if (e(o), o.length === 0) return "."; | |
var a = o.charCodeAt(0) === 47, | |
l = o.charCodeAt(o.length - 1) === 47; | |
return o = r(o, !a), o.length === 0 && !a && (o = "."), o.length > 0 && l && (o += "/"), a ? "/" + o : o; | |
}, | |
isAbsolute: function isAbsolute(o) { | |
return e(o), o.length > 0 && o.charCodeAt(0) === 47; | |
}, | |
join: function join() { | |
if (arguments.length === 0) return "."; | |
for (var o, a = 0; a < arguments.length; ++a) { | |
var l = arguments[a]; | |
e(l), l.length > 0 && (o === void 0 ? o = l : o += "/" + l); | |
} | |
return o === void 0 ? "." : i.normalize(o); | |
}, | |
relative: function relative(o, a) { | |
if (e(o), e(a), o === a || (o = i.resolve(o), a = i.resolve(a), o === a)) return ""; | |
for (var l = 1; l < o.length && o.charCodeAt(l) === 47; ++l); | |
for (var c = o.length, d = c - l, h = 1; h < a.length && a.charCodeAt(h) === 47; ++h); | |
for (var m = a.length, w = m - h, T = d < w ? d : w, v = -1, b = 0; b <= T; ++b) { | |
if (b === T) { | |
if (w > T) { | |
if (a.charCodeAt(h + b) === 47) return a.slice(h + b + 1); | |
if (b === 0) return a.slice(h + b); | |
} else d > T && (o.charCodeAt(l + b) === 47 ? v = b : b === 0 && (v = 0)); | |
break; | |
} | |
var p = o.charCodeAt(l + b), | |
_ = a.charCodeAt(h + b); | |
if (p !== _) break; | |
p === 47 && (v = b); | |
} | |
var x = ""; | |
for (b = l + v + 1; b <= c; ++b) (b === c || o.charCodeAt(b) === 47) && (x.length === 0 ? x += ".." : x += "/.."); | |
return x.length > 0 ? x + a.slice(h + v) : (h += v, a.charCodeAt(h) === 47 && ++h, a.slice(h)); | |
}, | |
_makeLong: function _makeLong(o) { | |
return o; | |
}, | |
dirname: function dirname(o) { | |
if (e(o), o.length === 0) return "."; | |
for (var a = o.charCodeAt(0), l = a === 47, c = -1, d = !0, h = o.length - 1; h >= 1; --h) if (a = o.charCodeAt(h), a === 47) { | |
if (!d) { | |
c = h; | |
break; | |
} | |
} else d = !1; | |
return c === -1 ? l ? "/" : "." : l && c === 1 ? "//" : o.slice(0, c); | |
}, | |
basename: function basename(o, a) { | |
if (a !== void 0 && typeof a != "string") throw new TypeError('"ext" argument must be a string'); | |
e(o); | |
var l = 0, | |
c = -1, | |
d = !0, | |
h; | |
if (a !== void 0 && a.length > 0 && a.length <= o.length) { | |
if (a.length === o.length && a === o) return ""; | |
var m = a.length - 1, | |
w = -1; | |
for (h = o.length - 1; h >= 0; --h) { | |
var T = o.charCodeAt(h); | |
if (T === 47) { | |
if (!d) { | |
l = h + 1; | |
break; | |
} | |
} else w === -1 && (d = !1, w = h + 1), m >= 0 && (T === a.charCodeAt(m) ? --m === -1 && (c = h) : (m = -1, c = w)); | |
} | |
return l === c ? c = w : c === -1 && (c = o.length), o.slice(l, c); | |
} else { | |
for (h = o.length - 1; h >= 0; --h) if (o.charCodeAt(h) === 47) { | |
if (!d) { | |
l = h + 1; | |
break; | |
} | |
} else c === -1 && (d = !1, c = h + 1); | |
return c === -1 ? "" : o.slice(l, c); | |
} | |
}, | |
extname: function extname(o) { | |
e(o); | |
for (var a = -1, l = 0, c = -1, d = !0, h = 0, m = o.length - 1; m >= 0; --m) { | |
var w = o.charCodeAt(m); | |
if (w === 47) { | |
if (!d) { | |
l = m + 1; | |
break; | |
} | |
continue; | |
} | |
c === -1 && (d = !1, c = m + 1), w === 46 ? a === -1 ? a = m : h !== 1 && (h = 1) : a !== -1 && (h = -1); | |
} | |
return a === -1 || c === -1 || h === 0 || h === 1 && a === c - 1 && a === l + 1 ? "" : o.slice(a, c); | |
}, | |
format: function format(o) { | |
if (o === null || _typeof(o) != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + _typeof(o)); | |
return n("/", o); | |
}, | |
parse: function parse(o) { | |
e(o); | |
var a = { | |
root: "", | |
dir: "", | |
base: "", | |
ext: "", | |
name: "" | |
}; | |
if (o.length === 0) return a; | |
var l = o.charCodeAt(0), | |
c = l === 47, | |
d; | |
c ? (a.root = "/", d = 1) : d = 0; | |
for (var h = -1, m = 0, w = -1, T = !0, v = o.length - 1, b = 0; v >= d; --v) { | |
if (l = o.charCodeAt(v), l === 47) { | |
if (!T) { | |
m = v + 1; | |
break; | |
} | |
continue; | |
} | |
w === -1 && (T = !1, w = v + 1), l === 46 ? h === -1 ? h = v : b !== 1 && (b = 1) : h !== -1 && (b = -1); | |
} | |
return h === -1 || w === -1 || b === 0 || b === 1 && h === w - 1 && h === m + 1 ? w !== -1 && (m === 0 && c ? a.base = a.name = o.slice(1, w) : a.base = a.name = o.slice(m, w)) : (m === 0 && c ? (a.name = o.slice(1, h), a.base = o.slice(1, w)) : (a.name = o.slice(m, h), a.base = o.slice(m, w)), a.ext = o.slice(h, w)), m > 0 ? a.dir = o.slice(0, m - 1) : c && (a.dir = "/"), a; | |
}, | |
sep: "/", | |
delimiter: ":", | |
win32: null, | |
posix: null | |
}; | |
return i.posix = i, Zl = i, Zl; | |
} | |
var Zl, | |
Aw, | |
ef, | |
Iw = rt(function () { | |
P(); | |
O(); | |
R(); | |
Xl(); | |
Zl = {}, Aw = !1; | |
ef = aT(); | |
}); | |
var qw = {}; | |
on(qw, { | |
URL: function URL() { | |
return vT; | |
}, | |
Url: function Url() { | |
return gT; | |
}, | |
"default": function _default() { | |
return yt; | |
}, | |
fileURLToPath: function fileURLToPath() { | |
return Nw; | |
}, | |
format: function format() { | |
return wT; | |
}, | |
parse: function parse() { | |
return mT; | |
}, | |
pathToFileURL: function pathToFileURL() { | |
return Lw; | |
}, | |
resolve: function resolve() { | |
return bT; | |
}, | |
resolveObject: function resolveObject() { | |
return _T; | |
} | |
}); | |
function lT() { | |
if (Tw) return tf; | |
Tw = !0; | |
var t = typeof Map == "function" && Map.prototype, | |
e = Object.getOwnPropertyDescriptor && t ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, | |
r = t && e && typeof e.get == "function" ? e.get : null, | |
n = t && Map.prototype.forEach, | |
i = typeof Set == "function" && Set.prototype, | |
s = Object.getOwnPropertyDescriptor && i ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, | |
o = i && s && typeof s.get == "function" ? s.get : null, | |
a = i && Set.prototype.forEach, | |
l = typeof WeakMap == "function" && WeakMap.prototype, | |
c = l ? WeakMap.prototype.has : null, | |
d = typeof WeakSet == "function" && WeakSet.prototype, | |
h = d ? WeakSet.prototype.has : null, | |
m = typeof WeakRef == "function" && WeakRef.prototype, | |
w = m ? WeakRef.prototype.deref : null, | |
T = Boolean.prototype.valueOf, | |
v = Object.prototype.toString, | |
b = Function.prototype.toString, | |
p = String.prototype.match, | |
_ = String.prototype.slice, | |
x = String.prototype.replace, | |
I = String.prototype.toUpperCase, | |
y = String.prototype.toLowerCase, | |
B = RegExp.prototype.test, | |
A = Array.prototype.concat, | |
q = Array.prototype.join, | |
$ = Array.prototype.slice, | |
F = Math.floor, | |
Z = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, | |
j = Object.getOwnPropertySymbols, | |
V = typeof Symbol == "function" && _typeof(Symbol.iterator) == "symbol" ? Symbol.prototype.toString : null, | |
G = typeof Symbol == "function" && _typeof(Symbol.iterator) == "object", | |
ne = typeof Symbol == "function" && Symbol.toStringTag && (_typeof(Symbol.toStringTag) === G || !0) ? Symbol.toStringTag : null, | |
ue = Object.prototype.propertyIsEnumerable, | |
ee = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function (C) { | |
return C.__proto__; | |
} : null); | |
function z(C, M) { | |
if (C === 1 / 0 || C === -1 / 0 || C !== C || C && C > -1e3 && C < 1e3 || B.call(/e/, M)) return M; | |
var te = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; | |
if (typeof C == "number") { | |
var oe = C < 0 ? -F(-C) : F(C); | |
if (oe !== C) { | |
var se = String(oe), | |
ye = _.call(M, se.length + 1); | |
return x.call(se, te, "$&_") + "." + x.call(x.call(ye, /([0-9]{3})/g, "$&_"), /_$/, ""); | |
} | |
} | |
return x.call(M, te, "$&_"); | |
} | |
var le = uT, | |
Q = le.custom, | |
X = $e(Q) ? Q : null; | |
tf = function C(M, te, oe, se) { | |
var ye = te || {}; | |
if (Ve(ye, "quoteStyle") && ye.quoteStyle !== "single" && ye.quoteStyle !== "double") throw new TypeError('option "quoteStyle" must be "single" or "double"'); | |
if (Ve(ye, "maxStringLength") && (typeof ye.maxStringLength == "number" ? ye.maxStringLength < 0 && ye.maxStringLength !== 1 / 0 : ye.maxStringLength !== null)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); | |
var Cr = Ve(ye, "customInspect") ? ye.customInspect : !0; | |
if (typeof Cr != "boolean" && Cr !== "symbol") throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); | |
if (Ve(ye, "indent") && ye.indent !== null && ye.indent !== " " && !(parseInt(ye.indent, 10) === ye.indent && ye.indent > 0)) throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); | |
if (Ve(ye, "numericSeparator") && typeof ye.numericSeparator != "boolean") throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); | |
var nn = ye.numericSeparator; | |
if (typeof M == "undefined") return "undefined"; | |
if (M === null) return "null"; | |
if (typeof M == "boolean") return M ? "true" : "false"; | |
if (typeof M == "string") return qt(M, ye); | |
if (typeof M == "number") { | |
if (M === 0) return 1 / 0 / M > 0 ? "0" : "-0"; | |
var bt = String(M); | |
return nn ? z(M, bt) : bt; | |
} | |
if (typeof M == "bigint") { | |
var kr = String(M) + "n"; | |
return nn ? z(M, kr) : kr; | |
} | |
var Qs = typeof ye.depth == "undefined" ? 5 : ye.depth; | |
if (typeof oe == "undefined" && (oe = 0), oe >= Qs && Qs > 0 && _typeof(M) == "object") return re(M) ? "[Array]" : "[Object]"; | |
var Fn = k(ye, oe); | |
if (typeof se == "undefined") se = [];else if (wr(se, M) >= 0) return "[Circular]"; | |
function Ut(jn, yo, ab) { | |
if (yo && (se = $.call(se), se.push(yo)), ab) { | |
var Lf = { | |
depth: ye.depth | |
}; | |
return Ve(ye, "quoteStyle") && (Lf.quoteStyle = ye.quoteStyle), C(jn, Lf, oe + 1, se); | |
} | |
return C(jn, ye, oe + 1, se); | |
} | |
if (typeof M == "function" && !ve(M)) { | |
var Of = gr(M), | |
xf = U(M, Ut); | |
return "[Function" + (Of ? ": " + Of : " (anonymous)") + "]" + (xf.length > 0 ? " { " + q.call(xf, ", ") + " }" : ""); | |
} | |
if ($e(M)) { | |
var Bf = G ? x.call(String(M), /^(Symbol\(.*\))_[^)]*$/, "$1") : V.call(M); | |
return _typeof(M) == "object" && !G ? g(Bf) : Bf; | |
} | |
if (Ks(M)) { | |
for (var Ti = "<" + y.call(String(M.nodeName)), Ys = M.attributes || [], po = 0; po < Ys.length; po++) Ti += " " + Ys[po].name + "=" + _e(Y(Ys[po].value), "double", ye); | |
return Ti += ">", M.childNodes && M.childNodes.length && (Ti += "..."), Ti += "</" + y.call(String(M.nodeName)) + ">", Ti; | |
} | |
if (re(M)) { | |
if (M.length === 0) return "[]"; | |
var Js = U(M, Ut); | |
return Fn && !S(Js) ? "[" + N(Js, Fn) + "]" : "[ " + q.call(Js, ", ") + " ]"; | |
} | |
if (me(M)) { | |
var Xs = U(M, Ut); | |
return !("cause" in Error.prototype) && "cause" in M && !ue.call(M, "cause") ? "{ [" + String(M) + "] " + q.call(A.call("[cause]: " + Ut(M.cause), Xs), ", ") + " }" : Xs.length === 0 ? "[" + String(M) + "]" : "{ [" + String(M) + "] " + q.call(Xs, ", ") + " }"; | |
} | |
if (_typeof(M) == "object" && Cr) { | |
if (X && typeof M[X] == "function" && le) return le(M, { | |
depth: Qs - oe | |
}); | |
if (Cr !== "symbol" && typeof M.inspect == "function") return M.inspect(); | |
} | |
if (Ai(M)) { | |
var Cf = []; | |
return n && n.call(M, function (jn, yo) { | |
Cf.push(Ut(yo, M, !0) + " => " + Ut(jn, M)); | |
}), f("Map", r.call(M), Cf, Fn); | |
} | |
if (Pt(M)) { | |
var kf = []; | |
return a && a.call(M, function (jn) { | |
kf.push(Ut(jn, M)); | |
}), f("Set", o.call(M), kf, Fn); | |
} | |
if (ho(M)) return u("WeakMap"); | |
if (Ii(M)) return u("WeakSet"); | |
if (Dn(M)) return u("WeakRef"); | |
if (Te(M)) return g(Ut(Number(M))); | |
if (qe(M)) return g(Ut(Z.call(M))); | |
if (Re(M)) return g(T.call(M)); | |
if (Me(M)) return g(Ut(String(M))); | |
if (typeof window != "undefined" && M === window) return "{ [object Window] }"; | |
if (typeof globalThis != "undefined" && M === globalThis || typeof rf != "undefined" && M === rf) return "{ [object globalThis] }"; | |
if (!ge(M) && !ve(M)) { | |
var Zs = U(M, Ut), | |
Mf = ee ? ee(M) === Object.prototype : M instanceof Object || M.constructor === Object, | |
ea = M instanceof Object ? "" : "null prototype", | |
Nf = !Mf && ne && Object(M) === M && ne in M ? _.call(Ye(M), 8, -1) : ea ? "Object" : "", | |
sb = Mf || typeof M.constructor != "function" ? "" : M.constructor.name ? M.constructor.name + " " : "", | |
ta = sb + (Nf || ea ? "[" + q.call(A.call([], Nf || [], ea || []), ": ") + "] " : ""); | |
return Zs.length === 0 ? ta + "{}" : Fn ? ta + "{" + N(Zs, Fn) + "}" : ta + "{ " + q.call(Zs, ", ") + " }"; | |
} | |
return String(M); | |
}; | |
function _e(C, M, te) { | |
var oe = (te.quoteStyle || M) === "double" ? '"' : "'"; | |
return oe + C + oe; | |
} | |
function Y(C) { | |
return x.call(String(C), /"/g, """); | |
} | |
function re(C) { | |
return Ye(C) === "[object Array]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function ge(C) { | |
return Ye(C) === "[object Date]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function ve(C) { | |
return Ye(C) === "[object RegExp]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function me(C) { | |
return Ye(C) === "[object Error]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function Me(C) { | |
return Ye(C) === "[object String]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function Te(C) { | |
return Ye(C) === "[object Number]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function Re(C) { | |
return Ye(C) === "[object Boolean]" && (!ne || !(_typeof(C) == "object" && ne in C)); | |
} | |
function $e(C) { | |
if (G) return C && _typeof(C) == "object" && C instanceof Symbol; | |
if (_typeof(C) == "symbol") return !0; | |
if (!C || _typeof(C) != "object" || !V) return !1; | |
try { | |
return V.call(C), !0; | |
} catch (M) {} | |
return !1; | |
} | |
function qe(C) { | |
if (!C || _typeof(C) != "object" || !Z) return !1; | |
try { | |
return Z.call(C), !0; | |
} catch (M) {} | |
return !1; | |
} | |
var Lt = Object.prototype.hasOwnProperty || function (C) { | |
return C in (this || rf); | |
}; | |
function Ve(C, M) { | |
return Lt.call(C, M); | |
} | |
function Ye(C) { | |
return v.call(C); | |
} | |
function gr(C) { | |
if (C.name) return C.name; | |
var M = p.call(b.call(C), /^function\s*([\w$]+)/); | |
return M ? M[1] : null; | |
} | |
function wr(C, M) { | |
if (C.indexOf) return C.indexOf(M); | |
for (var te = 0, oe = C.length; te < oe; te++) if (C[te] === M) return te; | |
return -1; | |
} | |
function Ai(C) { | |
if (!r || !C || _typeof(C) != "object") return !1; | |
try { | |
r.call(C); | |
try { | |
o.call(C); | |
} catch (M) { | |
return !0; | |
} | |
return C instanceof Map; | |
} catch (M) {} | |
return !1; | |
} | |
function ho(C) { | |
if (!c || !C || _typeof(C) != "object") return !1; | |
try { | |
c.call(C, c); | |
try { | |
h.call(C, h); | |
} catch (M) { | |
return !0; | |
} | |
return C instanceof WeakMap; | |
} catch (M) {} | |
return !1; | |
} | |
function Dn(C) { | |
if (!w || !C || _typeof(C) != "object") return !1; | |
try { | |
return w.call(C), !0; | |
} catch (M) {} | |
return !1; | |
} | |
function Pt(C) { | |
if (!o || !C || _typeof(C) != "object") return !1; | |
try { | |
o.call(C); | |
try { | |
r.call(C); | |
} catch (M) { | |
return !0; | |
} | |
return C instanceof Set; | |
} catch (M) {} | |
return !1; | |
} | |
function Ii(C) { | |
if (!h || !C || _typeof(C) != "object") return !1; | |
try { | |
h.call(C, h); | |
try { | |
c.call(C, c); | |
} catch (M) { | |
return !0; | |
} | |
return C instanceof WeakSet; | |
} catch (M) {} | |
return !1; | |
} | |
function Ks(C) { | |
return !C || _typeof(C) != "object" ? !1 : typeof HTMLElement != "undefined" && C instanceof HTMLElement ? !0 : typeof C.nodeName == "string" && typeof C.getAttribute == "function"; | |
} | |
function qt(C, M) { | |
if (C.length > M.maxStringLength) { | |
var te = C.length - M.maxStringLength, | |
oe = "... " + te + " more character" + (te > 1 ? "s" : ""); | |
return qt(_.call(C, 0, M.maxStringLength), M) + oe; | |
} | |
var se = x.call(x.call(C, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Gs); | |
return _e(se, "single", M); | |
} | |
function Gs(C) { | |
var M = C.charCodeAt(0), | |
te = { | |
8: "b", | |
9: "t", | |
10: "n", | |
12: "f", | |
13: "r" | |
}[M]; | |
return te ? "\\" + te : "\\x" + (M < 16 ? "0" : "") + I.call(M.toString(16)); | |
} | |
function g(C) { | |
return "Object(" + C + ")"; | |
} | |
function u(C) { | |
return C + " { ? }"; | |
} | |
function f(C, M, te, oe) { | |
var se = oe ? N(te, oe) : q.call(te, ", "); | |
return C + " (" + M + ") {" + se + "}"; | |
} | |
function S(C) { | |
for (var M = 0; M < C.length; M++) if (wr(C[M], "\n") >= 0) return !1; | |
return !0; | |
} | |
function k(C, M) { | |
var te; | |
if (C.indent === " ") te = " ";else if (typeof C.indent == "number" && C.indent > 0) te = q.call(Array(C.indent + 1), " ");else return null; | |
return { | |
base: te, | |
prev: q.call(Array(M + 1), te) | |
}; | |
} | |
function N(C, M) { | |
if (C.length === 0) return ""; | |
var te = "\n" + M.prev + M.base; | |
return te + q.call(C, "," + te) + "\n" + M.prev; | |
} | |
function U(C, M) { | |
var te = re(C), | |
oe = []; | |
if (te) { | |
oe.length = C.length; | |
for (var se = 0; se < C.length; se++) oe[se] = Ve(C, se) ? M(C[se], C) : ""; | |
} | |
var ye = typeof j == "function" ? j(C) : [], | |
Cr; | |
if (G) { | |
Cr = {}; | |
for (var nn = 0; nn < ye.length; nn++) Cr["$" + ye[nn]] = ye[nn]; | |
} | |
for (var bt in C) Ve(C, bt) && (te && String(Number(bt)) === bt && bt < C.length || G && Cr["$" + bt] instanceof Symbol || (B.call(/[^\w$]/, bt) ? oe.push(M(bt, C) + ": " + M(C[bt], C)) : oe.push(bt + ": " + M(C[bt], C)))); | |
if (typeof j == "function") for (var kr = 0; kr < ye.length; kr++) ue.call(C, ye[kr]) && oe.push("[" + M(ye[kr]) + "]: " + M(C[ye[kr]], C)); | |
return oe; | |
} | |
return tf; | |
} | |
function fT() { | |
if (Pw) return nf; | |
Pw = !0; | |
var t = Mn(), | |
e = mw(), | |
r = lT(), | |
n = vi(), | |
i = t("%WeakMap%", !0), | |
s = t("%Map%", !0), | |
o = e("WeakMap.prototype.get", !0), | |
a = e("WeakMap.prototype.set", !0), | |
l = e("WeakMap.prototype.has", !0), | |
c = e("Map.prototype.get", !0), | |
d = e("Map.prototype.set", !0), | |
h = e("Map.prototype.has", !0), | |
m = function m(b, p) { | |
for (var _ = b, x; (x = _.next) !== null; _ = x) if (x.key === p) return _.next = x.next, x.next = b.next, b.next = x, x; | |
}, | |
w = function w(b, p) { | |
var _ = m(b, p); | |
return _ && _.value; | |
}, | |
T = function T(b, p, _) { | |
var x = m(b, p); | |
x ? x.value = _ : b.next = { | |
key: p, | |
next: b.next, | |
value: _ | |
}; | |
}, | |
v = function v(b, p) { | |
return !!m(b, p); | |
}; | |
return nf = function nf() { | |
var p, | |
_, | |
x, | |
I = { | |
assert: function assert(y) { | |
if (!I.has(y)) throw new n("Side channel does not contain " + r(y)); | |
}, | |
get: function get(y) { | |
if (i && y && (_typeof(y) == "object" || typeof y == "function")) { | |
if (p) return o(p, y); | |
} else if (s) { | |
if (_) return c(_, y); | |
} else if (x) return w(x, y); | |
}, | |
has: function has(y) { | |
if (i && y && (_typeof(y) == "object" || typeof y == "function")) { | |
if (p) return l(p, y); | |
} else if (s) { | |
if (_) return h(_, y); | |
} else if (x) return v(x, y); | |
return !1; | |
}, | |
set: function set(y, B) { | |
i && y && (_typeof(y) == "object" || typeof y == "function") ? (p || (p = new i()), a(p, y, B)) : s ? (_ || (_ = new s()), d(_, y, B)) : (x || (x = { | |
key: {}, | |
next: null | |
}), T(x, y, B)); | |
} | |
}; | |
return I; | |
}, nf; | |
} | |
function cf() { | |
if (Rw) return of; | |
Rw = !0; | |
var t = String.prototype.replace, | |
e = /%20/g, | |
r = { | |
RFC1738: "RFC1738", | |
RFC3986: "RFC3986" | |
}; | |
return of = { | |
"default": r.RFC3986, | |
formatters: { | |
RFC1738: function RFC1738(n) { | |
return t.call(n, e, "+"); | |
}, | |
RFC3986: function RFC3986(n) { | |
return String(n); | |
} | |
}, | |
RFC1738: r.RFC1738, | |
RFC3986: r.RFC3986 | |
}, of; | |
} | |
function Mw() { | |
if (Ow) return sf; | |
Ow = !0; | |
var t = cf(), | |
e = Object.prototype.hasOwnProperty, | |
r = Array.isArray, | |
n = function () { | |
for (var b = [], p = 0; p < 256; ++p) b.push("%" + ((p < 16 ? "0" : "") + p.toString(16)).toUpperCase()); | |
return b; | |
}(), | |
i = function i(p) { | |
for (; p.length > 1;) { | |
var _ = p.pop(), | |
x = _.obj[_.prop]; | |
if (r(x)) { | |
for (var I = [], y = 0; y < x.length; ++y) typeof x[y] != "undefined" && I.push(x[y]); | |
_.obj[_.prop] = I; | |
} | |
} | |
}, | |
s = function s(p, _) { | |
for (var x = _ && _.plainObjects ? Object.create(null) : {}, I = 0; I < p.length; ++I) typeof p[I] != "undefined" && (x[I] = p[I]); | |
return x; | |
}, | |
o = function b(p, _, x) { | |
if (!_) return p; | |
if (_typeof(_) != "object") { | |
if (r(p)) p.push(_);else if (p && _typeof(p) == "object") (x && (x.plainObjects || x.allowPrototypes) || !e.call(Object.prototype, _)) && (p[_] = !0);else return [p, _]; | |
return p; | |
} | |
if (!p || _typeof(p) != "object") return [p].concat(_); | |
var I = p; | |
return r(p) && !r(_) && (I = s(p, x)), r(p) && r(_) ? (_.forEach(function (y, B) { | |
if (e.call(p, B)) { | |
var A = p[B]; | |
A && _typeof(A) == "object" && y && _typeof(y) == "object" ? p[B] = b(A, y, x) : p.push(y); | |
} else p[B] = y; | |
}), p) : Object.keys(_).reduce(function (y, B) { | |
var A = _[B]; | |
return e.call(y, B) ? y[B] = b(y[B], A, x) : y[B] = A, y; | |
}, I); | |
}, | |
a = function a(p, _) { | |
return Object.keys(_).reduce(function (x, I) { | |
return x[I] = _[I], x; | |
}, p); | |
}, | |
l = function l(b, p, _) { | |
var x = b.replace(/\+/g, " "); | |
if (_ === "iso-8859-1") return x.replace(/%[0-9a-f]{2}/gi, unescape); | |
try { | |
return decodeURIComponent(x); | |
} catch (I) { | |
return x; | |
} | |
}, | |
c = 1024, | |
d = function d(p, _, x, I, y) { | |
if (p.length === 0) return p; | |
var B = p; | |
if (_typeof(p) == "symbol" ? B = Symbol.prototype.toString.call(p) : typeof p != "string" && (B = String(p)), x === "iso-8859-1") return escape(B).replace(/%u[0-9a-f]{4}/gi, function (V) { | |
return "%26%23" + parseInt(V.slice(2), 16) + "%3B"; | |
}); | |
for (var A = "", q = 0; q < B.length; q += c) { | |
for (var $ = B.length >= c ? B.slice(q, q + c) : B, F = [], Z = 0; Z < $.length; ++Z) { | |
var j = $.charCodeAt(Z); | |
if (j === 45 || j === 46 || j === 95 || j === 126 || j >= 48 && j <= 57 || j >= 65 && j <= 90 || j >= 97 && j <= 122 || y === t.RFC1738 && (j === 40 || j === 41)) { | |
F[F.length] = $.charAt(Z); | |
continue; | |
} | |
if (j < 128) { | |
F[F.length] = n[j]; | |
continue; | |
} | |
if (j < 2048) { | |
F[F.length] = n[192 | j >> 6] + n[128 | j & 63]; | |
continue; | |
} | |
if (j < 55296 || j >= 57344) { | |
F[F.length] = n[224 | j >> 12] + n[128 | j >> 6 & 63] + n[128 | j & 63]; | |
continue; | |
} | |
Z += 1, j = 65536 + ((j & 1023) << 10 | $.charCodeAt(Z) & 1023), F[F.length] = n[240 | j >> 18] + n[128 | j >> 12 & 63] + n[128 | j >> 6 & 63] + n[128 | j & 63]; | |
} | |
A += F.join(""); | |
} | |
return A; | |
}, | |
h = function h(p) { | |
for (var _ = [{ | |
obj: { | |
o: p | |
}, | |
prop: "o" | |
}], x = [], I = 0; I < _.length; ++I) for (var y = _[I], B = y.obj[y.prop], A = Object.keys(B), q = 0; q < A.length; ++q) { | |
var $ = A[q], | |
F = B[$]; | |
_typeof(F) == "object" && F !== null && x.indexOf(F) === -1 && (_.push({ | |
obj: B, | |
prop: $ | |
}), x.push(F)); | |
} | |
return i(_), p; | |
}, | |
m = function m(p) { | |
return Object.prototype.toString.call(p) === "[object RegExp]"; | |
}, | |
w = function w(p) { | |
return !p || _typeof(p) != "object" ? !1 : !!(p.constructor && p.constructor.isBuffer && p.constructor.isBuffer(p)); | |
}, | |
T = function T(p, _) { | |
return [].concat(p, _); | |
}, | |
v = function v(p, _) { | |
if (r(p)) { | |
for (var x = [], I = 0; I < p.length; I += 1) x.push(_(p[I])); | |
return x; | |
} | |
return _(p); | |
}; | |
return sf = { | |
arrayToObject: s, | |
assign: a, | |
combine: T, | |
compact: h, | |
decode: l, | |
encode: d, | |
isBuffer: w, | |
isRegExp: m, | |
maybeMap: v, | |
merge: o | |
}, sf; | |
} | |
function cT() { | |
if (xw) return af; | |
xw = !0; | |
var t = fT(), | |
e = Mw(), | |
r = cf(), | |
n = Object.prototype.hasOwnProperty, | |
i = { | |
brackets: function brackets(b) { | |
return b + "[]"; | |
}, | |
comma: "comma", | |
indices: function indices(b, p) { | |
return b + "[" + p + "]"; | |
}, | |
repeat: function repeat(b) { | |
return b; | |
} | |
}, | |
s = Array.isArray, | |
o = Array.prototype.push, | |
a = function a(v, b) { | |
o.apply(v, s(b) ? b : [b]); | |
}, | |
l = Date.prototype.toISOString, | |
c = r["default"], | |
d = { | |
addQueryPrefix: !1, | |
allowDots: !1, | |
allowEmptyArrays: !1, | |
arrayFormat: "indices", | |
charset: "utf-8", | |
charsetSentinel: !1, | |
delimiter: "&", | |
encode: !0, | |
encodeDotInKeys: !1, | |
encoder: e.encode, | |
encodeValuesOnly: !1, | |
format: c, | |
formatter: r.formatters[c], | |
indices: !1, | |
serializeDate: function serializeDate(b) { | |
return l.call(b); | |
}, | |
skipNulls: !1, | |
strictNullHandling: !1 | |
}, | |
h = function h(b) { | |
return typeof b == "string" || typeof b == "number" || typeof b == "boolean" || _typeof(b) == "symbol" || typeof b == "bigint"; | |
}, | |
m = {}, | |
w = function v(b, p, _, x, I, y, B, A, q, $, F, Z, j, V, G, ne, ue, ee) { | |
for (var z = b, le = ee, Q = 0, X = !1; (le = le.get(m)) !== void 0 && !X;) { | |
var _e = le.get(b); | |
if (Q += 1, typeof _e != "undefined") { | |
if (_e === Q) throw new RangeError("Cyclic object value"); | |
X = !0; | |
} | |
typeof le.get(m) == "undefined" && (Q = 0); | |
} | |
if (typeof $ == "function" ? z = $(p, z) : z instanceof Date ? z = j(z) : _ === "comma" && s(z) && (z = e.maybeMap(z, function (Ye) { | |
return Ye instanceof Date ? j(Ye) : Ye; | |
})), z === null) { | |
if (y) return q && !ne ? q(p, d.encoder, ue, "key", V) : p; | |
z = ""; | |
} | |
if (h(z) || e.isBuffer(z)) { | |
if (q) { | |
var Y = ne ? p : q(p, d.encoder, ue, "key", V); | |
return [G(Y) + "=" + G(q(z, d.encoder, ue, "value", V))]; | |
} | |
return [G(p) + "=" + G(String(z))]; | |
} | |
var re = []; | |
if (typeof z == "undefined") return re; | |
var ge; | |
if (_ === "comma" && s(z)) ne && q && (z = e.maybeMap(z, q)), ge = [{ | |
value: z.length > 0 ? z.join(",") || null : void 0 | |
}];else if (s($)) ge = $;else { | |
var ve = Object.keys(z); | |
ge = F ? ve.sort(F) : ve; | |
} | |
var me = A ? p.replace(/\./g, "%2E") : p, | |
Me = x && s(z) && z.length === 1 ? me + "[]" : me; | |
if (I && s(z) && z.length === 0) return Me + "[]"; | |
for (var Te = 0; Te < ge.length; ++Te) { | |
var Re = ge[Te], | |
$e = _typeof(Re) == "object" && typeof Re.value != "undefined" ? Re.value : z[Re]; | |
if (!(B && $e === null)) { | |
var qe = Z && A ? Re.replace(/\./g, "%2E") : Re, | |
Lt = s(z) ? typeof _ == "function" ? _(Me, qe) : Me : Me + (Z ? "." + qe : "[" + qe + "]"); | |
ee.set(b, Q); | |
var Ve = t(); | |
Ve.set(m, ee), a(re, v($e, Lt, _, x, I, y, B, A, _ === "comma" && ne && s(z) ? null : q, $, F, Z, j, V, G, ne, ue, Ve)); | |
} | |
} | |
return re; | |
}, | |
T = function T(b) { | |
if (!b) return d; | |
if (typeof b.allowEmptyArrays != "undefined" && typeof b.allowEmptyArrays != "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); | |
if (typeof b.encodeDotInKeys != "undefined" && typeof b.encodeDotInKeys != "boolean") throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); | |
if (b.encoder !== null && typeof b.encoder != "undefined" && typeof b.encoder != "function") throw new TypeError("Encoder has to be a function."); | |
var p = b.charset || d.charset; | |
if (typeof b.charset != "undefined" && b.charset !== "utf-8" && b.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); | |
var _ = r["default"]; | |
if (typeof b.format != "undefined") { | |
if (!n.call(r.formatters, b.format)) throw new TypeError("Unknown format option provided."); | |
_ = b.format; | |
} | |
var x = r.formatters[_], | |
I = d.filter; | |
(typeof b.filter == "function" || s(b.filter)) && (I = b.filter); | |
var y; | |
if (b.arrayFormat in i ? y = b.arrayFormat : "indices" in b ? y = b.indices ? "indices" : "repeat" : y = d.arrayFormat, "commaRoundTrip" in b && typeof b.commaRoundTrip != "boolean") throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); | |
var B = typeof b.allowDots == "undefined" ? b.encodeDotInKeys === !0 ? !0 : d.allowDots : !!b.allowDots; | |
return { | |
addQueryPrefix: typeof b.addQueryPrefix == "boolean" ? b.addQueryPrefix : d.addQueryPrefix, | |
allowDots: B, | |
allowEmptyArrays: typeof b.allowEmptyArrays == "boolean" ? !!b.allowEmptyArrays : d.allowEmptyArrays, | |
arrayFormat: y, | |
charset: p, | |
charsetSentinel: typeof b.charsetSentinel == "boolean" ? b.charsetSentinel : d.charsetSentinel, | |
commaRoundTrip: b.commaRoundTrip, | |
delimiter: typeof b.delimiter == "undefined" ? d.delimiter : b.delimiter, | |
encode: typeof b.encode == "boolean" ? b.encode : d.encode, | |
encodeDotInKeys: typeof b.encodeDotInKeys == "boolean" ? b.encodeDotInKeys : d.encodeDotInKeys, | |
encoder: typeof b.encoder == "function" ? b.encoder : d.encoder, | |
encodeValuesOnly: typeof b.encodeValuesOnly == "boolean" ? b.encodeValuesOnly : d.encodeValuesOnly, | |
filter: I, | |
format: _, | |
formatter: x, | |
serializeDate: typeof b.serializeDate == "function" ? b.serializeDate : d.serializeDate, | |
skipNulls: typeof b.skipNulls == "boolean" ? b.skipNulls : d.skipNulls, | |
sort: typeof b.sort == "function" ? b.sort : null, | |
strictNullHandling: typeof b.strictNullHandling == "boolean" ? b.strictNullHandling : d.strictNullHandling | |
}; | |
}; | |
return af = function af(v, b) { | |
var p = v, | |
_ = T(b), | |
x, | |
I; | |
typeof _.filter == "function" ? (I = _.filter, p = I("", p)) : s(_.filter) && (I = _.filter, x = I); | |
var y = []; | |
if (_typeof(p) != "object" || p === null) return ""; | |
var B = i[_.arrayFormat], | |
A = B === "comma" && _.commaRoundTrip; | |
x || (x = Object.keys(p)), _.sort && x.sort(_.sort); | |
for (var q = t(), $ = 0; $ < x.length; ++$) { | |
var F = x[$]; | |
_.skipNulls && p[F] === null || a(y, w(p[F], F, B, A, _.allowEmptyArrays, _.strictNullHandling, _.skipNulls, _.encodeDotInKeys, _.encode ? _.encoder : null, _.filter, _.sort, _.allowDots, _.serializeDate, _.format, _.formatter, _.encodeValuesOnly, _.charset, q)); | |
} | |
var Z = y.join(_.delimiter), | |
j = _.addQueryPrefix === !0 ? "?" : ""; | |
return _.charsetSentinel && (_.charset === "iso-8859-1" ? j += "utf8=%26%2310003%3B&" : j += "utf8=%E2%9C%93&"), Z.length > 0 ? j + Z : ""; | |
}, af; | |
} | |
function hT() { | |
if (Bw) return uf; | |
Bw = !0; | |
var t = Mw(), | |
e = Object.prototype.hasOwnProperty, | |
r = Array.isArray, | |
n = { | |
allowDots: !1, | |
allowEmptyArrays: !1, | |
allowPrototypes: !1, | |
allowSparse: !1, | |
arrayLimit: 20, | |
charset: "utf-8", | |
charsetSentinel: !1, | |
comma: !1, | |
decodeDotInKeys: !1, | |
decoder: t.decode, | |
delimiter: "&", | |
depth: 5, | |
duplicates: "combine", | |
ignoreQueryPrefix: !1, | |
interpretNumericEntities: !1, | |
parameterLimit: 1e3, | |
parseArrays: !0, | |
plainObjects: !1, | |
strictDepth: !1, | |
strictNullHandling: !1 | |
}, | |
i = function i(m) { | |
return m.replace(/&#(\d+);/g, function (w, T) { | |
return String.fromCharCode(parseInt(T, 10)); | |
}); | |
}, | |
s = function s(m, w) { | |
return m && typeof m == "string" && w.comma && m.indexOf(",") > -1 ? m.split(",") : m; | |
}, | |
o = "utf8=%26%2310003%3B", | |
a = "utf8=%E2%9C%93", | |
l = function l(w, T) { | |
var v = { | |
__proto__: null | |
}, | |
b = T.ignoreQueryPrefix ? w.replace(/^\?/, "") : w; | |
b = b.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); | |
var p = T.parameterLimit === 1 / 0 ? void 0 : T.parameterLimit, | |
_ = b.split(T.delimiter, p), | |
x = -1, | |
I, | |
y = T.charset; | |
if (T.charsetSentinel) for (I = 0; I < _.length; ++I) _[I].indexOf("utf8=") === 0 && (_[I] === a ? y = "utf-8" : _[I] === o && (y = "iso-8859-1"), x = I, I = _.length); | |
for (I = 0; I < _.length; ++I) if (I !== x) { | |
var B = _[I], | |
A = B.indexOf("]="), | |
q = A === -1 ? B.indexOf("=") : A + 1, | |
$, | |
F; | |
q === -1 ? ($ = T.decoder(B, n.decoder, y, "key"), F = T.strictNullHandling ? null : "") : ($ = T.decoder(B.slice(0, q), n.decoder, y, "key"), F = t.maybeMap(s(B.slice(q + 1), T), function (j) { | |
return T.decoder(j, n.decoder, y, "value"); | |
})), F && T.interpretNumericEntities && y === "iso-8859-1" && (F = i(F)), B.indexOf("[]=") > -1 && (F = r(F) ? [F] : F); | |
var Z = e.call(v, $); | |
Z && T.duplicates === "combine" ? v[$] = t.combine(v[$], F) : (!Z || T.duplicates === "last") && (v[$] = F); | |
} | |
return v; | |
}, | |
c = function c(m, w, T, v) { | |
for (var b = v ? w : s(w, T), p = m.length - 1; p >= 0; --p) { | |
var _, | |
x = m[p]; | |
if (x === "[]" && T.parseArrays) _ = T.allowEmptyArrays && (b === "" || T.strictNullHandling && b === null) ? [] : [].concat(b);else { | |
_ = T.plainObjects ? Object.create(null) : {}; | |
var I = x.charAt(0) === "[" && x.charAt(x.length - 1) === "]" ? x.slice(1, -1) : x, | |
y = T.decodeDotInKeys ? I.replace(/%2E/g, ".") : I, | |
B = parseInt(y, 10); | |
!T.parseArrays && y === "" ? _ = { | |
0: b | |
} : !isNaN(B) && x !== y && String(B) === y && B >= 0 && T.parseArrays && B <= T.arrayLimit ? (_ = [], _[B] = b) : y !== "__proto__" && (_[y] = b); | |
} | |
b = _; | |
} | |
return b; | |
}, | |
d = function d(w, T, v, b) { | |
if (w) { | |
var p = v.allowDots ? w.replace(/\.([^.[]+)/g, "[$1]") : w, | |
_ = /(\[[^[\]]*])/, | |
x = /(\[[^[\]]*])/g, | |
I = v.depth > 0 && _.exec(p), | |
y = I ? p.slice(0, I.index) : p, | |
B = []; | |
if (y) { | |
if (!v.plainObjects && e.call(Object.prototype, y) && !v.allowPrototypes) return; | |
B.push(y); | |
} | |
for (var A = 0; v.depth > 0 && (I = x.exec(p)) !== null && A < v.depth;) { | |
if (A += 1, !v.plainObjects && e.call(Object.prototype, I[1].slice(1, -1)) && !v.allowPrototypes) return; | |
B.push(I[1]); | |
} | |
if (I) { | |
if (v.strictDepth === !0) throw new RangeError("Input depth exceeded depth option of " + v.depth + " and strictDepth is true"); | |
B.push("[" + p.slice(I.index) + "]"); | |
} | |
return c(B, T, v, b); | |
} | |
}, | |
h = function h(w) { | |
if (!w) return n; | |
if (typeof w.allowEmptyArrays != "undefined" && typeof w.allowEmptyArrays != "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); | |
if (typeof w.decodeDotInKeys != "undefined" && typeof w.decodeDotInKeys != "boolean") throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); | |
if (w.decoder !== null && typeof w.decoder != "undefined" && typeof w.decoder != "function") throw new TypeError("Decoder has to be a function."); | |
if (typeof w.charset != "undefined" && w.charset !== "utf-8" && w.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); | |
var T = typeof w.charset == "undefined" ? n.charset : w.charset, | |
v = typeof w.duplicates == "undefined" ? n.duplicates : w.duplicates; | |
if (v !== "combine" && v !== "first" && v !== "last") throw new TypeError("The duplicates option must be either combine, first, or last"); | |
var b = typeof w.allowDots == "undefined" ? w.decodeDotInKeys === !0 ? !0 : n.allowDots : !!w.allowDots; | |
return { | |
allowDots: b, | |
allowEmptyArrays: typeof w.allowEmptyArrays == "boolean" ? !!w.allowEmptyArrays : n.allowEmptyArrays, | |
allowPrototypes: typeof w.allowPrototypes == "boolean" ? w.allowPrototypes : n.allowPrototypes, | |
allowSparse: typeof w.allowSparse == "boolean" ? w.allowSparse : n.allowSparse, | |
arrayLimit: typeof w.arrayLimit == "number" ? w.arrayLimit : n.arrayLimit, | |
charset: T, | |
charsetSentinel: typeof w.charsetSentinel == "boolean" ? w.charsetSentinel : n.charsetSentinel, | |
comma: typeof w.comma == "boolean" ? w.comma : n.comma, | |
decodeDotInKeys: typeof w.decodeDotInKeys == "boolean" ? w.decodeDotInKeys : n.decodeDotInKeys, | |
decoder: typeof w.decoder == "function" ? w.decoder : n.decoder, | |
delimiter: typeof w.delimiter == "string" || t.isRegExp(w.delimiter) ? w.delimiter : n.delimiter, | |
depth: typeof w.depth == "number" || w.depth === !1 ? +w.depth : n.depth, | |
duplicates: v, | |
ignoreQueryPrefix: w.ignoreQueryPrefix === !0, | |
interpretNumericEntities: typeof w.interpretNumericEntities == "boolean" ? w.interpretNumericEntities : n.interpretNumericEntities, | |
parameterLimit: typeof w.parameterLimit == "number" ? w.parameterLimit : n.parameterLimit, | |
parseArrays: w.parseArrays !== !1, | |
plainObjects: typeof w.plainObjects == "boolean" ? w.plainObjects : n.plainObjects, | |
strictDepth: typeof w.strictDepth == "boolean" ? !!w.strictDepth : n.strictDepth, | |
strictNullHandling: typeof w.strictNullHandling == "boolean" ? w.strictNullHandling : n.strictNullHandling | |
}; | |
}; | |
return uf = function uf(m, w) { | |
var T = h(w); | |
if (m === "" || m === null || typeof m == "undefined") return T.plainObjects ? Object.create(null) : {}; | |
for (var v = typeof m == "string" ? l(m, T) : m, b = T.plainObjects ? Object.create(null) : {}, p = Object.keys(v), _ = 0; _ < p.length; ++_) { | |
var x = p[_], | |
I = d(x, v[x], T, typeof m == "string"); | |
b = t.merge(b, I, T); | |
} | |
return T.allowSparse === !0 ? b : t.compact(b); | |
}, uf; | |
} | |
function dT() { | |
if (Cw) return lf; | |
Cw = !0; | |
var t = cT(), | |
e = hT(), | |
r = cf(); | |
return lf = { | |
formats: r, | |
parse: e, | |
stringify: t | |
}, lf; | |
} | |
function pT() { | |
if (kw) return Ln; | |
kw = !0; | |
var t = Xr; | |
function e() { | |
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null; | |
} | |
var r = /^([a-z0-9.+-]+:)/i, | |
n = /:[0-9]*$/, | |
i = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, | |
s = ["<", ">", '"', "`", " ", "\r", "\n", " "], | |
o = ["{", "}", "|", "\\", "^", "`"].concat(s), | |
a = ["'"].concat(o), | |
l = ["%", "/", "?", ";", "#"].concat(a), | |
c = ["/", "?", "#"], | |
d = 255, | |
h = /^[+a-z0-9A-Z_-]{0,63}$/, | |
m = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, | |
w = { | |
javascript: !0, | |
"javascript:": !0 | |
}, | |
T = { | |
javascript: !0, | |
"javascript:": !0 | |
}, | |
v = { | |
http: !0, | |
https: !0, | |
ftp: !0, | |
gopher: !0, | |
file: !0, | |
"http:": !0, | |
"https:": !0, | |
"ftp:": !0, | |
"gopher:": !0, | |
"file:": !0 | |
}, | |
b = dT(); | |
function p(y, B, A) { | |
if (y && _typeof(y) == "object" && y instanceof e) return y; | |
var q = new e(); | |
return q.parse(y, B, A), q; | |
} | |
e.prototype.parse = function (y, B, A) { | |
if (typeof y != "string") throw new TypeError("Parameter 'url' must be a string, not " + _typeof(y)); | |
var q = y.indexOf("?"), | |
$ = q !== -1 && q < y.indexOf("#") ? "?" : "#", | |
F = y.split($), | |
Z = /\\/g; | |
F[0] = F[0].replace(Z, "/"), y = F.join($); | |
var j = y; | |
if (j = j.trim(), !A && y.split("#").length === 1) { | |
var V = i.exec(j); | |
if (V) return this.path = j, this.href = j, this.pathname = V[1], V[2] ? (this.search = V[2], B ? this.query = b.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : B && (this.search = "", this.query = {}), this; | |
} | |
var G = r.exec(j); | |
if (G) { | |
G = G[0]; | |
var ne = G.toLowerCase(); | |
this.protocol = ne, j = j.substr(G.length); | |
} | |
if (A || G || j.match(/^\/\/[^@/]+@[^@/]+/)) { | |
var ue = j.substr(0, 2) === "//"; | |
ue && !(G && T[G]) && (j = j.substr(2), this.slashes = !0); | |
} | |
if (!T[G] && (ue || G && !v[G])) { | |
for (var ee = -1, z = 0; z < c.length; z++) { | |
var le = j.indexOf(c[z]); | |
le !== -1 && (ee === -1 || le < ee) && (ee = le); | |
} | |
var Q, X; | |
ee === -1 ? X = j.lastIndexOf("@") : X = j.lastIndexOf("@", ee), X !== -1 && (Q = j.slice(0, X), j = j.slice(X + 1), this.auth = decodeURIComponent(Q)), ee = -1; | |
for (var z = 0; z < l.length; z++) { | |
var le = j.indexOf(l[z]); | |
le !== -1 && (ee === -1 || le < ee) && (ee = le); | |
} | |
ee === -1 && (ee = j.length), this.host = j.slice(0, ee), j = j.slice(ee), this.parseHost(), this.hostname = this.hostname || ""; | |
var _e = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]"; | |
if (!_e) for (var Y = this.hostname.split(/\./), z = 0, re = Y.length; z < re; z++) { | |
var ge = Y[z]; | |
if (ge && !ge.match(h)) { | |
for (var ve = "", me = 0, Me = ge.length; me < Me; me++) ge.charCodeAt(me) > 127 ? ve += "x" : ve += ge[me]; | |
if (!ve.match(h)) { | |
var Te = Y.slice(0, z), | |
Re = Y.slice(z + 1), | |
$e = ge.match(m); | |
$e && (Te.push($e[1]), Re.unshift($e[2])), Re.length && (j = "/" + Re.join(".") + j), this.hostname = Te.join("."); | |
break; | |
} | |
} | |
} | |
this.hostname.length > d ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), _e || (this.hostname = t.toASCII(this.hostname)); | |
var qe = this.port ? ":" + this.port : "", | |
Lt = this.hostname || ""; | |
this.host = Lt + qe, this.href += this.host, _e && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), j[0] !== "/" && (j = "/" + j)); | |
} | |
if (!w[ne]) for (var z = 0, re = a.length; z < re; z++) { | |
var Ve = a[z]; | |
if (j.indexOf(Ve) !== -1) { | |
var Ye = encodeURIComponent(Ve); | |
Ye === Ve && (Ye = escape(Ve)), j = j.split(Ve).join(Ye); | |
} | |
} | |
var gr = j.indexOf("#"); | |
gr !== -1 && (this.hash = j.substr(gr), j = j.slice(0, gr)); | |
var wr = j.indexOf("?"); | |
if (wr !== -1 ? (this.search = j.substr(wr), this.query = j.substr(wr + 1), B && (this.query = b.parse(this.query)), j = j.slice(0, wr)) : B && (this.search = "", this.query = {}), j && (this.pathname = j), v[ne] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) { | |
var qe = this.pathname || "", | |
Ai = this.search || ""; | |
this.path = qe + Ai; | |
} | |
return this.href = this.format(), this; | |
}; | |
function _(y) { | |
return typeof y == "string" && (y = p(y)), y instanceof e ? y.format() : e.prototype.format.call(y); | |
} | |
e.prototype.format = function () { | |
var y = this.auth || ""; | |
y && (y = encodeURIComponent(y), y = y.replace(/%3A/i, ":"), y += "@"); | |
var B = this.protocol || "", | |
A = this.pathname || "", | |
q = this.hash || "", | |
$ = !1, | |
F = ""; | |
this.host ? $ = y + this.host : this.hostname && ($ = y + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && ($ += ":" + this.port)), this.query && _typeof(this.query) == "object" && Object.keys(this.query).length && (F = b.stringify(this.query, { | |
arrayFormat: "repeat", | |
addQueryPrefix: !1 | |
})); | |
var Z = this.search || F && "?" + F || ""; | |
return B && B.substr(-1) !== ":" && (B += ":"), this.slashes || (!B || v[B]) && $ !== !1 ? ($ = "//" + ($ || ""), A && A.charAt(0) !== "/" && (A = "/" + A)) : $ || ($ = ""), q && q.charAt(0) !== "#" && (q = "#" + q), Z && Z.charAt(0) !== "?" && (Z = "?" + Z), A = A.replace(/[?#]/g, function (j) { | |
return encodeURIComponent(j); | |
}), Z = Z.replace("#", "%23"), B + $ + A + Z + q; | |
}; | |
function x(y, B) { | |
return p(y, !1, !0).resolve(B); | |
} | |
e.prototype.resolve = function (y) { | |
return this.resolveObject(p(y, !1, !0)).format(); | |
}; | |
function I(y, B) { | |
return y ? p(y, !1, !0).resolveObject(B) : B; | |
} | |
return e.prototype.resolveObject = function (y) { | |
if (typeof y == "string") { | |
var B = new e(); | |
B.parse(y, !1, !0), y = B; | |
} | |
for (var A = new e(), q = Object.keys(this), $ = 0; $ < q.length; $++) { | |
var F = q[$]; | |
A[F] = this[F]; | |
} | |
if (A.hash = y.hash, y.href === "") return A.href = A.format(), A; | |
if (y.slashes && !y.protocol) { | |
for (var Z = Object.keys(y), j = 0; j < Z.length; j++) { | |
var V = Z[j]; | |
V !== "protocol" && (A[V] = y[V]); | |
} | |
return v[A.protocol] && A.hostname && !A.pathname && (A.pathname = "/", A.path = A.pathname), A.href = A.format(), A; | |
} | |
if (y.protocol && y.protocol !== A.protocol) { | |
if (!v[y.protocol]) { | |
for (var G = Object.keys(y), ne = 0; ne < G.length; ne++) { | |
var ue = G[ne]; | |
A[ue] = y[ue]; | |
} | |
return A.href = A.format(), A; | |
} | |
if (A.protocol = y.protocol, !y.host && !T[y.protocol]) { | |
for (var re = (y.pathname || "").split("/"); re.length && !(y.host = re.shift());); | |
y.host || (y.host = ""), y.hostname || (y.hostname = ""), re[0] !== "" && re.unshift(""), re.length < 2 && re.unshift(""), A.pathname = re.join("/"); | |
} else A.pathname = y.pathname; | |
if (A.search = y.search, A.query = y.query, A.host = y.host || "", A.auth = y.auth, A.hostname = y.hostname || y.host, A.port = y.port, A.pathname || A.search) { | |
var ee = A.pathname || "", | |
z = A.search || ""; | |
A.path = ee + z; | |
} | |
return A.slashes = A.slashes || y.slashes, A.href = A.format(), A; | |
} | |
var le = A.pathname && A.pathname.charAt(0) === "/", | |
Q = y.host || y.pathname && y.pathname.charAt(0) === "/", | |
X = Q || le || A.host && y.pathname, | |
_e = X, | |
Y = A.pathname && A.pathname.split("/") || [], | |
re = y.pathname && y.pathname.split("/") || [], | |
ge = A.protocol && !v[A.protocol]; | |
if (ge && (A.hostname = "", A.port = null, A.host && (Y[0] === "" ? Y[0] = A.host : Y.unshift(A.host)), A.host = "", y.protocol && (y.hostname = null, y.port = null, y.host && (re[0] === "" ? re[0] = y.host : re.unshift(y.host)), y.host = null), X = X && (re[0] === "" || Y[0] === "")), Q) A.host = y.host || y.host === "" ? y.host : A.host, A.hostname = y.hostname || y.hostname === "" ? y.hostname : A.hostname, A.search = y.search, A.query = y.query, Y = re;else if (re.length) Y || (Y = []), Y.pop(), Y = Y.concat(re), A.search = y.search, A.query = y.query;else if (y.search != null) { | |
if (ge) { | |
A.host = Y.shift(), A.hostname = A.host; | |
var ve = A.host && A.host.indexOf("@") > 0 ? A.host.split("@") : !1; | |
ve && (A.auth = ve.shift(), A.hostname = ve.shift(), A.host = A.hostname); | |
} | |
return A.search = y.search, A.query = y.query, (A.pathname !== null || A.search !== null) && (A.path = (A.pathname ? A.pathname : "") + (A.search ? A.search : "")), A.href = A.format(), A; | |
} | |
if (!Y.length) return A.pathname = null, A.search ? A.path = "/" + A.search : A.path = null, A.href = A.format(), A; | |
for (var me = Y.slice(-1)[0], Me = (A.host || y.host || Y.length > 1) && (me === "." || me === "..") || me === "", Te = 0, Re = Y.length; Re >= 0; Re--) me = Y[Re], me === "." ? Y.splice(Re, 1) : me === ".." ? (Y.splice(Re, 1), Te++) : Te && (Y.splice(Re, 1), Te--); | |
if (!X && !_e) for (; Te--; Te) Y.unshift(".."); | |
X && Y[0] !== "" && (!Y[0] || Y[0].charAt(0) !== "/") && Y.unshift(""), Me && Y.join("/").substr(-1) !== "/" && Y.push(""); | |
var $e = Y[0] === "" || Y[0] && Y[0].charAt(0) === "/"; | |
if (ge) { | |
A.hostname = $e ? "" : Y.length ? Y.shift() : "", A.host = A.hostname; | |
var ve = A.host && A.host.indexOf("@") > 0 ? A.host.split("@") : !1; | |
ve && (A.auth = ve.shift(), A.hostname = ve.shift(), A.host = A.hostname); | |
} | |
return X = X || A.host && Y.length, X && !$e && Y.unshift(""), Y.length > 0 ? A.pathname = Y.join("/") : (A.pathname = null, A.path = null), (A.pathname !== null || A.search !== null) && (A.path = (A.pathname ? A.pathname : "") + (A.search ? A.search : "")), A.auth = y.auth || A.auth, A.slashes = A.slashes || y.slashes, A.href = A.format(), A; | |
}, e.prototype.parseHost = function () { | |
var y = this.host, | |
B = n.exec(y); | |
B && (B = B[0], B !== ":" && (this.port = B.substr(1)), y = y.substr(0, y.length - B.length)), y && (this.hostname = y); | |
}, Ln.parse = p, Ln.resolve = x, Ln.resolveObject = I, Ln.format = _, Ln.Url = e, Ln; | |
} | |
function Nw(t) { | |
if (typeof t == "string") t = new URL(t);else if (!(t instanceof URL)) throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL"); | |
if (t.protocol !== "file:") throw new Deno.errors.InvalidData("invalid url scheme"); | |
return ff ? CT(t) : kT(t); | |
} | |
function CT(t) { | |
var e = t.hostname, | |
r = t.pathname; | |
for (var n = 0; n < r.length; n++) if (r[n] === "%") { | |
var i = r.codePointAt(n + 2) || 32; | |
if (r[n + 1] === "2" && i === 102 || r[n + 1] === "5" && i === 99) throw new Deno.errors.InvalidData("must not include encoded \\ or / characters"); | |
} | |
if (r = r.replace(TT, "\\"), r = decodeURIComponent(r), e !== "") return "\\\\".concat(e).concat(r); | |
{ | |
var _n13 = r.codePointAt(1) | 32, | |
_i10 = r[2]; | |
if (_n13 < AT || _n13 > IT || _i10 !== ":") throw new Deno.errors.InvalidData("file url path must be absolute"); | |
return r.slice(1); | |
} | |
} | |
function kT(t) { | |
if (t.hostname !== "") throw new Deno.errors.InvalidData("invalid file url hostname"); | |
var e = t.pathname; | |
for (var _r40 = 0; _r40 < e.length; _r40++) if (e[_r40] === "%") { | |
var n = e.codePointAt(_r40 + 2) || 32; | |
if (e[_r40 + 1] === "2" && n === 102) throw new Deno.errors.InvalidData("must not include encoded / characters"); | |
} | |
return decodeURIComponent(e); | |
} | |
function Lw(t) { | |
var e = ef.resolve(t), | |
r = t.charCodeAt(t.length - 1); | |
(r === ET || ff && r === ST) && e[e.length - 1] !== ef.sep && (e += "/"); | |
var n = new URL("file://"); | |
return e.includes("%") && (e = e.replace(PT, "%25")), !ff && e.includes("\\") && (e = e.replace(RT, "%5C")), e.includes("\n") && (e = e.replace(OT, "%0A")), e.includes("\r") && (e = e.replace(xT, "%0D")), e.includes(" ") && (e = e.replace(BT, "%09")), n.pathname = e, n; | |
} | |
var uT, | |
tf, | |
Tw, | |
rf, | |
nf, | |
Pw, | |
of, | |
Rw, | |
sf, | |
Ow, | |
af, | |
xw, | |
uf, | |
Bw, | |
lf, | |
Cw, | |
Ln, | |
kw, | |
yt, | |
yT, | |
gT, | |
wT, | |
bT, | |
_T, | |
mT, | |
vT, | |
ST, | |
ET, | |
AT, | |
IT, | |
ff, | |
TT, | |
PT, | |
RT, | |
OT, | |
xT, | |
BT, | |
Uw = rt(function () { | |
P(); | |
O(); | |
R(); | |
Yg(); | |
vw(); | |
Iw(); | |
Xl(); | |
uT = Object.freeze(Object.create(null)), tf = {}, Tw = !1, rf = typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : global; | |
nf = {}, Pw = !1; | |
of = {}, Rw = !1; | |
sf = {}, Ow = !1; | |
af = {}, xw = !1; | |
uf = {}, Bw = !1; | |
lf = {}, Cw = !1; | |
Ln = {}, kw = !1; | |
yt = pT(); | |
yt.parse; | |
yt.resolve; | |
yt.resolveObject; | |
yt.format; | |
yt.Url; | |
yT = typeof Deno != "undefined" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0; | |
yt.URL = typeof URL != "undefined" ? URL : null; | |
yt.pathToFileURL = Lw; | |
yt.fileURLToPath = Nw; | |
gT = yt.Url, wT = yt.format, bT = yt.resolve, _T = yt.resolveObject, mT = yt.parse, vT = yt.URL, ST = 92, ET = 47, AT = 97, IT = 122, ff = yT === "win32", TT = /\//g, PT = /%/g, RT = /\\/g, OT = /\n/g, xT = /\r/g, BT = /\t/g; | |
}); | |
var Fw = H(function (tF, Dw) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Dw.exports = function () { | |
throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object"); | |
}; | |
}); | |
var ao = H(function (qn) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var MT = qn && qn.__extends || function () { | |
var _t8 = function t(e, r) { | |
return _t8 = Object.setPrototypeOf || { | |
__proto__: [] | |
} instanceof Array && function (n, i) { | |
n.__proto__ = i; | |
} || function (n, i) { | |
for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (n[s] = i[s]); | |
}, _t8(e, r); | |
}; | |
return function (e, r) { | |
if (typeof r != "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); | |
_t8(e, r); | |
function n() { | |
this.constructor = e; | |
} | |
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n()); | |
}; | |
}(); | |
Object.defineProperty(qn, "__esModule", { | |
value: !0 | |
}); | |
qn.BufferedDuplex = void 0; | |
qn.writev = Ww; | |
var NT = Tr(), | |
jw = (ze(), Ie(Je)); | |
function Ww(t, e) { | |
for (var r = new Array(t.length), n = 0; n < t.length; n++) typeof t[n].chunk == "string" ? r[n] = jw.Buffer.from(t[n].chunk, "utf8") : r[n] = t[n].chunk; | |
this._write(jw.Buffer.concat(r), "binary", e); | |
} | |
var LT = function (t) { | |
MT(e, t); | |
function e(r, n, i) { | |
var s = t.call(this, { | |
objectMode: !0 | |
}) || this; | |
return s.proxy = n, s.socket = i, s.writeQueue = [], r.objectMode || (s._writev = Ww.bind(s)), s.isSocketOpen = !1, s.proxy.on("data", function (o) { | |
s.destroyed || s.push(o); | |
}), s; | |
} | |
return e.prototype._read = function (r) { | |
this.proxy.read(r); | |
}, e.prototype._write = function (r, n, i) { | |
this.isSocketOpen ? this.writeToProxy(r, n, i) : this.writeQueue.push({ | |
chunk: r, | |
encoding: n, | |
cb: i | |
}); | |
}, e.prototype._final = function (r) { | |
this.writeQueue = [], this.proxy.end(r); | |
}, e.prototype._destroy = function (r, n) { | |
this.writeQueue = [], this.proxy.destroy(), n(r); | |
}, e.prototype.socketReady = function () { | |
this.emit("connect"), this.isSocketOpen = !0, this.processWriteQueue(); | |
}, e.prototype.writeToProxy = function (r, n, i) { | |
this.proxy.write(r, n) === !1 ? this.proxy.once("drain", i) : i(); | |
}, e.prototype.processWriteQueue = function () { | |
for (; this.writeQueue.length > 0;) { | |
var r = this.writeQueue.shift(), | |
n = r.chunk, | |
i = r.encoding, | |
s = r.cb; | |
this.writeToProxy(n, i, s); | |
} | |
}, e; | |
}(NT.Duplex); | |
qn.BufferedDuplex = LT; | |
}); | |
var uo = H(function (Nt) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var qT = Nt && Nt.__awaiter || function (t, e, r, n) { | |
function i(s) { | |
return s instanceof r ? s : new r(function (o) { | |
o(s); | |
}); | |
} | |
return new (r || (r = Promise))(function (s, o) { | |
function a(d) { | |
try { | |
c(n.next(d)); | |
} catch (h) { | |
o(h); | |
} | |
} | |
function l(d) { | |
try { | |
c(n["throw"](d)); | |
} catch (h) { | |
o(h); | |
} | |
} | |
function c(d) { | |
d.done ? s(d.value) : i(d.value).then(a, l); | |
} | |
c((n = n.apply(t, e || [])).next()); | |
}); | |
}, | |
UT = Nt && Nt.__generator || function (t, e) { | |
var r = { | |
label: 0, | |
sent: function sent() { | |
if (s[0] & 1) throw s[1]; | |
return s[1]; | |
}, | |
trys: [], | |
ops: [] | |
}, | |
n, | |
i, | |
s, | |
o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype); | |
return o.next = a(0), o["throw"] = a(1), o["return"] = a(2), typeof Symbol == "function" && (o[Symbol.iterator] = function () { | |
return this; | |
}), o; | |
function a(c) { | |
return function (d) { | |
return l([c, d]); | |
}; | |
} | |
function l(c) { | |
if (n) throw new TypeError("Generator is already executing."); | |
for (; o && (o = 0, c[0] && (r = 0)), r;) try { | |
if (n = 1, i && (s = c[0] & 2 ? i["return"] : c[0] ? i["throw"] || ((s = i["return"]) && s.call(i), 0) : i.next) && !(s = s.call(i, c[1])).done) return s; | |
switch (i = 0, s && (c = [c[0] & 2, s.value]), c[0]) { | |
case 0: | |
case 1: | |
s = c; | |
break; | |
case 4: | |
return r.label++, { | |
value: c[1], | |
done: !1 | |
}; | |
case 5: | |
r.label++, i = c[1], c = [0]; | |
continue; | |
case 7: | |
c = r.ops.pop(), r.trys.pop(); | |
continue; | |
default: | |
if (s = r.trys, !(s = s.length > 0 && s[s.length - 1]) && (c[0] === 6 || c[0] === 2)) { | |
r = 0; | |
continue; | |
} | |
if (c[0] === 3 && (!s || c[1] > s[0] && c[1] < s[3])) { | |
r.label = c[1]; | |
break; | |
} | |
if (c[0] === 6 && r.label < s[1]) { | |
r.label = s[1], s = c; | |
break; | |
} | |
if (s && r.label < s[2]) { | |
r.label = s[2], r.ops.push(c); | |
break; | |
} | |
s[2] && r.ops.pop(), r.trys.pop(); | |
continue; | |
} | |
c = e.call(t, r); | |
} catch (d) { | |
c = [6, d], i = 0; | |
} finally { | |
n = s = 0; | |
} | |
if (c[0] & 5) throw c[1]; | |
return { | |
value: c[0] ? c[1] : void 0, | |
done: !0 | |
}; | |
} | |
}, | |
df = Nt && Nt.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(Nt, "__esModule", { | |
value: !0 | |
}); | |
Nt.streamBuilder = Nt.browserStreamBuilder = void 0; | |
var Ws = (ze(), Ie(Je)), | |
$w = df(Fw()), | |
DT = df(sr()), | |
FT = Tr(), | |
jT = df(io()), | |
hf = ao(), | |
tn = (0, DT["default"])("mqttjs:ws"), | |
WT = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"]; | |
function Hw(t, e) { | |
var r = "".concat(t.protocol, "://").concat(t.hostname, ":").concat(t.port).concat(t.path); | |
return typeof t.transformWsUrl == "function" && (r = t.transformWsUrl(r, t, e)), r; | |
} | |
function Vw(t) { | |
var e = t; | |
return t.port || (t.protocol === "wss" ? e.port = 443 : e.port = 80), t.path || (e.path = "/"), t.wsOptions || (e.wsOptions = {}), !jT["default"] && !t.forceNativeWebSocket && t.protocol === "wss" && WT.forEach(function (r) { | |
Object.prototype.hasOwnProperty.call(t, r) && !Object.prototype.hasOwnProperty.call(t.wsOptions, r) && (e.wsOptions[r] = t[r]); | |
}), e; | |
} | |
function $T(t) { | |
var e = Vw(t); | |
if (e.hostname || (e.hostname = e.host), !e.hostname) { | |
if (typeof document == "undefined") throw new Error("Could not determine host. Specify host manually."); | |
var r = new URL(document.URL); | |
e.hostname = r.hostname, e.port || (e.port = Number(r.port)); | |
} | |
return e.objectMode === void 0 && (e.objectMode = !(e.binary === !0 || e.binary === void 0)), e; | |
} | |
function HT(t, e, r) { | |
tn("createWebSocket"), tn("protocol: ".concat(r.protocolId, " ").concat(r.protocolVersion)); | |
var n = r.protocolId === "MQIsdp" && r.protocolVersion === 3 ? "mqttv3.1" : "mqtt"; | |
tn("creating new Websocket for url: ".concat(e, " and protocol: ").concat(n)); | |
var i; | |
return r.createWebsocket ? i = r.createWebsocket(e, [n], r) : i = new $w["default"](e, [n], r.wsOptions), i; | |
} | |
function VT(t, e) { | |
var r = e.protocolId === "MQIsdp" && e.protocolVersion === 3 ? "mqttv3.1" : "mqtt", | |
n = Hw(e, t), | |
i; | |
return e.createWebsocket ? i = e.createWebsocket(n, [r], e) : i = new WebSocket(n, [r]), i.binaryType = "arraybuffer", i; | |
} | |
var zT = function zT(t, e) { | |
tn("streamBuilder"); | |
var r = Vw(e); | |
r.hostname = r.hostname || r.host || "localhost"; | |
var n = Hw(r, t), | |
i = HT(t, n, r), | |
s = $w["default"].createWebSocketStream(i, r.wsOptions); | |
return s.url = n, i.on("close", function () { | |
s.destroy(); | |
}), s; | |
}; | |
Nt.streamBuilder = zT; | |
var KT = function KT(t, e) { | |
tn("browserStreamBuilder"); | |
var r, | |
n = $T(e), | |
i = n.browserBufferSize || 1024 * 512, | |
s = e.browserBufferTimeout || 1e3, | |
o = !e.objectMode, | |
a = VT(t, e), | |
l = d(e, v, b); | |
e.objectMode || (l._writev = hf.writev.bind(l)), l.on("close", function () { | |
a.close(); | |
}); | |
var c = typeof a.addEventListener != "undefined"; | |
a.readyState === a.OPEN ? (r = l, r.socket = a) : (r = new hf.BufferedDuplex(e, l, a), c ? a.addEventListener("open", h) : a.onopen = h), c ? (a.addEventListener("close", m), a.addEventListener("error", w), a.addEventListener("message", T)) : (a.onclose = m, a.onerror = w, a.onmessage = T); | |
function d(p, _, x) { | |
var I = new FT.Transform({ | |
objectMode: p.objectMode | |
}); | |
return I._write = _, I._flush = x, I; | |
} | |
function h() { | |
tn("WebSocket onOpen"), r instanceof hf.BufferedDuplex && r.socketReady(); | |
} | |
function m(p) { | |
tn("WebSocket onClose", p), r.end(), r.destroy(); | |
} | |
function w(p) { | |
tn("WebSocket onError", p); | |
var _ = new Error("WebSocket error"); | |
_.event = p, r.destroy(_); | |
} | |
function T(p) { | |
return qT(this, void 0, void 0, function () { | |
var _, x, I; | |
return UT(this, function (y) { | |
switch (y.label) { | |
case 0: | |
return _ = p.data, _ instanceof ArrayBuffer ? (_ = Ws.Buffer.from(_), [3, 4]) : [3, 1]; | |
case 1: | |
return _ instanceof Blob ? (I = (x = Ws.Buffer).from, [4, new Response(_).arrayBuffer()]) : [3, 3]; | |
case 2: | |
return _ = I.apply(x, [y.sent()]), [3, 4]; | |
case 3: | |
_ = Ws.Buffer.from(_, "utf8"), y.label = 4; | |
case 4: | |
return l && !l.destroyed && l.push(_), [2]; | |
} | |
}); | |
}); | |
} | |
function v(p, _, x) { | |
if (a.bufferedAmount > i) { | |
setTimeout(v, s, p, _, x); | |
return; | |
} | |
o && typeof p == "string" && (p = Ws.Buffer.from(p, "utf8")); | |
try { | |
a.send(p); | |
} catch (I) { | |
return x(I); | |
} | |
x(); | |
} | |
function b(p) { | |
a.close(), p(); | |
} | |
return r; | |
}; | |
Nt.browserStreamBuilder = KT; | |
}); | |
var pf = {}; | |
on(pf, { | |
Server: function Server() { | |
return It; | |
}, | |
Socket: function Socket() { | |
return It; | |
}, | |
Stream: function Stream() { | |
return It; | |
}, | |
_createServerHandle: function _createServerHandle() { | |
return It; | |
}, | |
_normalizeArgs: function _normalizeArgs() { | |
return It; | |
}, | |
_setSimultaneousAccepts: function _setSimultaneousAccepts() { | |
return It; | |
}, | |
connect: function connect() { | |
return It; | |
}, | |
createConnection: function createConnection() { | |
return It; | |
}, | |
createServer: function createServer() { | |
return It; | |
}, | |
"default": function _default() { | |
return GT; | |
}, | |
isIP: function isIP() { | |
return It; | |
}, | |
isIPv4: function isIPv4() { | |
return It; | |
}, | |
isIPv6: function isIPv6() { | |
return It; | |
} | |
}); | |
function It() { | |
throw new Error("Node.js net module is not supported by JSPM core outside of Node.js"); | |
} | |
var GT, | |
yf = rt(function () { | |
P(); | |
O(); | |
R(); | |
GT = { | |
_createServerHandle: It, | |
_normalizeArgs: It, | |
_setSimultaneousAccepts: It, | |
connect: It, | |
createConnection: It, | |
createServer: It, | |
isIP: It, | |
isIPv4: It, | |
isIPv6: It, | |
Server: It, | |
Socket: It, | |
Stream: It | |
}; | |
}); | |
var gf = H(function (lo) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var zw = lo && lo.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(lo, "__esModule", { | |
value: !0 | |
}); | |
var QT = zw((yf(), Ie(pf))), | |
YT = zw(sr()), | |
JT = (0, YT["default"])("mqttjs:tcp"), | |
XT = function XT(t, e) { | |
e.port = e.port || 1883, e.hostname = e.hostname || e.host || "localhost"; | |
var r = e.port, | |
n = e.path, | |
i = e.hostname; | |
return JT("port %d and host %s", r, i), QT["default"].createConnection({ | |
port: r, | |
host: i, | |
path: n | |
}); | |
}; | |
lo["default"] = XT; | |
}); | |
var Kw = {}; | |
on(Kw, { | |
"default": function _default() { | |
return ZT; | |
} | |
}); | |
var ZT, | |
Gw = rt(function () { | |
P(); | |
O(); | |
R(); | |
ZT = {}; | |
}); | |
var bf = H(function (fo) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var wf = fo && fo.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(fo, "__esModule", { | |
value: !0 | |
}); | |
var eP = wf((Gw(), Ie(Kw))), | |
tP = wf((yf(), Ie(pf))), | |
rP = wf(sr()), | |
nP = (0, rP["default"])("mqttjs:tls"), | |
iP = function iP(t, e) { | |
e.port = e.port || 8883, e.host = e.hostname || e.host || "localhost", tP["default"].isIP(e.host) === 0 && (e.servername = e.host), e.rejectUnauthorized = e.rejectUnauthorized !== !1, delete e.path, nP("port %d host %s rejectUnauthorized %b", e.port, e.host, e.rejectUnauthorized); | |
var r = eP["default"].connect(e); | |
r.on("secureConnect", function () { | |
e.rejectUnauthorized && !r.authorized ? r.emit("error", new Error("TLS not authorized")) : r.removeListener("error", n); | |
}); | |
function n(i) { | |
e.rejectUnauthorized && t.emit("error", i), r.end(); | |
} | |
return r.on("error", n), r; | |
}; | |
fo["default"] = iP; | |
}); | |
var vf = H(function (mf) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(mf, "__esModule", { | |
value: !0 | |
}); | |
var Qw = (ze(), Ie(Je)), | |
oP = Tr(), | |
sP = ao(), | |
yr, | |
_f, | |
Tt; | |
function aP() { | |
var t = new oP.Transform(); | |
return t._write = function (e, r, n) { | |
yr.send({ | |
data: e.buffer, | |
success: function success() { | |
n(); | |
}, | |
fail: function fail(i) { | |
n(new Error(i)); | |
} | |
}); | |
}, t._flush = function (e) { | |
yr.close({ | |
success: function success() { | |
e(); | |
} | |
}); | |
}, t; | |
} | |
function uP(t) { | |
t.hostname || (t.hostname = "localhost"), t.path || (t.path = "/"), t.wsOptions || (t.wsOptions = {}); | |
} | |
function lP(t, e) { | |
var r = t.protocol === "wxs" ? "wss" : "ws", | |
n = "".concat(r, "://").concat(t.hostname).concat(t.path); | |
return t.port && t.port !== 80 && t.port !== 443 && (n = "".concat(r, "://").concat(t.hostname, ":").concat(t.port).concat(t.path)), typeof t.transformWsUrl == "function" && (n = t.transformWsUrl(n, t, e)), n; | |
} | |
function fP() { | |
yr.onOpen(function () { | |
Tt.socketReady(); | |
}), yr.onMessage(function (t) { | |
var e = t.data; | |
e instanceof ArrayBuffer ? e = Qw.Buffer.from(e) : e = Qw.Buffer.from(e, "utf8"), _f.push(e); | |
}), yr.onClose(function () { | |
Tt.emit("close"), Tt.end(), Tt.destroy(); | |
}), yr.onError(function (t) { | |
var e = new Error(t.errMsg); | |
Tt.destroy(e); | |
}); | |
} | |
var cP = function cP(t, e) { | |
if (e.hostname = e.hostname || e.host, !e.hostname) throw new Error("Could not determine host. Specify host manually."); | |
var r = e.protocolId === "MQIsdp" && e.protocolVersion === 3 ? "mqttv3.1" : "mqtt"; | |
uP(e); | |
var n = lP(e, t); | |
yr = wx.connectSocket({ | |
url: n, | |
protocols: [r] | |
}), _f = aP(), Tt = new sP.BufferedDuplex(e, _f, yr), Tt._destroy = function (s, o) { | |
yr.close({ | |
success: function success() { | |
o && o(s); | |
} | |
}); | |
}; | |
var i = Tt.destroy; | |
return Tt.destroy = function (s, o) { | |
return Tt.destroy = i, setTimeout(function () { | |
yr.close({ | |
fail: function fail() { | |
Tt._destroy(s, o); | |
} | |
}); | |
}, 0), Tt; | |
}, fP(), Tt; | |
}; | |
mf["default"] = cP; | |
}); | |
var Af = H(function (Ef) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Ef, "__esModule", { | |
value: !0 | |
}); | |
var Sf = (ze(), Ie(Je)), | |
hP = Tr(), | |
dP = ao(), | |
xr, | |
$s, | |
Ei, | |
Yw = !1; | |
function pP() { | |
var t = new hP.Transform(); | |
return t._write = function (e, r, n) { | |
xr.sendSocketMessage({ | |
data: e.buffer, | |
success: function success() { | |
n(); | |
}, | |
fail: function fail() { | |
n(new Error()); | |
} | |
}); | |
}, t._flush = function (e) { | |
xr.closeSocket({ | |
success: function success() { | |
e(); | |
} | |
}); | |
}, t; | |
} | |
function yP(t) { | |
t.hostname || (t.hostname = "localhost"), t.path || (t.path = "/"), t.wsOptions || (t.wsOptions = {}); | |
} | |
function gP(t, e) { | |
var r = t.protocol === "alis" ? "wss" : "ws", | |
n = "".concat(r, "://").concat(t.hostname).concat(t.path); | |
return t.port && t.port !== 80 && t.port !== 443 && (n = "".concat(r, "://").concat(t.hostname, ":").concat(t.port).concat(t.path)), typeof t.transformWsUrl == "function" && (n = t.transformWsUrl(n, t, e)), n; | |
} | |
function wP() { | |
Yw || (Yw = !0, xr.onSocketOpen(function () { | |
Ei.socketReady(); | |
}), xr.onSocketMessage(function (t) { | |
if (typeof t.data == "string") { | |
var e = Sf.Buffer.from(t.data, "base64"); | |
$s.push(e); | |
} else { | |
var r = new FileReader(); | |
r.addEventListener("load", function () { | |
var n = r.result; | |
n instanceof ArrayBuffer ? n = Sf.Buffer.from(n) : n = Sf.Buffer.from(n, "utf8"), $s.push(n); | |
}), r.readAsArrayBuffer(t.data); | |
} | |
}), xr.onSocketClose(function () { | |
Ei.end(), Ei.destroy(); | |
}), xr.onSocketError(function (t) { | |
Ei.destroy(t); | |
})); | |
} | |
var bP = function bP(t, e) { | |
if (e.hostname = e.hostname || e.host, !e.hostname) throw new Error("Could not determine host. Specify host manually."); | |
var r = e.protocolId === "MQIsdp" && e.protocolVersion === 3 ? "mqttv3.1" : "mqtt"; | |
yP(e); | |
var n = gP(e, t); | |
return xr = e.my, xr.connectSocket({ | |
url: n, | |
protocols: r | |
}), $s = pP(), Ei = new dP.BufferedDuplex(e, $s, xr), wP(), Ei; | |
}; | |
Ef["default"] = bP; | |
}); | |
var Pf = H(function (Tf) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
Object.defineProperty(Tf, "__esModule", { | |
value: !0 | |
}); | |
var If = (ze(), Ie(Je)), | |
_P = Tr(), | |
mP = ao(), | |
Br, | |
Hs, | |
Un, | |
Jw = !1; | |
function vP() { | |
var t = new _P.Transform(); | |
return t._write = function (e, r, n) { | |
Br.sendSocketMessage({ | |
data: If.Buffer.from(e.buffer).toString("base64"), | |
isBuffer: !0, | |
success: function success() { | |
n(); | |
}, | |
fail: function fail(i) { | |
n(new Error()); | |
} | |
}); | |
}, t._flush = function (e) { | |
Br.closeSocket({}); | |
}, t; | |
} | |
function SP(t) { | |
t.hostname || (t.hostname = "localhost"), t.path || (t.path = "/"), t.wsOptions || (t.wsOptions = {}), t.protocol = "wss"; | |
} | |
function EP(t, e) { | |
var r = t.protocol === "dds" ? "wss" : "ws", | |
n = "".concat(r, "://").concat(t.hostname).concat(t.path); | |
return t.port && t.port !== 80 && t.port !== 443 && (n = "".concat(r, "://").concat(t.hostname, ":").concat(t.port).concat(t.path)), typeof t.transformWsUrl == "function" && (n = t.transformWsUrl(n, t, e)), n; | |
} | |
function AP() { | |
Jw || (Jw = !0, Br.onSocketOpen(function () { | |
Un.socketReady(); | |
}), Br.onSocketMessage(function (t) { | |
t.isBuffer ? Hs.push(If.Buffer.from(t.data, "base64")) : Hs.push(If.Buffer.from(t.data, "utf8")); | |
}), Br.onSocketClose(function () { | |
Un.emit("close"), Un.end(), Un.destroy(); | |
}), Br.onSocketError(function (t) { | |
Un.destroy(t); | |
})); | |
} | |
var IP = function IP(t, e) { | |
if (e.hostname = e.hostname || e.host, !e.hostname) throw new Error("Could not determine host. Specify host manually."); | |
var r = e.protocolId === "MQIsdp" && e.protocolVersion === 3 ? "mqttv3.1" : "mqtt"; | |
SP(e); | |
var n = EP(e, t); | |
return Br = e.my, Br.connectSocket({ | |
url: n, | |
protocols: r | |
}), Hs = vP(), Un = new mP.BufferedDuplex(e, Hs, Br), AP(), Un; | |
}; | |
Tf["default"] = IP; | |
}); | |
var eb = H(function (rn) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var Vs = rn && rn.__assign || function () { | |
return Vs = Object.assign || function (t) { | |
for (var e, r = 1, n = arguments.length; r < n; r++) { | |
e = arguments[r]; | |
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); | |
} | |
return t; | |
}, Vs.apply(this, arguments); | |
}, | |
zs = rn && rn.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(rn, "__esModule", { | |
value: !0 | |
}); | |
rn.connectAsync = BP; | |
var TP = zs(sr()), | |
PP = zs((Uw(), Ie(qw))), | |
RP = zs(Fs()), | |
OP = zs(io()); | |
typeof (L === null || L === void 0 ? void 0 : L.nextTick) != "function" && (L.nextTick = setImmediate); | |
var Xw = (0, TP["default"])("mqttjs"), | |
We = null; | |
function xP(t) { | |
var e; | |
t.auth && (e = t.auth.match(/^(.+):(.+)$/), e ? (t.username = e[1], t.password = e[2]) : t.username = t.auth); | |
} | |
function Zw(t, e) { | |
var r, n, i, s; | |
if (Xw("connecting to an MQTT broker..."), _typeof(t) == "object" && !e && (e = t, t = ""), e = e || {}, t && typeof t == "string") { | |
var o = PP["default"].parse(t, !0), | |
a = {}; | |
if (o.port != null && (a.port = Number(o.port)), a.host = o.hostname, a.query = o.query, a.auth = o.auth, a.protocol = o.protocol, a.path = o.path, a.protocol = (r = a.protocol) === null || r === void 0 ? void 0 : r.replace(/:$/, ""), e = Vs(Vs({}, a), e), !e.protocol) throw new Error("Missing protocol"); | |
} | |
if (e.unixSocket = e.unixSocket || ((n = e.protocol) === null || n === void 0 ? void 0 : n.includes("+unix")), e.unixSocket ? e.protocol = e.protocol.replace("+unix", "") : !(!((i = e.protocol) === null || i === void 0) && i.startsWith("ws")) && !(!((s = e.protocol) === null || s === void 0) && s.startsWith("wx")) && delete e.path, xP(e), e.query && typeof e.query.clientId == "string" && (e.clientId = e.query.clientId), e.cert && e.key) if (e.protocol) { | |
if (["mqtts", "wss", "wxs", "alis", "dds"].indexOf(e.protocol) === -1) switch (e.protocol) { | |
case "mqtt": | |
e.protocol = "mqtts"; | |
break; | |
case "ws": | |
e.protocol = "wss"; | |
break; | |
case "wx": | |
e.protocol = "wxs"; | |
break; | |
case "ali": | |
e.protocol = "alis"; | |
break; | |
case "dd": | |
e.protocol = "dds"; | |
break; | |
default: | |
throw new Error('Unknown protocol for secure connection: "'.concat(e.protocol, '"!')); | |
} | |
} else throw new Error("Missing secure protocol key"); | |
if (We || (We = {}, !OP["default"] && !e.forceNativeWebSocket ? (We.ws = uo().streamBuilder, We.wss = uo().streamBuilder, We.mqtt = gf()["default"], We.tcp = gf()["default"], We.ssl = bf()["default"], We.tls = We.ssl, We.mqtts = bf()["default"]) : (We.ws = uo().browserStreamBuilder, We.wss = uo().browserStreamBuilder, We.wx = vf()["default"], We.wxs = vf()["default"], We.ali = Af()["default"], We.alis = Af()["default"], We.dd = Pf()["default"], We.dds = Pf()["default"])), !We[e.protocol]) { | |
var l = ["mqtts", "wss"].indexOf(e.protocol) !== -1; | |
e.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs", "ali", "alis", "dd", "dds"].filter(function (h, m) { | |
return l && m % 2 === 0 ? !1 : typeof We[h] == "function"; | |
})[0]; | |
} | |
if (e.clean === !1 && !e.clientId) throw new Error("Missing clientId for unclean clients"); | |
e.protocol && (e.defaultProtocol = e.protocol); | |
function c(h) { | |
return e.servers && ((!h._reconnectCount || h._reconnectCount === e.servers.length) && (h._reconnectCount = 0), e.host = e.servers[h._reconnectCount].host, e.port = e.servers[h._reconnectCount].port, e.protocol = e.servers[h._reconnectCount].protocol ? e.servers[h._reconnectCount].protocol : e.defaultProtocol, e.hostname = e.host, h._reconnectCount++), Xw("calling streambuilder for", e.protocol), We[e.protocol](h, e); | |
} | |
var d = new RP["default"](c, e); | |
return d.on("error", function () {}), d; | |
} | |
function BP(t, e, r) { | |
return r === void 0 && (r = !0), new Promise(function (n, i) { | |
var s = Zw(t, e), | |
o = { | |
connect: function connect(l) { | |
a(), n(s); | |
}, | |
end: function end() { | |
a(), n(s); | |
}, | |
error: function error(l) { | |
a(), s.end(), i(l); | |
} | |
}; | |
r === !1 && (o.close = function () { | |
o.error(new Error("Couldn't connect to server")); | |
}); | |
function a() { | |
Object.keys(o).forEach(function (l) { | |
s.off(l, o[l]); | |
}); | |
} | |
Object.keys(o).forEach(function (l) { | |
s.on(l, o[l]); | |
}); | |
}); | |
} | |
rn["default"] = Zw; | |
}); | |
var Rf = H(function (Se) { | |
"use strict"; | |
P(); | |
O(); | |
R(); | |
var tb = Se && Se.__createBinding || (Object.create ? function (t, e, r, n) { | |
n === void 0 && (n = r); | |
var i = Object.getOwnPropertyDescriptor(e, r); | |
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { | |
enumerable: !0, | |
get: function get() { | |
return e[r]; | |
} | |
}), Object.defineProperty(t, n, i); | |
} : function (t, e, r, n) { | |
n === void 0 && (n = r), t[n] = e[r]; | |
}), | |
CP = Se && Se.__setModuleDefault || (Object.create ? function (t, e) { | |
Object.defineProperty(t, "default", { | |
enumerable: !0, | |
value: e | |
}); | |
} : function (t, e) { | |
t["default"] = e; | |
}), | |
kP = Se && Se.__importStar || function () { | |
var _t9 = function t(e) { | |
return _t9 = Object.getOwnPropertyNames || function (r) { | |
var n = []; | |
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[n.length] = i); | |
return n; | |
}, _t9(e); | |
}; | |
return function (e) { | |
if (e && e.__esModule) return e; | |
var r = {}; | |
if (e != null) for (var n = _t9(e), i = 0; i < n.length; i++) n[i] !== "default" && tb(r, e, n[i]); | |
return CP(r, e), r; | |
}; | |
}(), | |
rb = Se && Se.__exportStar || function (t, e) { | |
for (var r in t) r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && tb(e, t, r); | |
}, | |
co = Se && Se.__importDefault || function (t) { | |
return t && t.__esModule ? t : { | |
"default": t | |
}; | |
}; | |
Object.defineProperty(Se, "__esModule", { | |
value: !0 | |
}); | |
Se.ReasonCodes = Se.KeepaliveManager = Se.UniqueMessageIdProvider = Se.DefaultMessageIdProvider = Se.Store = Se.MqttClient = Se.connectAsync = Se.connect = Se.Client = void 0; | |
var nb = co(Fs()); | |
Se.MqttClient = nb["default"]; | |
var MP = co(Bu()); | |
Se.DefaultMessageIdProvider = MP["default"]; | |
var NP = co(Gg()); | |
Se.UniqueMessageIdProvider = NP["default"]; | |
var LP = co(Cu()); | |
Se.Store = LP["default"]; | |
var ib = kP(eb()); | |
Se.connect = ib["default"]; | |
Object.defineProperty(Se, "connectAsync", { | |
enumerable: !0, | |
get: function get() { | |
return ib.connectAsync; | |
} | |
}); | |
var qP = co(_l()); | |
Se.KeepaliveManager = qP["default"]; | |
Se.Client = nb["default"]; | |
rb(Fs(), Se); | |
rb(vn(), Se); | |
var UP = zi(); | |
Object.defineProperty(Se, "ReasonCodes", { | |
enumerable: !0, | |
get: function get() { | |
return UP.ReasonCodes; | |
} | |
}); | |
}); | |
P(); | |
O(); | |
R(); | |
var ob = exports && exports.__createBinding || (Object.create ? function (t, e, r, n) { | |
n === void 0 && (n = r); | |
var i = Object.getOwnPropertyDescriptor(e, r); | |
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { | |
enumerable: !0, | |
get: function get() { | |
return e[r]; | |
} | |
}), Object.defineProperty(t, n, i); | |
} : function (t, e, r, n) { | |
n === void 0 && (n = r), t[n] = e[r]; | |
}), | |
DP = exports && exports.__setModuleDefault || (Object.create ? function (t, e) { | |
Object.defineProperty(t, "default", { | |
enumerable: !0, | |
value: e | |
}); | |
} : function (t, e) { | |
t["default"] = e; | |
}), | |
FP = exports && exports.__importStar || function () { | |
var _t10 = function t(e) { | |
return _t10 = Object.getOwnPropertyNames || function (r) { | |
var n = []; | |
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[n.length] = i); | |
return n; | |
}, _t10(e); | |
}; | |
return function (e) { | |
if (e && e.__esModule) return e; | |
var r = {}; | |
if (e != null) for (var n = _t10(e), i = 0; i < n.length; i++) n[i] !== "default" && ob(r, e, n[i]); | |
return DP(r, e), r; | |
}; | |
}(), | |
jP = exports && exports.__exportStar || function (t, e) { | |
for (var r in t) r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && ob(e, t, r); | |
}; | |
Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}); | |
var WP = FP(Rf()); | |
exports["default"] = WP; | |
jP(Rf(), exports); | |
/*! Bundled license information: | |
@jspm/core/nodelibs/browser/chunk-DtuTasat.js: | |
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *) | |
@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js: | |
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *) | |
*/ |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
module.exports = (() => { | |
var ys = Object.defineProperty; | |
var Kg = Object.getOwnPropertyDescriptor; | |
var Gg = Object.getOwnPropertyNames; | |
var Qg = Object.prototype.hasOwnProperty; | |
var _e = (t, e) => () => (t && (e = t((t = 0))), e); | |
var M = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), | |
Jt = (t, e) => { | |
for (var r in e) ys(t, r, { get: e[r], enumerable: !0 }); | |
}, | |
Yg = (t, e, r, i) => { | |
if ((e && typeof e == "object") || typeof e == "function") | |
for (let n of Gg(e)) | |
!Qg.call(t, n) && | |
n !== r && | |
ys(t, n, { | |
get: () => e[n], | |
enumerable: !(i = Kg(e, n)) || i.enumerable, | |
}); | |
return t; | |
}; | |
var X = (t) => Yg(ys({}, "__esModule", { value: !0 }), t); | |
var _ = _e(() => {}); | |
var B = {}; | |
Jt(B, { | |
_debugEnd: () => yu, | |
_debugProcess: () => gu, | |
_events: () => Ou, | |
_eventsCount: () => xu, | |
_exiting: () => Yl, | |
_fatalExceptions: () => cu, | |
_getActiveHandles: () => eu, | |
_getActiveRequests: () => Zl, | |
_kill: () => ru, | |
_linkedBinding: () => Gl, | |
_maxListeners: () => ku, | |
_preload_modules: () => Cu, | |
_rawDebug: () => zl, | |
_startProfilerIdleNotifier: () => bu, | |
_stopProfilerIdleNotifier: () => wu, | |
_tickCallback: () => pu, | |
abort: () => Eu, | |
addListener: () => Mu, | |
allowedNodeEnvironmentFlags: () => lu, | |
arch: () => xl, | |
argv: () => Ul, | |
argv0: () => Ru, | |
assert: () => uu, | |
binding: () => Fl, | |
chdir: () => Hl, | |
config: () => Jl, | |
cpuUsage: () => $i, | |
cwd: () => $l, | |
debugPort: () => Tu, | |
default: () => $u, | |
dlopen: () => Xl, | |
domain: () => Ql, | |
emit: () => Du, | |
emitWarning: () => jl, | |
env: () => Ll, | |
execArgv: () => Nl, | |
execPath: () => Iu, | |
exit: () => ou, | |
features: () => fu, | |
hasUncaughtExceptionCaptureCallback: () => du, | |
hrtime: () => Wi, | |
kill: () => su, | |
listeners: () => Wu, | |
memoryUsage: () => nu, | |
moduleLoadList: () => Kl, | |
nextTick: () => Pl, | |
off: () => Uu, | |
on: () => wt, | |
once: () => Lu, | |
openStdin: () => au, | |
pid: () => Su, | |
platform: () => Ml, | |
ppid: () => Au, | |
prependListener: () => ju, | |
prependOnceListener: () => Fu, | |
reallyExit: () => tu, | |
release: () => Vl, | |
removeAllListeners: () => qu, | |
removeListener: () => Nu, | |
resourceUsage: () => iu, | |
setSourceMapsEnabled: () => Bu, | |
setUncaughtExceptionCaptureCallback: () => hu, | |
stderr: () => mu, | |
stdin: () => vu, | |
stdout: () => _u, | |
title: () => Ol, | |
umask: () => Wl, | |
uptime: () => Pu, | |
version: () => ql, | |
versions: () => Dl, | |
}); | |
function _s(t) { | |
throw new Error( | |
"Node.js process " + | |
t + | |
" is not supported by JSPM core outside of Node.js", | |
); | |
} | |
function Jg() { | |
!Lr || | |
!Xt || | |
((Lr = !1), | |
Xt.length ? (bt = Xt.concat(bt)) : (Fi = -1), | |
bt.length && Bl()); | |
} | |
function Bl() { | |
if (!Lr) { | |
var t = setTimeout(Jg, 0); | |
Lr = !0; | |
for (var e = bt.length; e; ) { | |
for (Xt = bt, bt = []; ++Fi < e; ) Xt && Xt[Fi].run(); | |
(Fi = -1), (e = bt.length); | |
} | |
(Xt = null), (Lr = !1), clearTimeout(t); | |
} | |
} | |
function Pl(t) { | |
var e = new Array(arguments.length - 1); | |
if (arguments.length > 1) | |
for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; | |
bt.push(new kl(t, e)), bt.length === 1 && !Lr && setTimeout(Bl, 0); | |
} | |
function kl(t, e) { | |
(this.fun = t), (this.array = e); | |
} | |
function Ee() {} | |
function Gl(t) { | |
_s("_linkedBinding"); | |
} | |
function Xl(t) { | |
_s("dlopen"); | |
} | |
function Zl() { | |
return []; | |
} | |
function eu() { | |
return []; | |
} | |
function uu(t, e) { | |
if (!t) throw new Error(e || "assertion error"); | |
} | |
function du() { | |
return !1; | |
} | |
function Pu() { | |
return Lt.now() / 1e3; | |
} | |
function Wi(t) { | |
var e = Math.floor((Date.now() - Lt.now()) * 0.001), | |
r = Lt.now() * 0.001, | |
i = Math.floor(r) + e, | |
n = Math.floor((r % 1) * 1e9); | |
return ( | |
t && ((i = i - t[0]), (n = n - t[1]), n < 0 && (i--, (n += ws))), [i, n] | |
); | |
} | |
function wt() { | |
return $u; | |
} | |
function Wu(t) { | |
return []; | |
} | |
var bt, | |
Lr, | |
Xt, | |
Fi, | |
Ol, | |
xl, | |
Ml, | |
Ll, | |
Ul, | |
Nl, | |
ql, | |
Dl, | |
jl, | |
Fl, | |
Wl, | |
$l, | |
Hl, | |
Vl, | |
zl, | |
Kl, | |
Ql, | |
Yl, | |
Jl, | |
tu, | |
ru, | |
$i, | |
iu, | |
nu, | |
su, | |
ou, | |
au, | |
lu, | |
fu, | |
cu, | |
hu, | |
pu, | |
gu, | |
yu, | |
bu, | |
wu, | |
_u, | |
mu, | |
vu, | |
Eu, | |
Su, | |
Au, | |
Iu, | |
Tu, | |
Ru, | |
Cu, | |
Bu, | |
Lt, | |
bs, | |
ws, | |
ku, | |
Ou, | |
xu, | |
Mu, | |
Lu, | |
Uu, | |
Nu, | |
qu, | |
Du, | |
ju, | |
Fu, | |
$u, | |
Hu = _e(() => { | |
_(); | |
v(); | |
m(); | |
(bt = []), (Lr = !1), (Fi = -1); | |
kl.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
(Ol = "browser"), | |
(xl = "x64"), | |
(Ml = "browser"), | |
(Ll = { | |
PATH: "/usr/bin", | |
LANG: navigator.language + ".UTF-8", | |
PWD: "/", | |
HOME: "/home", | |
TMP: "/tmp", | |
}), | |
(Ul = ["/usr/bin/node"]), | |
(Nl = []), | |
(ql = "v16.8.0"), | |
(Dl = {}), | |
(jl = function (t, e) { | |
console.warn((e ? e + ": " : "") + t); | |
}), | |
(Fl = function (t) { | |
_s("binding"); | |
}), | |
(Wl = function (t) { | |
return 0; | |
}), | |
($l = function () { | |
return "/"; | |
}), | |
(Hl = function (t) {}), | |
(Vl = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }); | |
(zl = Ee), (Kl = []); | |
(Ql = {}), (Yl = !1), (Jl = {}); | |
(tu = Ee), | |
(ru = Ee), | |
($i = function () { | |
return {}; | |
}), | |
(iu = $i), | |
(nu = $i), | |
(su = Ee), | |
(ou = Ee), | |
(au = Ee), | |
(lu = {}); | |
(fu = { | |
inspector: !1, | |
debug: !1, | |
uv: !1, | |
ipv6: !1, | |
tls_alpn: !1, | |
tls_sni: !1, | |
tls_ocsp: !1, | |
tls: !1, | |
cached_builtins: !0, | |
}), | |
(cu = Ee), | |
(hu = Ee); | |
(pu = Ee), | |
(gu = Ee), | |
(yu = Ee), | |
(bu = Ee), | |
(wu = Ee), | |
(_u = void 0), | |
(mu = void 0), | |
(vu = void 0), | |
(Eu = Ee), | |
(Su = 2), | |
(Au = 1), | |
(Iu = "/bin/usr/node"), | |
(Tu = 9229), | |
(Ru = "node"), | |
(Cu = []), | |
(Bu = Ee), | |
(Lt = { | |
now: | |
typeof performance < "u" | |
? performance.now.bind(performance) | |
: void 0, | |
timing: typeof performance < "u" ? performance.timing : void 0, | |
}); | |
Lt.now === void 0 && | |
((bs = Date.now()), | |
Lt.timing && | |
Lt.timing.navigationStart && | |
(bs = Lt.timing.navigationStart), | |
(Lt.now = () => Date.now() - bs)); | |
ws = 1e9; | |
Wi.bigint = function (t) { | |
var e = Wi(t); | |
return typeof BigInt > "u" | |
? e[0] * ws + e[1] | |
: BigInt(e[0] * ws) + BigInt(e[1]); | |
}; | |
(ku = 10), (Ou = {}), (xu = 0); | |
(Mu = wt), | |
(Lu = wt), | |
(Uu = wt), | |
(Nu = wt), | |
(qu = wt), | |
(Du = Ee), | |
(ju = wt), | |
(Fu = wt); | |
$u = { | |
version: ql, | |
versions: Dl, | |
arch: xl, | |
platform: Ml, | |
release: Vl, | |
_rawDebug: zl, | |
moduleLoadList: Kl, | |
binding: Fl, | |
_linkedBinding: Gl, | |
_events: Ou, | |
_eventsCount: xu, | |
_maxListeners: ku, | |
on: wt, | |
addListener: Mu, | |
once: Lu, | |
off: Uu, | |
removeListener: Nu, | |
removeAllListeners: qu, | |
emit: Du, | |
prependListener: ju, | |
prependOnceListener: Fu, | |
listeners: Wu, | |
domain: Ql, | |
_exiting: Yl, | |
config: Jl, | |
dlopen: Xl, | |
uptime: Pu, | |
_getActiveRequests: Zl, | |
_getActiveHandles: eu, | |
reallyExit: tu, | |
_kill: ru, | |
cpuUsage: $i, | |
resourceUsage: iu, | |
memoryUsage: nu, | |
kill: su, | |
exit: ou, | |
openStdin: au, | |
allowedNodeEnvironmentFlags: lu, | |
assert: uu, | |
features: fu, | |
_fatalExceptions: cu, | |
setUncaughtExceptionCaptureCallback: hu, | |
hasUncaughtExceptionCaptureCallback: du, | |
emitWarning: jl, | |
nextTick: Pl, | |
_tickCallback: pu, | |
_debugProcess: gu, | |
_debugEnd: yu, | |
_startProfilerIdleNotifier: bu, | |
_stopProfilerIdleNotifier: wu, | |
stdout: _u, | |
stdin: vu, | |
stderr: mu, | |
abort: Eu, | |
umask: Wl, | |
chdir: Hl, | |
cwd: $l, | |
env: Ll, | |
title: Ol, | |
argv: Ul, | |
execArgv: Nl, | |
pid: Su, | |
ppid: Au, | |
execPath: Iu, | |
debugPort: Tu, | |
hrtime: Wi, | |
argv0: Ru, | |
_preload_modules: Cu, | |
setSourceMapsEnabled: Bu, | |
}; | |
}); | |
var m = _e(() => { | |
Hu(); | |
}); | |
var me = {}; | |
Jt(me, { | |
Buffer: () => x, | |
INSPECT_MAX_BYTES: () => ty, | |
default: () => Ut, | |
kMaxLength: () => ry, | |
}); | |
function Xg() { | |
if (Vu) return ci; | |
(Vu = !0), | |
(ci.byteLength = a), | |
(ci.toByteArray = c), | |
(ci.fromByteArray = g); | |
for ( | |
var t = [], | |
e = [], | |
r = typeof Uint8Array < "u" ? Uint8Array : Array, | |
i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", | |
n = 0, | |
o = i.length; | |
n < o; | |
++n | |
) | |
(t[n] = i[n]), (e[i.charCodeAt(n)] = n); | |
(e["-".charCodeAt(0)] = 62), (e["_".charCodeAt(0)] = 63); | |
function s(y) { | |
var w = y.length; | |
if (w % 4 > 0) | |
throw new Error("Invalid string. Length must be a multiple of 4"); | |
var S = y.indexOf("="); | |
S === -1 && (S = w); | |
var E = S === w ? 0 : 4 - (S % 4); | |
return [S, E]; | |
} | |
function a(y) { | |
var w = s(y), | |
S = w[0], | |
E = w[1]; | |
return ((S + E) * 3) / 4 - E; | |
} | |
function l(y, w, S) { | |
return ((w + S) * 3) / 4 - S; | |
} | |
function c(y) { | |
var w, | |
S = s(y), | |
E = S[0], | |
I = S[1], | |
C = new r(l(y, E, I)), | |
R = 0, | |
U = I > 0 ? E - 4 : E, | |
N; | |
for (N = 0; N < U; N += 4) | |
(w = | |
(e[y.charCodeAt(N)] << 18) | | |
(e[y.charCodeAt(N + 1)] << 12) | | |
(e[y.charCodeAt(N + 2)] << 6) | | |
e[y.charCodeAt(N + 3)]), | |
(C[R++] = (w >> 16) & 255), | |
(C[R++] = (w >> 8) & 255), | |
(C[R++] = w & 255); | |
return ( | |
I === 2 && | |
((w = (e[y.charCodeAt(N)] << 2) | (e[y.charCodeAt(N + 1)] >> 4)), | |
(C[R++] = w & 255)), | |
I === 1 && | |
((w = | |
(e[y.charCodeAt(N)] << 10) | | |
(e[y.charCodeAt(N + 1)] << 4) | | |
(e[y.charCodeAt(N + 2)] >> 2)), | |
(C[R++] = (w >> 8) & 255), | |
(C[R++] = w & 255)), | |
C | |
); | |
} | |
function h(y) { | |
return ( | |
t[(y >> 18) & 63] + t[(y >> 12) & 63] + t[(y >> 6) & 63] + t[y & 63] | |
); | |
} | |
function d(y, w, S) { | |
for (var E, I = [], C = w; C < S; C += 3) | |
(E = | |
((y[C] << 16) & 16711680) + | |
((y[C + 1] << 8) & 65280) + | |
(y[C + 2] & 255)), | |
I.push(h(E)); | |
return I.join(""); | |
} | |
function g(y) { | |
for ( | |
var w, S = y.length, E = S % 3, I = [], C = 16383, R = 0, U = S - E; | |
R < U; | |
R += C | |
) | |
I.push(d(y, R, R + C > U ? U : R + C)); | |
return ( | |
E === 1 | |
? ((w = y[S - 1]), I.push(t[w >> 2] + t[(w << 4) & 63] + "==")) | |
: E === 2 && | |
((w = (y[S - 2] << 8) + y[S - 1]), | |
I.push(t[w >> 10] + t[(w >> 4) & 63] + t[(w << 2) & 63] + "=")), | |
I.join("") | |
); | |
} | |
return ci; | |
} | |
function Zg() { | |
if (zu) return Hi; | |
zu = !0; | |
return ( | |
(Hi.read = function (t, e, r, i, n) { | |
var o, | |
s, | |
a = n * 8 - i - 1, | |
l = (1 << a) - 1, | |
c = l >> 1, | |
h = -7, | |
d = r ? n - 1 : 0, | |
g = r ? -1 : 1, | |
y = t[e + d]; | |
for ( | |
d += g, o = y & ((1 << -h) - 1), y >>= -h, h += a; | |
h > 0; | |
o = o * 256 + t[e + d], d += g, h -= 8 | |
); | |
for ( | |
s = o & ((1 << -h) - 1), o >>= -h, h += i; | |
h > 0; | |
s = s * 256 + t[e + d], d += g, h -= 8 | |
); | |
if (o === 0) o = 1 - c; | |
else { | |
if (o === l) return s ? NaN : (y ? -1 : 1) * (1 / 0); | |
(s = s + Math.pow(2, i)), (o = o - c); | |
} | |
return (y ? -1 : 1) * s * Math.pow(2, o - i); | |
}), | |
(Hi.write = function (t, e, r, i, n, o) { | |
var s, | |
a, | |
l, | |
c = o * 8 - n - 1, | |
h = (1 << c) - 1, | |
d = h >> 1, | |
g = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, | |
y = i ? 0 : o - 1, | |
w = i ? 1 : -1, | |
S = e < 0 || (e === 0 && 1 / e < 0) ? 1 : 0; | |
for ( | |
e = Math.abs(e), | |
isNaN(e) || e === 1 / 0 | |
? ((a = isNaN(e) ? 1 : 0), (s = h)) | |
: ((s = Math.floor(Math.log(e) / Math.LN2)), | |
e * (l = Math.pow(2, -s)) < 1 && (s--, (l *= 2)), | |
s + d >= 1 ? (e += g / l) : (e += g * Math.pow(2, 1 - d)), | |
e * l >= 2 && (s++, (l /= 2)), | |
s + d >= h | |
? ((a = 0), (s = h)) | |
: s + d >= 1 | |
? ((a = (e * l - 1) * Math.pow(2, n)), (s = s + d)) | |
: ((a = e * Math.pow(2, d - 1) * Math.pow(2, n)), (s = 0))); | |
n >= 8; | |
t[r + y] = a & 255, y += w, a /= 256, n -= 8 | |
); | |
for ( | |
s = (s << n) | a, c += n; | |
c > 0; | |
t[r + y] = s & 255, y += w, s /= 256, c -= 8 | |
); | |
t[r + y - w] |= S * 128; | |
}), | |
Hi | |
); | |
} | |
function ey() { | |
if (Ku) return Zt; | |
Ku = !0; | |
let t = Xg(), | |
e = Zg(), | |
r = | |
typeof Symbol == "function" && typeof Symbol.for == "function" | |
? Symbol.for("nodejs.util.inspect.custom") | |
: null; | |
(Zt.Buffer = s), (Zt.SlowBuffer = I), (Zt.INSPECT_MAX_BYTES = 50); | |
let i = 2147483647; | |
(Zt.kMaxLength = i), | |
(s.TYPED_ARRAY_SUPPORT = n()), | |
!s.TYPED_ARRAY_SUPPORT && | |
typeof console < "u" && | |
typeof console.error == "function" && | |
console.error( | |
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.", | |
); | |
function n() { | |
try { | |
let p = new Uint8Array(1), | |
u = { | |
foo: function () { | |
return 42; | |
}, | |
}; | |
return ( | |
Object.setPrototypeOf(u, Uint8Array.prototype), | |
Object.setPrototypeOf(p, u), | |
p.foo() === 42 | |
); | |
} catch { | |
return !1; | |
} | |
} | |
Object.defineProperty(s.prototype, "parent", { | |
enumerable: !0, | |
get: function () { | |
if (s.isBuffer(this)) return this.buffer; | |
}, | |
}), | |
Object.defineProperty(s.prototype, "offset", { | |
enumerable: !0, | |
get: function () { | |
if (s.isBuffer(this)) return this.byteOffset; | |
}, | |
}); | |
function o(p) { | |
if (p > i) | |
throw new RangeError( | |
'The value "' + p + '" is invalid for option "size"', | |
); | |
let u = new Uint8Array(p); | |
return Object.setPrototypeOf(u, s.prototype), u; | |
} | |
function s(p, u, f) { | |
if (typeof p == "number") { | |
if (typeof u == "string") | |
throw new TypeError( | |
'The "string" argument must be of type string. Received type number', | |
); | |
return h(p); | |
} | |
return a(p, u, f); | |
} | |
s.poolSize = 8192; | |
function a(p, u, f) { | |
if (typeof p == "string") return d(p, u); | |
if (ArrayBuffer.isView(p)) return y(p); | |
if (p == null) | |
throw new TypeError( | |
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + | |
typeof p, | |
); | |
if ( | |
Ye(p, ArrayBuffer) || | |
(p && Ye(p.buffer, ArrayBuffer)) || | |
(typeof SharedArrayBuffer < "u" && | |
(Ye(p, SharedArrayBuffer) || (p && Ye(p.buffer, SharedArrayBuffer)))) | |
) | |
return w(p, u, f); | |
if (typeof p == "number") | |
throw new TypeError( | |
'The "value" argument must not be of type number. Received type number', | |
); | |
let b = p.valueOf && p.valueOf(); | |
if (b != null && b !== p) return s.from(b, u, f); | |
let A = S(p); | |
if (A) return A; | |
if ( | |
typeof Symbol < "u" && | |
Symbol.toPrimitive != null && | |
typeof p[Symbol.toPrimitive] == "function" | |
) | |
return s.from(p[Symbol.toPrimitive]("string"), u, f); | |
throw new TypeError( | |
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + | |
typeof p, | |
); | |
} | |
(s.from = function (p, u, f) { | |
return a(p, u, f); | |
}), | |
Object.setPrototypeOf(s.prototype, Uint8Array.prototype), | |
Object.setPrototypeOf(s, Uint8Array); | |
function l(p) { | |
if (typeof p != "number") | |
throw new TypeError('"size" argument must be of type number'); | |
if (p < 0) | |
throw new RangeError( | |
'The value "' + p + '" is invalid for option "size"', | |
); | |
} | |
function c(p, u, f) { | |
return ( | |
l(p), | |
p <= 0 | |
? o(p) | |
: u !== void 0 | |
? typeof f == "string" | |
? o(p).fill(u, f) | |
: o(p).fill(u) | |
: o(p) | |
); | |
} | |
s.alloc = function (p, u, f) { | |
return c(p, u, f); | |
}; | |
function h(p) { | |
return l(p), o(p < 0 ? 0 : E(p) | 0); | |
} | |
(s.allocUnsafe = function (p) { | |
return h(p); | |
}), | |
(s.allocUnsafeSlow = function (p) { | |
return h(p); | |
}); | |
function d(p, u) { | |
if ( | |
((typeof u != "string" || u === "") && (u = "utf8"), !s.isEncoding(u)) | |
) | |
throw new TypeError("Unknown encoding: " + u); | |
let f = C(p, u) | 0, | |
b = o(f), | |
A = b.write(p, u); | |
return A !== f && (b = b.slice(0, A)), b; | |
} | |
function g(p) { | |
let u = p.length < 0 ? 0 : E(p.length) | 0, | |
f = o(u); | |
for (let b = 0; b < u; b += 1) f[b] = p[b] & 255; | |
return f; | |
} | |
function y(p) { | |
if (Ye(p, Uint8Array)) { | |
let u = new Uint8Array(p); | |
return w(u.buffer, u.byteOffset, u.byteLength); | |
} | |
return g(p); | |
} | |
function w(p, u, f) { | |
if (u < 0 || p.byteLength < u) | |
throw new RangeError('"offset" is outside of buffer bounds'); | |
if (p.byteLength < u + (f || 0)) | |
throw new RangeError('"length" is outside of buffer bounds'); | |
let b; | |
return ( | |
u === void 0 && f === void 0 | |
? (b = new Uint8Array(p)) | |
: f === void 0 | |
? (b = new Uint8Array(p, u)) | |
: (b = new Uint8Array(p, u, f)), | |
Object.setPrototypeOf(b, s.prototype), | |
b | |
); | |
} | |
function S(p) { | |
if (s.isBuffer(p)) { | |
let u = E(p.length) | 0, | |
f = o(u); | |
return f.length === 0 || p.copy(f, 0, 0, u), f; | |
} | |
if (p.length !== void 0) | |
return typeof p.length != "number" || gs(p.length) ? o(0) : g(p); | |
if (p.type === "Buffer" && Array.isArray(p.data)) return g(p.data); | |
} | |
function E(p) { | |
if (p >= i) | |
throw new RangeError( | |
"Attempt to allocate Buffer larger than maximum size: 0x" + | |
i.toString(16) + | |
" bytes", | |
); | |
return p | 0; | |
} | |
function I(p) { | |
return +p != p && (p = 0), s.alloc(+p); | |
} | |
(s.isBuffer = function (u) { | |
return u != null && u._isBuffer === !0 && u !== s.prototype; | |
}), | |
(s.compare = function (u, f) { | |
if ( | |
(Ye(u, Uint8Array) && (u = s.from(u, u.offset, u.byteLength)), | |
Ye(f, Uint8Array) && (f = s.from(f, f.offset, f.byteLength)), | |
!s.isBuffer(u) || !s.isBuffer(f)) | |
) | |
throw new TypeError( | |
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', | |
); | |
if (u === f) return 0; | |
let b = u.length, | |
A = f.length; | |
for (let T = 0, P = Math.min(b, A); T < P; ++T) | |
if (u[T] !== f[T]) { | |
(b = u[T]), (A = f[T]); | |
break; | |
} | |
return b < A ? -1 : A < b ? 1 : 0; | |
}), | |
(s.isEncoding = function (u) { | |
switch (String(u).toLowerCase()) { | |
case "hex": | |
case "utf8": | |
case "utf-8": | |
case "ascii": | |
case "latin1": | |
case "binary": | |
case "base64": | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return !0; | |
default: | |
return !1; | |
} | |
}), | |
(s.concat = function (u, f) { | |
if (!Array.isArray(u)) | |
throw new TypeError('"list" argument must be an Array of Buffers'); | |
if (u.length === 0) return s.alloc(0); | |
let b; | |
if (f === void 0) | |
for (f = 0, b = 0; b < u.length; ++b) f += u[b].length; | |
let A = s.allocUnsafe(f), | |
T = 0; | |
for (b = 0; b < u.length; ++b) { | |
let P = u[b]; | |
if (Ye(P, Uint8Array)) | |
T + P.length > A.length | |
? (s.isBuffer(P) || (P = s.from(P)), P.copy(A, T)) | |
: Uint8Array.prototype.set.call(A, P, T); | |
else if (s.isBuffer(P)) P.copy(A, T); | |
else | |
throw new TypeError('"list" argument must be an Array of Buffers'); | |
T += P.length; | |
} | |
return A; | |
}); | |
function C(p, u) { | |
if (s.isBuffer(p)) return p.length; | |
if (ArrayBuffer.isView(p) || Ye(p, ArrayBuffer)) return p.byteLength; | |
if (typeof p != "string") | |
throw new TypeError( | |
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + | |
typeof p, | |
); | |
let f = p.length, | |
b = arguments.length > 2 && arguments[2] === !0; | |
if (!b && f === 0) return 0; | |
let A = !1; | |
for (;;) | |
switch (u) { | |
case "ascii": | |
case "latin1": | |
case "binary": | |
return f; | |
case "utf8": | |
case "utf-8": | |
return ps(p).length; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return f * 2; | |
case "hex": | |
return f >>> 1; | |
case "base64": | |
return Cl(p).length; | |
default: | |
if (A) return b ? -1 : ps(p).length; | |
(u = ("" + u).toLowerCase()), (A = !0); | |
} | |
} | |
s.byteLength = C; | |
function R(p, u, f) { | |
let b = !1; | |
if ( | |
((u === void 0 || u < 0) && (u = 0), | |
u > this.length || | |
((f === void 0 || f > this.length) && (f = this.length), f <= 0) || | |
((f >>>= 0), (u >>>= 0), f <= u)) | |
) | |
return ""; | |
for (p || (p = "utf8"); ; ) | |
switch (p) { | |
case "hex": | |
return qg(this, u, f); | |
case "utf8": | |
case "utf-8": | |
return Pr(this, u, f); | |
case "ascii": | |
return hs(this, u, f); | |
case "latin1": | |
case "binary": | |
return Ng(this, u, f); | |
case "base64": | |
return ge(this, u, f); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return Dg(this, u, f); | |
default: | |
if (b) throw new TypeError("Unknown encoding: " + p); | |
(p = (p + "").toLowerCase()), (b = !0); | |
} | |
} | |
s.prototype._isBuffer = !0; | |
function U(p, u, f) { | |
let b = p[u]; | |
(p[u] = p[f]), (p[f] = b); | |
} | |
(s.prototype.swap16 = function () { | |
let u = this.length; | |
if (u % 2 !== 0) | |
throw new RangeError("Buffer size must be a multiple of 16-bits"); | |
for (let f = 0; f < u; f += 2) U(this, f, f + 1); | |
return this; | |
}), | |
(s.prototype.swap32 = function () { | |
let u = this.length; | |
if (u % 4 !== 0) | |
throw new RangeError("Buffer size must be a multiple of 32-bits"); | |
for (let f = 0; f < u; f += 4) U(this, f, f + 3), U(this, f + 1, f + 2); | |
return this; | |
}), | |
(s.prototype.swap64 = function () { | |
let u = this.length; | |
if (u % 8 !== 0) | |
throw new RangeError("Buffer size must be a multiple of 64-bits"); | |
for (let f = 0; f < u; f += 8) | |
U(this, f, f + 7), | |
U(this, f + 1, f + 6), | |
U(this, f + 2, f + 5), | |
U(this, f + 3, f + 4); | |
return this; | |
}), | |
(s.prototype.toString = function () { | |
let u = this.length; | |
return u === 0 | |
? "" | |
: arguments.length === 0 | |
? Pr(this, 0, u) | |
: R.apply(this, arguments); | |
}), | |
(s.prototype.toLocaleString = s.prototype.toString), | |
(s.prototype.equals = function (u) { | |
if (!s.isBuffer(u)) throw new TypeError("Argument must be a Buffer"); | |
return this === u ? !0 : s.compare(this, u) === 0; | |
}), | |
(s.prototype.inspect = function () { | |
let u = "", | |
f = Zt.INSPECT_MAX_BYTES; | |
return ( | |
(u = this.toString("hex", 0, f) | |
.replace(/(.{2})/g, "$1 ") | |
.trim()), | |
this.length > f && (u += " ... "), | |
"<Buffer " + u + ">" | |
); | |
}), | |
r && (s.prototype[r] = s.prototype.inspect), | |
(s.prototype.compare = function (u, f, b, A, T) { | |
if ( | |
(Ye(u, Uint8Array) && (u = s.from(u, u.offset, u.byteLength)), | |
!s.isBuffer(u)) | |
) | |
throw new TypeError( | |
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + | |
typeof u, | |
); | |
if ( | |
(f === void 0 && (f = 0), | |
b === void 0 && (b = u ? u.length : 0), | |
A === void 0 && (A = 0), | |
T === void 0 && (T = this.length), | |
f < 0 || b > u.length || A < 0 || T > this.length) | |
) | |
throw new RangeError("out of range index"); | |
if (A >= T && f >= b) return 0; | |
if (A >= T) return -1; | |
if (f >= b) return 1; | |
if (((f >>>= 0), (b >>>= 0), (A >>>= 0), (T >>>= 0), this === u)) | |
return 0; | |
let P = T - A, | |
$ = b - f, | |
se = Math.min(P, $), | |
te = this.slice(A, T), | |
oe = u.slice(f, b); | |
for (let J = 0; J < se; ++J) | |
if (te[J] !== oe[J]) { | |
(P = te[J]), ($ = oe[J]); | |
break; | |
} | |
return P < $ ? -1 : $ < P ? 1 : 0; | |
}); | |
function N(p, u, f, b, A) { | |
if (p.length === 0) return -1; | |
if ( | |
(typeof f == "string" | |
? ((b = f), (f = 0)) | |
: f > 2147483647 | |
? (f = 2147483647) | |
: f < -2147483648 && (f = -2147483648), | |
(f = +f), | |
gs(f) && (f = A ? 0 : p.length - 1), | |
f < 0 && (f = p.length + f), | |
f >= p.length) | |
) { | |
if (A) return -1; | |
f = p.length - 1; | |
} else if (f < 0) | |
if (A) f = 0; | |
else return -1; | |
if ((typeof u == "string" && (u = s.from(u, b)), s.isBuffer(u))) | |
return u.length === 0 ? -1 : W(p, u, f, b, A); | |
if (typeof u == "number") | |
return ( | |
(u = u & 255), | |
typeof Uint8Array.prototype.indexOf == "function" | |
? A | |
? Uint8Array.prototype.indexOf.call(p, u, f) | |
: Uint8Array.prototype.lastIndexOf.call(p, u, f) | |
: W(p, [u], f, b, A) | |
); | |
throw new TypeError("val must be string, number or Buffer"); | |
} | |
function W(p, u, f, b, A) { | |
let T = 1, | |
P = p.length, | |
$ = u.length; | |
if ( | |
b !== void 0 && | |
((b = String(b).toLowerCase()), | |
b === "ucs2" || b === "ucs-2" || b === "utf16le" || b === "utf-16le") | |
) { | |
if (p.length < 2 || u.length < 2) return -1; | |
(T = 2), (P /= 2), ($ /= 2), (f /= 2); | |
} | |
function se(oe, J) { | |
return T === 1 ? oe[J] : oe.readUInt16BE(J * T); | |
} | |
let te; | |
if (A) { | |
let oe = -1; | |
for (te = f; te < P; te++) | |
if (se(p, te) === se(u, oe === -1 ? 0 : te - oe)) { | |
if ((oe === -1 && (oe = te), te - oe + 1 === $)) return oe * T; | |
} else oe !== -1 && (te -= te - oe), (oe = -1); | |
} else | |
for (f + $ > P && (f = P - $), te = f; te >= 0; te--) { | |
let oe = !0; | |
for (let J = 0; J < $; J++) | |
if (se(p, te + J) !== se(u, J)) { | |
oe = !1; | |
break; | |
} | |
if (oe) return te; | |
} | |
return -1; | |
} | |
(s.prototype.includes = function (u, f, b) { | |
return this.indexOf(u, f, b) !== -1; | |
}), | |
(s.prototype.indexOf = function (u, f, b) { | |
return N(this, u, f, b, !0); | |
}), | |
(s.prototype.lastIndexOf = function (u, f, b) { | |
return N(this, u, f, b, !1); | |
}); | |
function K(p, u, f, b) { | |
f = Number(f) || 0; | |
let A = p.length - f; | |
b ? ((b = Number(b)), b > A && (b = A)) : (b = A); | |
let T = u.length; | |
b > T / 2 && (b = T / 2); | |
let P; | |
for (P = 0; P < b; ++P) { | |
let $ = parseInt(u.substr(P * 2, 2), 16); | |
if (gs($)) return P; | |
p[f + P] = $; | |
} | |
return P; | |
} | |
function z(p, u, f, b) { | |
return ji(ps(u, p.length - f), p, f, b); | |
} | |
function Q(p, u, f, b) { | |
return ji($g(u), p, f, b); | |
} | |
function pe(p, u, f, b) { | |
return ji(Cl(u), p, f, b); | |
} | |
function Yt(p, u, f, b) { | |
return ji(Hg(u, p.length - f), p, f, b); | |
} | |
(s.prototype.write = function (u, f, b, A) { | |
if (f === void 0) (A = "utf8"), (b = this.length), (f = 0); | |
else if (b === void 0 && typeof f == "string") | |
(A = f), (b = this.length), (f = 0); | |
else if (isFinite(f)) | |
(f = f >>> 0), | |
isFinite(b) | |
? ((b = b >>> 0), A === void 0 && (A = "utf8")) | |
: ((A = b), (b = void 0)); | |
else | |
throw new Error( | |
"Buffer.write(string, encoding, offset[, length]) is no longer supported", | |
); | |
let T = this.length - f; | |
if ( | |
((b === void 0 || b > T) && (b = T), | |
(u.length > 0 && (b < 0 || f < 0)) || f > this.length) | |
) | |
throw new RangeError("Attempt to write outside buffer bounds"); | |
A || (A = "utf8"); | |
let P = !1; | |
for (;;) | |
switch (A) { | |
case "hex": | |
return K(this, u, f, b); | |
case "utf8": | |
case "utf-8": | |
return z(this, u, f, b); | |
case "ascii": | |
case "latin1": | |
case "binary": | |
return Q(this, u, f, b); | |
case "base64": | |
return pe(this, u, f, b); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return Yt(this, u, f, b); | |
default: | |
if (P) throw new TypeError("Unknown encoding: " + A); | |
(A = ("" + A).toLowerCase()), (P = !0); | |
} | |
}), | |
(s.prototype.toJSON = function () { | |
return { | |
type: "Buffer", | |
data: Array.prototype.slice.call(this._arr || this, 0), | |
}; | |
}); | |
function ge(p, u, f) { | |
return u === 0 && f === p.length | |
? t.fromByteArray(p) | |
: t.fromByteArray(p.slice(u, f)); | |
} | |
function Pr(p, u, f) { | |
f = Math.min(p.length, f); | |
let b = [], | |
A = u; | |
for (; A < f; ) { | |
let T = p[A], | |
P = null, | |
$ = T > 239 ? 4 : T > 223 ? 3 : T > 191 ? 2 : 1; | |
if (A + $ <= f) { | |
let se, te, oe, J; | |
switch ($) { | |
case 1: | |
T < 128 && (P = T); | |
break; | |
case 2: | |
(se = p[A + 1]), | |
(se & 192) === 128 && | |
((J = ((T & 31) << 6) | (se & 63)), J > 127 && (P = J)); | |
break; | |
case 3: | |
(se = p[A + 1]), | |
(te = p[A + 2]), | |
(se & 192) === 128 && | |
(te & 192) === 128 && | |
((J = ((T & 15) << 12) | ((se & 63) << 6) | (te & 63)), | |
J > 2047 && (J < 55296 || J > 57343) && (P = J)); | |
break; | |
case 4: | |
(se = p[A + 1]), | |
(te = p[A + 2]), | |
(oe = p[A + 3]), | |
(se & 192) === 128 && | |
(te & 192) === 128 && | |
(oe & 192) === 128 && | |
((J = | |
((T & 15) << 18) | | |
((se & 63) << 12) | | |
((te & 63) << 6) | | |
(oe & 63)), | |
J > 65535 && J < 1114112 && (P = J)); | |
} | |
} | |
P === null | |
? ((P = 65533), ($ = 1)) | |
: P > 65535 && | |
((P -= 65536), | |
b.push(((P >>> 10) & 1023) | 55296), | |
(P = 56320 | (P & 1023))), | |
b.push(P), | |
(A += $); | |
} | |
return Or(b); | |
} | |
let kr = 4096; | |
function Or(p) { | |
let u = p.length; | |
if (u <= kr) return String.fromCharCode.apply(String, p); | |
let f = "", | |
b = 0; | |
for (; b < u; ) | |
f += String.fromCharCode.apply(String, p.slice(b, (b += kr))); | |
return f; | |
} | |
function hs(p, u, f) { | |
let b = ""; | |
f = Math.min(p.length, f); | |
for (let A = u; A < f; ++A) b += String.fromCharCode(p[A] & 127); | |
return b; | |
} | |
function Ng(p, u, f) { | |
let b = ""; | |
f = Math.min(p.length, f); | |
for (let A = u; A < f; ++A) b += String.fromCharCode(p[A]); | |
return b; | |
} | |
function qg(p, u, f) { | |
let b = p.length; | |
(!u || u < 0) && (u = 0), (!f || f < 0 || f > b) && (f = b); | |
let A = ""; | |
for (let T = u; T < f; ++T) A += Vg[p[T]]; | |
return A; | |
} | |
function Dg(p, u, f) { | |
let b = p.slice(u, f), | |
A = ""; | |
for (let T = 0; T < b.length - 1; T += 2) | |
A += String.fromCharCode(b[T] + b[T + 1] * 256); | |
return A; | |
} | |
s.prototype.slice = function (u, f) { | |
let b = this.length; | |
(u = ~~u), | |
(f = f === void 0 ? b : ~~f), | |
u < 0 ? ((u += b), u < 0 && (u = 0)) : u > b && (u = b), | |
f < 0 ? ((f += b), f < 0 && (f = 0)) : f > b && (f = b), | |
f < u && (f = u); | |
let A = this.subarray(u, f); | |
return Object.setPrototypeOf(A, s.prototype), A; | |
}; | |
function ye(p, u, f) { | |
if (p % 1 !== 0 || p < 0) throw new RangeError("offset is not uint"); | |
if (p + u > f) | |
throw new RangeError("Trying to access beyond buffer length"); | |
} | |
(s.prototype.readUintLE = s.prototype.readUIntLE = | |
function (u, f, b) { | |
(u = u >>> 0), (f = f >>> 0), b || ye(u, f, this.length); | |
let A = this[u], | |
T = 1, | |
P = 0; | |
for (; ++P < f && (T *= 256); ) A += this[u + P] * T; | |
return A; | |
}), | |
(s.prototype.readUintBE = s.prototype.readUIntBE = | |
function (u, f, b) { | |
(u = u >>> 0), (f = f >>> 0), b || ye(u, f, this.length); | |
let A = this[u + --f], | |
T = 1; | |
for (; f > 0 && (T *= 256); ) A += this[u + --f] * T; | |
return A; | |
}), | |
(s.prototype.readUint8 = s.prototype.readUInt8 = | |
function (u, f) { | |
return (u = u >>> 0), f || ye(u, 1, this.length), this[u]; | |
}), | |
(s.prototype.readUint16LE = s.prototype.readUInt16LE = | |
function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 2, this.length), | |
this[u] | (this[u + 1] << 8) | |
); | |
}), | |
(s.prototype.readUint16BE = s.prototype.readUInt16BE = | |
function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 2, this.length), | |
(this[u] << 8) | this[u + 1] | |
); | |
}), | |
(s.prototype.readUint32LE = s.prototype.readUInt32LE = | |
function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 4, this.length), | |
(this[u] | (this[u + 1] << 8) | (this[u + 2] << 16)) + | |
this[u + 3] * 16777216 | |
); | |
}), | |
(s.prototype.readUint32BE = s.prototype.readUInt32BE = | |
function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 4, this.length), | |
this[u] * 16777216 + | |
((this[u + 1] << 16) | (this[u + 2] << 8) | this[u + 3]) | |
); | |
}), | |
(s.prototype.readBigUInt64LE = Mt(function (u) { | |
(u = u >>> 0), Mr(u, "offset"); | |
let f = this[u], | |
b = this[u + 7]; | |
(f === void 0 || b === void 0) && fi(u, this.length - 8); | |
let A = | |
f + this[++u] * 2 ** 8 + this[++u] * 2 ** 16 + this[++u] * 2 ** 24, | |
T = | |
this[++u] + this[++u] * 2 ** 8 + this[++u] * 2 ** 16 + b * 2 ** 24; | |
return BigInt(A) + (BigInt(T) << BigInt(32)); | |
})), | |
(s.prototype.readBigUInt64BE = Mt(function (u) { | |
(u = u >>> 0), Mr(u, "offset"); | |
let f = this[u], | |
b = this[u + 7]; | |
(f === void 0 || b === void 0) && fi(u, this.length - 8); | |
let A = | |
f * 2 ** 24 + this[++u] * 2 ** 16 + this[++u] * 2 ** 8 + this[++u], | |
T = | |
this[++u] * 2 ** 24 + this[++u] * 2 ** 16 + this[++u] * 2 ** 8 + b; | |
return (BigInt(A) << BigInt(32)) + BigInt(T); | |
})), | |
(s.prototype.readIntLE = function (u, f, b) { | |
(u = u >>> 0), (f = f >>> 0), b || ye(u, f, this.length); | |
let A = this[u], | |
T = 1, | |
P = 0; | |
for (; ++P < f && (T *= 256); ) A += this[u + P] * T; | |
return (T *= 128), A >= T && (A -= Math.pow(2, 8 * f)), A; | |
}), | |
(s.prototype.readIntBE = function (u, f, b) { | |
(u = u >>> 0), (f = f >>> 0), b || ye(u, f, this.length); | |
let A = f, | |
T = 1, | |
P = this[u + --A]; | |
for (; A > 0 && (T *= 256); ) P += this[u + --A] * T; | |
return (T *= 128), P >= T && (P -= Math.pow(2, 8 * f)), P; | |
}), | |
(s.prototype.readInt8 = function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 1, this.length), | |
this[u] & 128 ? (255 - this[u] + 1) * -1 : this[u] | |
); | |
}), | |
(s.prototype.readInt16LE = function (u, f) { | |
(u = u >>> 0), f || ye(u, 2, this.length); | |
let b = this[u] | (this[u + 1] << 8); | |
return b & 32768 ? b | 4294901760 : b; | |
}), | |
(s.prototype.readInt16BE = function (u, f) { | |
(u = u >>> 0), f || ye(u, 2, this.length); | |
let b = this[u + 1] | (this[u] << 8); | |
return b & 32768 ? b | 4294901760 : b; | |
}), | |
(s.prototype.readInt32LE = function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 4, this.length), | |
this[u] | | |
(this[u + 1] << 8) | | |
(this[u + 2] << 16) | | |
(this[u + 3] << 24) | |
); | |
}), | |
(s.prototype.readInt32BE = function (u, f) { | |
return ( | |
(u = u >>> 0), | |
f || ye(u, 4, this.length), | |
(this[u] << 24) | | |
(this[u + 1] << 16) | | |
(this[u + 2] << 8) | | |
this[u + 3] | |
); | |
}), | |
(s.prototype.readBigInt64LE = Mt(function (u) { | |
(u = u >>> 0), Mr(u, "offset"); | |
let f = this[u], | |
b = this[u + 7]; | |
(f === void 0 || b === void 0) && fi(u, this.length - 8); | |
let A = | |
this[u + 4] + | |
this[u + 5] * 2 ** 8 + | |
this[u + 6] * 2 ** 16 + | |
(b << 24); | |
return ( | |
(BigInt(A) << BigInt(32)) + | |
BigInt( | |
f + this[++u] * 2 ** 8 + this[++u] * 2 ** 16 + this[++u] * 2 ** 24, | |
) | |
); | |
})), | |
(s.prototype.readBigInt64BE = Mt(function (u) { | |
(u = u >>> 0), Mr(u, "offset"); | |
let f = this[u], | |
b = this[u + 7]; | |
(f === void 0 || b === void 0) && fi(u, this.length - 8); | |
let A = | |
(f << 24) + this[++u] * 2 ** 16 + this[++u] * 2 ** 8 + this[++u]; | |
return ( | |
(BigInt(A) << BigInt(32)) + | |
BigInt( | |
this[++u] * 2 ** 24 + this[++u] * 2 ** 16 + this[++u] * 2 ** 8 + b, | |
) | |
); | |
})), | |
(s.prototype.readFloatLE = function (u, f) { | |
return ( | |
(u = u >>> 0), f || ye(u, 4, this.length), e.read(this, u, !0, 23, 4) | |
); | |
}), | |
(s.prototype.readFloatBE = function (u, f) { | |
return ( | |
(u = u >>> 0), f || ye(u, 4, this.length), e.read(this, u, !1, 23, 4) | |
); | |
}), | |
(s.prototype.readDoubleLE = function (u, f) { | |
return ( | |
(u = u >>> 0), f || ye(u, 8, this.length), e.read(this, u, !0, 52, 8) | |
); | |
}), | |
(s.prototype.readDoubleBE = function (u, f) { | |
return ( | |
(u = u >>> 0), f || ye(u, 8, this.length), e.read(this, u, !1, 52, 8) | |
); | |
}); | |
function Ce(p, u, f, b, A, T) { | |
if (!s.isBuffer(p)) | |
throw new TypeError('"buffer" argument must be a Buffer instance'); | |
if (u > A || u < T) | |
throw new RangeError('"value" argument is out of bounds'); | |
if (f + b > p.length) throw new RangeError("Index out of range"); | |
} | |
(s.prototype.writeUintLE = s.prototype.writeUIntLE = | |
function (u, f, b, A) { | |
if (((u = +u), (f = f >>> 0), (b = b >>> 0), !A)) { | |
let $ = Math.pow(2, 8 * b) - 1; | |
Ce(this, u, f, b, $, 0); | |
} | |
let T = 1, | |
P = 0; | |
for (this[f] = u & 255; ++P < b && (T *= 256); ) | |
this[f + P] = (u / T) & 255; | |
return f + b; | |
}), | |
(s.prototype.writeUintBE = s.prototype.writeUIntBE = | |
function (u, f, b, A) { | |
if (((u = +u), (f = f >>> 0), (b = b >>> 0), !A)) { | |
let $ = Math.pow(2, 8 * b) - 1; | |
Ce(this, u, f, b, $, 0); | |
} | |
let T = b - 1, | |
P = 1; | |
for (this[f + T] = u & 255; --T >= 0 && (P *= 256); ) | |
this[f + T] = (u / P) & 255; | |
return f + b; | |
}), | |
(s.prototype.writeUint8 = s.prototype.writeUInt8 = | |
function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 1, 255, 0), | |
(this[f] = u & 255), | |
f + 1 | |
); | |
}), | |
(s.prototype.writeUint16LE = s.prototype.writeUInt16LE = | |
function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 2, 65535, 0), | |
(this[f] = u & 255), | |
(this[f + 1] = u >>> 8), | |
f + 2 | |
); | |
}), | |
(s.prototype.writeUint16BE = s.prototype.writeUInt16BE = | |
function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 2, 65535, 0), | |
(this[f] = u >>> 8), | |
(this[f + 1] = u & 255), | |
f + 2 | |
); | |
}), | |
(s.prototype.writeUint32LE = s.prototype.writeUInt32LE = | |
function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 4, 4294967295, 0), | |
(this[f + 3] = u >>> 24), | |
(this[f + 2] = u >>> 16), | |
(this[f + 1] = u >>> 8), | |
(this[f] = u & 255), | |
f + 4 | |
); | |
}), | |
(s.prototype.writeUint32BE = s.prototype.writeUInt32BE = | |
function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 4, 4294967295, 0), | |
(this[f] = u >>> 24), | |
(this[f + 1] = u >>> 16), | |
(this[f + 2] = u >>> 8), | |
(this[f + 3] = u & 255), | |
f + 4 | |
); | |
}); | |
function vl(p, u, f, b, A) { | |
Rl(u, b, A, p, f, 7); | |
let T = Number(u & BigInt(4294967295)); | |
(p[f++] = T), | |
(T = T >> 8), | |
(p[f++] = T), | |
(T = T >> 8), | |
(p[f++] = T), | |
(T = T >> 8), | |
(p[f++] = T); | |
let P = Number((u >> BigInt(32)) & BigInt(4294967295)); | |
return ( | |
(p[f++] = P), | |
(P = P >> 8), | |
(p[f++] = P), | |
(P = P >> 8), | |
(p[f++] = P), | |
(P = P >> 8), | |
(p[f++] = P), | |
f | |
); | |
} | |
function El(p, u, f, b, A) { | |
Rl(u, b, A, p, f, 7); | |
let T = Number(u & BigInt(4294967295)); | |
(p[f + 7] = T), | |
(T = T >> 8), | |
(p[f + 6] = T), | |
(T = T >> 8), | |
(p[f + 5] = T), | |
(T = T >> 8), | |
(p[f + 4] = T); | |
let P = Number((u >> BigInt(32)) & BigInt(4294967295)); | |
return ( | |
(p[f + 3] = P), | |
(P = P >> 8), | |
(p[f + 2] = P), | |
(P = P >> 8), | |
(p[f + 1] = P), | |
(P = P >> 8), | |
(p[f] = P), | |
f + 8 | |
); | |
} | |
(s.prototype.writeBigUInt64LE = Mt(function (u, f = 0) { | |
return vl(this, u, f, BigInt(0), BigInt("0xffffffffffffffff")); | |
})), | |
(s.prototype.writeBigUInt64BE = Mt(function (u, f = 0) { | |
return El(this, u, f, BigInt(0), BigInt("0xffffffffffffffff")); | |
})), | |
(s.prototype.writeIntLE = function (u, f, b, A) { | |
if (((u = +u), (f = f >>> 0), !A)) { | |
let se = Math.pow(2, 8 * b - 1); | |
Ce(this, u, f, b, se - 1, -se); | |
} | |
let T = 0, | |
P = 1, | |
$ = 0; | |
for (this[f] = u & 255; ++T < b && (P *= 256); ) | |
u < 0 && $ === 0 && this[f + T - 1] !== 0 && ($ = 1), | |
(this[f + T] = (((u / P) >> 0) - $) & 255); | |
return f + b; | |
}), | |
(s.prototype.writeIntBE = function (u, f, b, A) { | |
if (((u = +u), (f = f >>> 0), !A)) { | |
let se = Math.pow(2, 8 * b - 1); | |
Ce(this, u, f, b, se - 1, -se); | |
} | |
let T = b - 1, | |
P = 1, | |
$ = 0; | |
for (this[f + T] = u & 255; --T >= 0 && (P *= 256); ) | |
u < 0 && $ === 0 && this[f + T + 1] !== 0 && ($ = 1), | |
(this[f + T] = (((u / P) >> 0) - $) & 255); | |
return f + b; | |
}), | |
(s.prototype.writeInt8 = function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 1, 127, -128), | |
u < 0 && (u = 255 + u + 1), | |
(this[f] = u & 255), | |
f + 1 | |
); | |
}), | |
(s.prototype.writeInt16LE = function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 2, 32767, -32768), | |
(this[f] = u & 255), | |
(this[f + 1] = u >>> 8), | |
f + 2 | |
); | |
}), | |
(s.prototype.writeInt16BE = function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 2, 32767, -32768), | |
(this[f] = u >>> 8), | |
(this[f + 1] = u & 255), | |
f + 2 | |
); | |
}), | |
(s.prototype.writeInt32LE = function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 4, 2147483647, -2147483648), | |
(this[f] = u & 255), | |
(this[f + 1] = u >>> 8), | |
(this[f + 2] = u >>> 16), | |
(this[f + 3] = u >>> 24), | |
f + 4 | |
); | |
}), | |
(s.prototype.writeInt32BE = function (u, f, b) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
b || Ce(this, u, f, 4, 2147483647, -2147483648), | |
u < 0 && (u = 4294967295 + u + 1), | |
(this[f] = u >>> 24), | |
(this[f + 1] = u >>> 16), | |
(this[f + 2] = u >>> 8), | |
(this[f + 3] = u & 255), | |
f + 4 | |
); | |
}), | |
(s.prototype.writeBigInt64LE = Mt(function (u, f = 0) { | |
return vl( | |
this, | |
u, | |
f, | |
-BigInt("0x8000000000000000"), | |
BigInt("0x7fffffffffffffff"), | |
); | |
})), | |
(s.prototype.writeBigInt64BE = Mt(function (u, f = 0) { | |
return El( | |
this, | |
u, | |
f, | |
-BigInt("0x8000000000000000"), | |
BigInt("0x7fffffffffffffff"), | |
); | |
})); | |
function Sl(p, u, f, b, A, T) { | |
if (f + b > p.length) throw new RangeError("Index out of range"); | |
if (f < 0) throw new RangeError("Index out of range"); | |
} | |
function Al(p, u, f, b, A) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
A || Sl(p, u, f, 4), | |
e.write(p, u, f, b, 23, 4), | |
f + 4 | |
); | |
} | |
(s.prototype.writeFloatLE = function (u, f, b) { | |
return Al(this, u, f, !0, b); | |
}), | |
(s.prototype.writeFloatBE = function (u, f, b) { | |
return Al(this, u, f, !1, b); | |
}); | |
function Il(p, u, f, b, A) { | |
return ( | |
(u = +u), | |
(f = f >>> 0), | |
A || Sl(p, u, f, 8), | |
e.write(p, u, f, b, 52, 8), | |
f + 8 | |
); | |
} | |
(s.prototype.writeDoubleLE = function (u, f, b) { | |
return Il(this, u, f, !0, b); | |
}), | |
(s.prototype.writeDoubleBE = function (u, f, b) { | |
return Il(this, u, f, !1, b); | |
}), | |
(s.prototype.copy = function (u, f, b, A) { | |
if (!s.isBuffer(u)) throw new TypeError("argument should be a Buffer"); | |
if ( | |
(b || (b = 0), | |
!A && A !== 0 && (A = this.length), | |
f >= u.length && (f = u.length), | |
f || (f = 0), | |
A > 0 && A < b && (A = b), | |
A === b || u.length === 0 || this.length === 0) | |
) | |
return 0; | |
if (f < 0) throw new RangeError("targetStart out of bounds"); | |
if (b < 0 || b >= this.length) | |
throw new RangeError("Index out of range"); | |
if (A < 0) throw new RangeError("sourceEnd out of bounds"); | |
A > this.length && (A = this.length), | |
u.length - f < A - b && (A = u.length - f + b); | |
let T = A - b; | |
return ( | |
this === u && typeof Uint8Array.prototype.copyWithin == "function" | |
? this.copyWithin(f, b, A) | |
: Uint8Array.prototype.set.call(u, this.subarray(b, A), f), | |
T | |
); | |
}), | |
(s.prototype.fill = function (u, f, b, A) { | |
if (typeof u == "string") { | |
if ( | |
(typeof f == "string" | |
? ((A = f), (f = 0), (b = this.length)) | |
: typeof b == "string" && ((A = b), (b = this.length)), | |
A !== void 0 && typeof A != "string") | |
) | |
throw new TypeError("encoding must be a string"); | |
if (typeof A == "string" && !s.isEncoding(A)) | |
throw new TypeError("Unknown encoding: " + A); | |
if (u.length === 1) { | |
let P = u.charCodeAt(0); | |
((A === "utf8" && P < 128) || A === "latin1") && (u = P); | |
} | |
} else | |
typeof u == "number" | |
? (u = u & 255) | |
: typeof u == "boolean" && (u = Number(u)); | |
if (f < 0 || this.length < f || this.length < b) | |
throw new RangeError("Out of range index"); | |
if (b <= f) return this; | |
(f = f >>> 0), (b = b === void 0 ? this.length : b >>> 0), u || (u = 0); | |
let T; | |
if (typeof u == "number") for (T = f; T < b; ++T) this[T] = u; | |
else { | |
let P = s.isBuffer(u) ? u : s.from(u, A), | |
$ = P.length; | |
if ($ === 0) | |
throw new TypeError( | |
'The value "' + u + '" is invalid for argument "value"', | |
); | |
for (T = 0; T < b - f; ++T) this[T + f] = P[T % $]; | |
} | |
return this; | |
}); | |
let xr = {}; | |
function ds(p, u, f) { | |
xr[p] = class extends f { | |
constructor() { | |
super(), | |
Object.defineProperty(this, "message", { | |
value: u.apply(this, arguments), | |
writable: !0, | |
configurable: !0, | |
}), | |
(this.name = `${this.name} [${p}]`), | |
this.stack, | |
delete this.name; | |
} | |
get code() { | |
return p; | |
} | |
set code(A) { | |
Object.defineProperty(this, "code", { | |
configurable: !0, | |
enumerable: !0, | |
value: A, | |
writable: !0, | |
}); | |
} | |
toString() { | |
return `${this.name} [${p}]: ${this.message}`; | |
} | |
}; | |
} | |
ds( | |
"ERR_BUFFER_OUT_OF_BOUNDS", | |
function (p) { | |
return p | |
? `${p} is outside of buffer bounds` | |
: "Attempt to access memory outside buffer bounds"; | |
}, | |
RangeError, | |
), | |
ds( | |
"ERR_INVALID_ARG_TYPE", | |
function (p, u) { | |
return `The "${p}" argument must be of type number. Received type ${typeof u}`; | |
}, | |
TypeError, | |
), | |
ds( | |
"ERR_OUT_OF_RANGE", | |
function (p, u, f) { | |
let b = `The value of "${p}" is out of range.`, | |
A = f; | |
return ( | |
Number.isInteger(f) && Math.abs(f) > 2 ** 32 | |
? (A = Tl(String(f))) | |
: typeof f == "bigint" && | |
((A = String(f)), | |
(f > BigInt(2) ** BigInt(32) || | |
f < -(BigInt(2) ** BigInt(32))) && | |
(A = Tl(A)), | |
(A += "n")), | |
(b += ` It must be ${u}. Received ${A}`), | |
b | |
); | |
}, | |
RangeError, | |
); | |
function Tl(p) { | |
let u = "", | |
f = p.length, | |
b = p[0] === "-" ? 1 : 0; | |
for (; f >= b + 4; f -= 3) u = `_${p.slice(f - 3, f)}${u}`; | |
return `${p.slice(0, f)}${u}`; | |
} | |
function jg(p, u, f) { | |
Mr(u, "offset"), | |
(p[u] === void 0 || p[u + f] === void 0) && fi(u, p.length - (f + 1)); | |
} | |
function Rl(p, u, f, b, A, T) { | |
if (p > f || p < u) { | |
let P = typeof u == "bigint" ? "n" : "", | |
$; | |
throw ( | |
(T > 3 | |
? u === 0 || u === BigInt(0) | |
? ($ = `>= 0${P} and < 2${P} ** ${(T + 1) * 8}${P}`) | |
: ($ = `>= -(2${P} ** ${(T + 1) * 8 - 1}${P}) and < 2 ** ${(T + 1) * 8 - 1}${P}`) | |
: ($ = `>= ${u}${P} and <= ${f}${P}`), | |
new xr.ERR_OUT_OF_RANGE("value", $, p)) | |
); | |
} | |
jg(b, A, T); | |
} | |
function Mr(p, u) { | |
if (typeof p != "number") | |
throw new xr.ERR_INVALID_ARG_TYPE(u, "number", p); | |
} | |
function fi(p, u, f) { | |
throw Math.floor(p) !== p | |
? (Mr(p, f), new xr.ERR_OUT_OF_RANGE(f || "offset", "an integer", p)) | |
: u < 0 | |
? new xr.ERR_BUFFER_OUT_OF_BOUNDS() | |
: new xr.ERR_OUT_OF_RANGE( | |
f || "offset", | |
`>= ${f ? 1 : 0} and <= ${u}`, | |
p, | |
); | |
} | |
let Fg = /[^+/0-9A-Za-z-_]/g; | |
function Wg(p) { | |
if (((p = p.split("=")[0]), (p = p.trim().replace(Fg, "")), p.length < 2)) | |
return ""; | |
for (; p.length % 4 !== 0; ) p = p + "="; | |
return p; | |
} | |
function ps(p, u) { | |
u = u || 1 / 0; | |
let f, | |
b = p.length, | |
A = null, | |
T = []; | |
for (let P = 0; P < b; ++P) { | |
if (((f = p.charCodeAt(P)), f > 55295 && f < 57344)) { | |
if (!A) { | |
if (f > 56319) { | |
(u -= 3) > -1 && T.push(239, 191, 189); | |
continue; | |
} else if (P + 1 === b) { | |
(u -= 3) > -1 && T.push(239, 191, 189); | |
continue; | |
} | |
A = f; | |
continue; | |
} | |
if (f < 56320) { | |
(u -= 3) > -1 && T.push(239, 191, 189), (A = f); | |
continue; | |
} | |
f = (((A - 55296) << 10) | (f - 56320)) + 65536; | |
} else A && (u -= 3) > -1 && T.push(239, 191, 189); | |
if (((A = null), f < 128)) { | |
if ((u -= 1) < 0) break; | |
T.push(f); | |
} else if (f < 2048) { | |
if ((u -= 2) < 0) break; | |
T.push((f >> 6) | 192, (f & 63) | 128); | |
} else if (f < 65536) { | |
if ((u -= 3) < 0) break; | |
T.push((f >> 12) | 224, ((f >> 6) & 63) | 128, (f & 63) | 128); | |
} else if (f < 1114112) { | |
if ((u -= 4) < 0) break; | |
T.push( | |
(f >> 18) | 240, | |
((f >> 12) & 63) | 128, | |
((f >> 6) & 63) | 128, | |
(f & 63) | 128, | |
); | |
} else throw new Error("Invalid code point"); | |
} | |
return T; | |
} | |
function $g(p) { | |
let u = []; | |
for (let f = 0; f < p.length; ++f) u.push(p.charCodeAt(f) & 255); | |
return u; | |
} | |
function Hg(p, u) { | |
let f, | |
b, | |
A, | |
T = []; | |
for (let P = 0; P < p.length && !((u -= 2) < 0); ++P) | |
(f = p.charCodeAt(P)), | |
(b = f >> 8), | |
(A = f % 256), | |
T.push(A), | |
T.push(b); | |
return T; | |
} | |
function Cl(p) { | |
return t.toByteArray(Wg(p)); | |
} | |
function ji(p, u, f, b) { | |
let A; | |
for (A = 0; A < b && !(A + f >= u.length || A >= p.length); ++A) | |
u[A + f] = p[A]; | |
return A; | |
} | |
function Ye(p, u) { | |
return ( | |
p instanceof u || | |
(p != null && | |
p.constructor != null && | |
p.constructor.name != null && | |
p.constructor.name === u.name) | |
); | |
} | |
function gs(p) { | |
return p !== p; | |
} | |
let Vg = (function () { | |
let p = "0123456789abcdef", | |
u = new Array(256); | |
for (let f = 0; f < 16; ++f) { | |
let b = f * 16; | |
for (let A = 0; A < 16; ++A) u[b + A] = p[f] + p[A]; | |
} | |
return u; | |
})(); | |
function Mt(p) { | |
return typeof BigInt > "u" ? zg : p; | |
} | |
function zg() { | |
throw new Error("BigInt not supported"); | |
} | |
return Zt; | |
} | |
var ci, | |
Vu, | |
Hi, | |
zu, | |
Zt, | |
Ku, | |
Ut, | |
x, | |
ty, | |
ry, | |
be = _e(() => { | |
_(); | |
v(); | |
m(); | |
(ci = {}), (Vu = !1); | |
(Hi = {}), (zu = !1); | |
(Zt = {}), (Ku = !1); | |
Ut = ey(); | |
Ut.Buffer; | |
Ut.SlowBuffer; | |
Ut.INSPECT_MAX_BYTES; | |
Ut.kMaxLength; | |
(x = Ut.Buffer), (ty = Ut.INSPECT_MAX_BYTES), (ry = Ut.kMaxLength); | |
}); | |
var v = _e(() => { | |
be(); | |
}); | |
var Gu = M((vs) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
Object.defineProperty(vs, "__esModule", { value: !0 }); | |
var ms = class { | |
constructor(e) { | |
(this.aliasToTopic = {}), (this.max = e); | |
} | |
put(e, r) { | |
return r === 0 || r > this.max | |
? !1 | |
: ((this.aliasToTopic[r] = e), | |
(this.length = Object.keys(this.aliasToTopic).length), | |
!0); | |
} | |
getTopicByAlias(e) { | |
return this.aliasToTopic[e]; | |
} | |
clear() { | |
this.aliasToTopic = {}; | |
} | |
}; | |
vs.default = ms; | |
}); | |
var ce = M((AA, Qu) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
Qu.exports = { | |
ArrayIsArray(t) { | |
return Array.isArray(t); | |
}, | |
ArrayPrototypeIncludes(t, e) { | |
return t.includes(e); | |
}, | |
ArrayPrototypeIndexOf(t, e) { | |
return t.indexOf(e); | |
}, | |
ArrayPrototypeJoin(t, e) { | |
return t.join(e); | |
}, | |
ArrayPrototypeMap(t, e) { | |
return t.map(e); | |
}, | |
ArrayPrototypePop(t, e) { | |
return t.pop(e); | |
}, | |
ArrayPrototypePush(t, e) { | |
return t.push(e); | |
}, | |
ArrayPrototypeSlice(t, e, r) { | |
return t.slice(e, r); | |
}, | |
Error, | |
FunctionPrototypeCall(t, e, ...r) { | |
return t.call(e, ...r); | |
}, | |
FunctionPrototypeSymbolHasInstance(t, e) { | |
return Function.prototype[Symbol.hasInstance].call(t, e); | |
}, | |
MathFloor: Math.floor, | |
Number, | |
NumberIsInteger: Number.isInteger, | |
NumberIsNaN: Number.isNaN, | |
NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER, | |
NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER, | |
NumberParseInt: Number.parseInt, | |
ObjectDefineProperties(t, e) { | |
return Object.defineProperties(t, e); | |
}, | |
ObjectDefineProperty(t, e, r) { | |
return Object.defineProperty(t, e, r); | |
}, | |
ObjectGetOwnPropertyDescriptor(t, e) { | |
return Object.getOwnPropertyDescriptor(t, e); | |
}, | |
ObjectKeys(t) { | |
return Object.keys(t); | |
}, | |
ObjectSetPrototypeOf(t, e) { | |
return Object.setPrototypeOf(t, e); | |
}, | |
Promise, | |
PromisePrototypeCatch(t, e) { | |
return t.catch(e); | |
}, | |
PromisePrototypeThen(t, e, r) { | |
return t.then(e, r); | |
}, | |
PromiseReject(t) { | |
return Promise.reject(t); | |
}, | |
ReflectApply: Reflect.apply, | |
RegExpPrototypeTest(t, e) { | |
return t.test(e); | |
}, | |
SafeSet: Set, | |
String, | |
StringPrototypeSlice(t, e, r) { | |
return t.slice(e, r); | |
}, | |
StringPrototypeToLowerCase(t) { | |
return t.toLowerCase(); | |
}, | |
StringPrototypeToUpperCase(t) { | |
return t.toUpperCase(); | |
}, | |
StringPrototypeTrim(t) { | |
return t.trim(); | |
}, | |
Symbol, | |
SymbolFor: Symbol.for, | |
SymbolAsyncIterator: Symbol.asyncIterator, | |
SymbolHasInstance: Symbol.hasInstance, | |
SymbolIterator: Symbol.iterator, | |
TypedArrayPrototypeSet(t, e, r) { | |
return t.set(e, r); | |
}, | |
Uint8Array, | |
}; | |
}); | |
var Je = M((kA, Ss) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var iy = (be(), X(me)), | |
ny = Object.getPrototypeOf(async function () {}).constructor, | |
Yu = globalThis.Blob || iy.Blob, | |
sy = | |
typeof Yu < "u" | |
? function (e) { | |
return e instanceof Yu; | |
} | |
: function (e) { | |
return !1; | |
}, | |
Es = class extends Error { | |
constructor(e) { | |
if (!Array.isArray(e)) | |
throw new TypeError( | |
`Expected input to be an Array, got ${typeof e}`, | |
); | |
let r = ""; | |
for (let i = 0; i < e.length; i++) | |
r += ` ${e[i].stack} | |
`; | |
super(r), (this.name = "AggregateError"), (this.errors = e); | |
} | |
}; | |
Ss.exports = { | |
AggregateError: Es, | |
kEmptyObject: Object.freeze({}), | |
once(t) { | |
let e = !1; | |
return function (...r) { | |
e || ((e = !0), t.apply(this, r)); | |
}; | |
}, | |
createDeferredPromise: function () { | |
let t, e; | |
return { | |
promise: new Promise((i, n) => { | |
(t = i), (e = n); | |
}), | |
resolve: t, | |
reject: e, | |
}; | |
}, | |
promisify(t) { | |
return new Promise((e, r) => { | |
t((i, ...n) => (i ? r(i) : e(...n))); | |
}); | |
}, | |
debuglog() { | |
return function () {}; | |
}, | |
format(t, ...e) { | |
return t.replace(/%([sdifj])/g, function (...[r, i]) { | |
let n = e.shift(); | |
return i === "f" | |
? n.toFixed(6) | |
: i === "j" | |
? JSON.stringify(n) | |
: i === "s" && typeof n == "object" | |
? `${n.constructor !== Object ? n.constructor.name : ""} {}`.trim() | |
: n.toString(); | |
}); | |
}, | |
inspect(t) { | |
switch (typeof t) { | |
case "string": | |
if (t.includes("'")) | |
if (t.includes('"')) { | |
if (!t.includes("`") && !t.includes("${")) return `\`${t}\``; | |
} else return `"${t}"`; | |
return `'${t}'`; | |
case "number": | |
return isNaN(t) ? "NaN" : Object.is(t, -0) ? String(t) : t; | |
case "bigint": | |
return `${String(t)}n`; | |
case "boolean": | |
case "undefined": | |
return String(t); | |
case "object": | |
return "{}"; | |
} | |
}, | |
types: { | |
isAsyncFunction(t) { | |
return t instanceof ny; | |
}, | |
isArrayBufferView(t) { | |
return ArrayBuffer.isView(t); | |
}, | |
}, | |
isBlob: sy, | |
}; | |
Ss.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); | |
}); | |
var zi = M((qA, Vi) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { AbortController: Ju, AbortSignal: oy } = | |
typeof self < "u" ? self : typeof window < "u" ? window : void 0; | |
Vi.exports = Ju; | |
Vi.exports.AbortSignal = oy; | |
Vi.exports.default = Ju; | |
}); | |
var Ae = M((VA, ef) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { format: ay, inspect: Ki, AggregateError: ly } = Je(), | |
uy = globalThis.AggregateError || ly, | |
fy = Symbol("kIsNodeError"), | |
cy = [ | |
"string", | |
"function", | |
"number", | |
"object", | |
"Function", | |
"Object", | |
"boolean", | |
"bigint", | |
"symbol", | |
], | |
hy = /^([A-Z][a-z0-9]*)+$/, | |
dy = "__node_internal_", | |
Gi = {}; | |
function er(t, e) { | |
if (!t) throw new Gi.ERR_INTERNAL_ASSERTION(e); | |
} | |
function Xu(t) { | |
let e = "", | |
r = t.length, | |
i = t[0] === "-" ? 1 : 0; | |
for (; r >= i + 4; r -= 3) e = `_${t.slice(r - 3, r)}${e}`; | |
return `${t.slice(0, r)}${e}`; | |
} | |
function py(t, e, r) { | |
if (typeof e == "function") | |
return ( | |
er( | |
e.length <= r.length, | |
`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`, | |
), | |
e(...r) | |
); | |
let i = (e.match(/%[dfijoOs]/g) || []).length; | |
return ( | |
er( | |
i === r.length, | |
`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`, | |
), | |
r.length === 0 ? e : ay(e, ...r) | |
); | |
} | |
function ve(t, e, r) { | |
r || (r = Error); | |
class i extends r { | |
constructor(...o) { | |
super(py(t, e, o)); | |
} | |
toString() { | |
return `${this.name} [${t}]: ${this.message}`; | |
} | |
} | |
Object.defineProperties(i.prototype, { | |
name: { value: r.name, writable: !0, enumerable: !1, configurable: !0 }, | |
toString: { | |
value() { | |
return `${this.name} [${t}]: ${this.message}`; | |
}, | |
writable: !0, | |
enumerable: !1, | |
configurable: !0, | |
}, | |
}), | |
(i.prototype.code = t), | |
(i.prototype[fy] = !0), | |
(Gi[t] = i); | |
} | |
function Zu(t) { | |
let e = dy + t.name; | |
return Object.defineProperty(t, "name", { value: e }), t; | |
} | |
function gy(t, e) { | |
if (t && e && t !== e) { | |
if (Array.isArray(e.errors)) return e.errors.push(t), e; | |
let r = new uy([e, t], e.message); | |
return (r.code = e.code), r; | |
} | |
return t || e; | |
} | |
var As = class extends Error { | |
constructor(e = "The operation was aborted", r = void 0) { | |
if (r !== void 0 && typeof r != "object") | |
throw new Gi.ERR_INVALID_ARG_TYPE("options", "Object", r); | |
super(e, r), (this.code = "ABORT_ERR"), (this.name = "AbortError"); | |
} | |
}; | |
ve("ERR_ASSERTION", "%s", Error); | |
ve( | |
"ERR_INVALID_ARG_TYPE", | |
(t, e, r) => { | |
er(typeof t == "string", "'name' must be a string"), | |
Array.isArray(e) || (e = [e]); | |
let i = "The "; | |
t.endsWith(" argument") | |
? (i += `${t} `) | |
: (i += `"${t}" ${t.includes(".") ? "property" : "argument"} `), | |
(i += "must be "); | |
let n = [], | |
o = [], | |
s = []; | |
for (let l of e) | |
er( | |
typeof l == "string", | |
"All expected entries have to be of type string", | |
), | |
cy.includes(l) | |
? n.push(l.toLowerCase()) | |
: hy.test(l) | |
? o.push(l) | |
: (er( | |
l !== "object", | |
'The value "object" should be written as "Object"', | |
), | |
s.push(l)); | |
if (o.length > 0) { | |
let l = n.indexOf("object"); | |
l !== -1 && (n.splice(n, l, 1), o.push("Object")); | |
} | |
if (n.length > 0) { | |
switch (n.length) { | |
case 1: | |
i += `of type ${n[0]}`; | |
break; | |
case 2: | |
i += `one of type ${n[0]} or ${n[1]}`; | |
break; | |
default: { | |
let l = n.pop(); | |
i += `one of type ${n.join(", ")}, or ${l}`; | |
} | |
} | |
(o.length > 0 || s.length > 0) && (i += " or "); | |
} | |
if (o.length > 0) { | |
switch (o.length) { | |
case 1: | |
i += `an instance of ${o[0]}`; | |
break; | |
case 2: | |
i += `an instance of ${o[0]} or ${o[1]}`; | |
break; | |
default: { | |
let l = o.pop(); | |
i += `an instance of ${o.join(", ")}, or ${l}`; | |
} | |
} | |
s.length > 0 && (i += " or "); | |
} | |
switch (s.length) { | |
case 0: | |
break; | |
case 1: | |
s[0].toLowerCase() !== s[0] && (i += "an "), (i += `${s[0]}`); | |
break; | |
case 2: | |
i += `one of ${s[0]} or ${s[1]}`; | |
break; | |
default: { | |
let l = s.pop(); | |
i += `one of ${s.join(", ")}, or ${l}`; | |
} | |
} | |
if (r == null) i += `. Received ${r}`; | |
else if (typeof r == "function" && r.name) | |
i += `. Received function ${r.name}`; | |
else if (typeof r == "object") { | |
var a; | |
if ((a = r.constructor) !== null && a !== void 0 && a.name) | |
i += `. Received an instance of ${r.constructor.name}`; | |
else { | |
let l = Ki(r, { depth: -1 }); | |
i += `. Received ${l}`; | |
} | |
} else { | |
let l = Ki(r, { colors: !1 }); | |
l.length > 25 && (l = `${l.slice(0, 25)}...`), | |
(i += `. Received type ${typeof r} (${l})`); | |
} | |
return i; | |
}, | |
TypeError, | |
); | |
ve( | |
"ERR_INVALID_ARG_VALUE", | |
(t, e, r = "is invalid") => { | |
let i = Ki(e); | |
return ( | |
i.length > 128 && (i = i.slice(0, 128) + "..."), | |
`The ${t.includes(".") ? "property" : "argument"} '${t}' ${r}. Received ${i}` | |
); | |
}, | |
TypeError, | |
); | |
ve( | |
"ERR_INVALID_RETURN_VALUE", | |
(t, e, r) => { | |
var i; | |
let n = | |
r != null && (i = r.constructor) !== null && i !== void 0 && i.name | |
? `instance of ${r.constructor.name}` | |
: `type ${typeof r}`; | |
return `Expected ${t} to be returned from the "${e}" function but got ${n}.`; | |
}, | |
TypeError, | |
); | |
ve( | |
"ERR_MISSING_ARGS", | |
(...t) => { | |
er(t.length > 0, "At least one arg needs to be specified"); | |
let e, | |
r = t.length; | |
switch ( | |
((t = (Array.isArray(t) ? t : [t]).map((i) => `"${i}"`).join(" or ")), | |
r) | |
) { | |
case 1: | |
e += `The ${t[0]} argument`; | |
break; | |
case 2: | |
e += `The ${t[0]} and ${t[1]} arguments`; | |
break; | |
default: | |
{ | |
let i = t.pop(); | |
e += `The ${t.join(", ")}, and ${i} arguments`; | |
} | |
break; | |
} | |
return `${e} must be specified`; | |
}, | |
TypeError, | |
); | |
ve( | |
"ERR_OUT_OF_RANGE", | |
(t, e, r) => { | |
er(e, 'Missing "range" argument'); | |
let i; | |
return ( | |
Number.isInteger(r) && Math.abs(r) > 2 ** 32 | |
? (i = Xu(String(r))) | |
: typeof r == "bigint" | |
? ((i = String(r)), | |
(r > 2n ** 32n || r < -(2n ** 32n)) && (i = Xu(i)), | |
(i += "n")) | |
: (i = Ki(r)), | |
`The value of "${t}" is out of range. It must be ${e}. Received ${i}` | |
); | |
}, | |
RangeError, | |
); | |
ve("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); | |
ve("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); | |
ve( | |
"ERR_STREAM_ALREADY_FINISHED", | |
"Cannot call %s after a stream was finished", | |
Error, | |
); | |
ve("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); | |
ve( | |
"ERR_STREAM_DESTROYED", | |
"Cannot call %s after a stream was destroyed", | |
Error, | |
); | |
ve( | |
"ERR_STREAM_NULL_VALUES", | |
"May not write null values to stream", | |
TypeError, | |
); | |
ve("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); | |
ve("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); | |
ve( | |
"ERR_STREAM_UNSHIFT_AFTER_END_EVENT", | |
"stream.unshift() after end event", | |
Error, | |
); | |
ve("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); | |
ve("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); | |
ef.exports = { | |
AbortError: As, | |
aggregateTwoErrors: Zu(gy), | |
hideStackFrames: Zu, | |
codes: Gi, | |
}; | |
}); | |
var hi = M((XA, ff) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { | |
ArrayIsArray: Ts, | |
ArrayPrototypeIncludes: sf, | |
ArrayPrototypeJoin: of, | |
ArrayPrototypeMap: yy, | |
NumberIsInteger: Rs, | |
NumberIsNaN: by, | |
NumberMAX_SAFE_INTEGER: wy, | |
NumberMIN_SAFE_INTEGER: _y, | |
NumberParseInt: my, | |
ObjectPrototypeHasOwnProperty: vy, | |
RegExpPrototypeExec: af, | |
String: Ey, | |
StringPrototypeToUpperCase: Sy, | |
StringPrototypeTrim: Ay, | |
} = ce(), | |
{ | |
hideStackFrames: Ue, | |
codes: { | |
ERR_SOCKET_BAD_PORT: Iy, | |
ERR_INVALID_ARG_TYPE: Ie, | |
ERR_INVALID_ARG_VALUE: Ur, | |
ERR_OUT_OF_RANGE: tr, | |
ERR_UNKNOWN_SIGNAL: tf, | |
}, | |
} = Ae(), | |
{ normalizeEncoding: Ty } = Je(), | |
{ isAsyncFunction: Ry, isArrayBufferView: Cy } = Je().types, | |
rf = {}; | |
function By(t) { | |
return t === (t | 0); | |
} | |
function Py(t) { | |
return t === t >>> 0; | |
} | |
var ky = /^[0-7]+$/, | |
Oy = "must be a 32-bit unsigned integer or an octal string"; | |
function xy(t, e, r) { | |
if ((typeof t > "u" && (t = r), typeof t == "string")) { | |
if (af(ky, t) === null) throw new Ur(e, t, Oy); | |
t = my(t, 8); | |
} | |
return lf(t, e), t; | |
} | |
var My = Ue((t, e, r = _y, i = wy) => { | |
if (typeof t != "number") throw new Ie(e, "number", t); | |
if (!Rs(t)) throw new tr(e, "an integer", t); | |
if (t < r || t > i) throw new tr(e, `>= ${r} && <= ${i}`, t); | |
}), | |
Ly = Ue((t, e, r = -2147483648, i = 2147483647) => { | |
if (typeof t != "number") throw new Ie(e, "number", t); | |
if (!Rs(t)) throw new tr(e, "an integer", t); | |
if (t < r || t > i) throw new tr(e, `>= ${r} && <= ${i}`, t); | |
}), | |
lf = Ue((t, e, r = !1) => { | |
if (typeof t != "number") throw new Ie(e, "number", t); | |
if (!Rs(t)) throw new tr(e, "an integer", t); | |
let i = r ? 1 : 0, | |
n = 4294967295; | |
if (t < i || t > n) throw new tr(e, `>= ${i} && <= ${n}`, t); | |
}); | |
function Cs(t, e) { | |
if (typeof t != "string") throw new Ie(e, "string", t); | |
} | |
function Uy(t, e, r = void 0, i) { | |
if (typeof t != "number") throw new Ie(e, "number", t); | |
if ( | |
(r != null && t < r) || | |
(i != null && t > i) || | |
((r != null || i != null) && by(t)) | |
) | |
throw new tr( | |
e, | |
`${r != null ? `>= ${r}` : ""}${r != null && i != null ? " && " : ""}${i != null ? `<= ${i}` : ""}`, | |
t, | |
); | |
} | |
var Ny = Ue((t, e, r) => { | |
if (!sf(r, t)) { | |
let n = | |
"must be one of: " + | |
of( | |
yy(r, (o) => (typeof o == "string" ? `'${o}'` : Ey(o))), | |
", ", | |
); | |
throw new Ur(e, t, n); | |
} | |
}); | |
function uf(t, e) { | |
if (typeof t != "boolean") throw new Ie(e, "boolean", t); | |
} | |
function Is(t, e, r) { | |
return t == null || !vy(t, e) ? r : t[e]; | |
} | |
var qy = Ue((t, e, r = null) => { | |
let i = Is(r, "allowArray", !1), | |
n = Is(r, "allowFunction", !1); | |
if ( | |
(!Is(r, "nullable", !1) && t === null) || | |
(!i && Ts(t)) || | |
(typeof t != "object" && (!n || typeof t != "function")) | |
) | |
throw new Ie(e, "Object", t); | |
}), | |
Dy = Ue((t, e) => { | |
if (t != null && typeof t != "object" && typeof t != "function") | |
throw new Ie(e, "a dictionary", t); | |
}), | |
Bs = Ue((t, e, r = 0) => { | |
if (!Ts(t)) throw new Ie(e, "Array", t); | |
if (t.length < r) { | |
let i = `must be longer than ${r}`; | |
throw new Ur(e, t, i); | |
} | |
}); | |
function jy(t, e) { | |
Bs(t, e); | |
for (let r = 0; r < t.length; r++) Cs(t[r], `${e}[${r}]`); | |
} | |
function Fy(t, e) { | |
Bs(t, e); | |
for (let r = 0; r < t.length; r++) uf(t[r], `${e}[${r}]`); | |
} | |
function Wy(t, e = "signal") { | |
if ((Cs(t, e), rf[t] === void 0)) | |
throw rf[Sy(t)] !== void 0 | |
? new tf(t + " (signals must use all capital letters)") | |
: new tf(t); | |
} | |
var $y = Ue((t, e = "buffer") => { | |
if (!Cy(t)) throw new Ie(e, ["Buffer", "TypedArray", "DataView"], t); | |
}); | |
function Hy(t, e) { | |
let r = Ty(e), | |
i = t.length; | |
if (r === "hex" && i % 2 !== 0) | |
throw new Ur("encoding", e, `is invalid for data of length ${i}`); | |
} | |
function Vy(t, e = "Port", r = !0) { | |
if ( | |
(typeof t != "number" && typeof t != "string") || | |
(typeof t == "string" && Ay(t).length === 0) || | |
+t !== +t >>> 0 || | |
t > 65535 || | |
(t === 0 && !r) | |
) | |
throw new Iy(e, t, r); | |
return t | 0; | |
} | |
var zy = Ue((t, e) => { | |
if ( | |
t !== void 0 && | |
(t === null || typeof t != "object" || !("aborted" in t)) | |
) | |
throw new Ie(e, "AbortSignal", t); | |
}), | |
Ky = Ue((t, e) => { | |
if (typeof t != "function") throw new Ie(e, "Function", t); | |
}), | |
Gy = Ue((t, e) => { | |
if (typeof t != "function" || Ry(t)) throw new Ie(e, "Function", t); | |
}), | |
Qy = Ue((t, e) => { | |
if (t !== void 0) throw new Ie(e, "undefined", t); | |
}); | |
function Yy(t, e, r) { | |
if (!sf(r, t)) throw new Ie(e, `('${of(r, "|")}')`, t); | |
} | |
var Jy = /^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/; | |
function nf(t, e) { | |
if (typeof t > "u" || !af(Jy, t)) | |
throw new Ur( | |
e, | |
t, | |
'must be an array or string of format "</styles.css>; rel=preload; as=style"', | |
); | |
} | |
function Xy(t) { | |
if (typeof t == "string") return nf(t, "hints"), t; | |
if (Ts(t)) { | |
let e = t.length, | |
r = ""; | |
if (e === 0) return r; | |
for (let i = 0; i < e; i++) { | |
let n = t[i]; | |
nf(n, "hints"), (r += n), i !== e - 1 && (r += ", "); | |
} | |
return r; | |
} | |
throw new Ur( | |
"hints", | |
t, | |
'must be an array or string of format "</styles.css>; rel=preload; as=style"', | |
); | |
} | |
ff.exports = { | |
isInt32: By, | |
isUint32: Py, | |
parseFileMode: xy, | |
validateArray: Bs, | |
validateStringArray: jy, | |
validateBooleanArray: Fy, | |
validateBoolean: uf, | |
validateBuffer: $y, | |
validateDictionary: Dy, | |
validateEncoding: Hy, | |
validateFunction: Ky, | |
validateInt32: Ly, | |
validateInteger: My, | |
validateNumber: Uy, | |
validateObject: qy, | |
validateOneOf: Ny, | |
validatePlainFunction: Gy, | |
validatePort: Vy, | |
validateSignalName: Wy, | |
validateString: Cs, | |
validateUint32: lf, | |
validateUndefined: Qy, | |
validateUnion: Yy, | |
validateAbortSignal: zy, | |
validateLinkHeaderValue: Xy, | |
}; | |
}); | |
var Nt = M((sI, pf) => { | |
_(); | |
v(); | |
m(); | |
var ae = (pf.exports = {}), | |
Xe, | |
Ze; | |
function Ps() { | |
throw new Error("setTimeout has not been defined"); | |
} | |
function ks() { | |
throw new Error("clearTimeout has not been defined"); | |
} | |
(function () { | |
try { | |
typeof setTimeout == "function" ? (Xe = setTimeout) : (Xe = Ps); | |
} catch { | |
Xe = Ps; | |
} | |
try { | |
typeof clearTimeout == "function" ? (Ze = clearTimeout) : (Ze = ks); | |
} catch { | |
Ze = ks; | |
} | |
})(); | |
function cf(t) { | |
if (Xe === setTimeout) return setTimeout(t, 0); | |
if ((Xe === Ps || !Xe) && setTimeout) | |
return (Xe = setTimeout), setTimeout(t, 0); | |
try { | |
return Xe(t, 0); | |
} catch { | |
try { | |
return Xe.call(null, t, 0); | |
} catch { | |
return Xe.call(this, t, 0); | |
} | |
} | |
} | |
function Zy(t) { | |
if (Ze === clearTimeout) return clearTimeout(t); | |
if ((Ze === ks || !Ze) && clearTimeout) | |
return (Ze = clearTimeout), clearTimeout(t); | |
try { | |
return Ze(t); | |
} catch { | |
try { | |
return Ze.call(null, t); | |
} catch { | |
return Ze.call(this, t); | |
} | |
} | |
} | |
var _t = [], | |
Nr = !1, | |
rr, | |
Qi = -1; | |
function eb() { | |
!Nr || | |
!rr || | |
((Nr = !1), | |
rr.length ? (_t = rr.concat(_t)) : (Qi = -1), | |
_t.length && hf()); | |
} | |
function hf() { | |
if (!Nr) { | |
var t = cf(eb); | |
Nr = !0; | |
for (var e = _t.length; e; ) { | |
for (rr = _t, _t = []; ++Qi < e; ) rr && rr[Qi].run(); | |
(Qi = -1), (e = _t.length); | |
} | |
(rr = null), (Nr = !1), Zy(t); | |
} | |
} | |
ae.nextTick = function (t) { | |
var e = new Array(arguments.length - 1); | |
if (arguments.length > 1) | |
for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; | |
_t.push(new df(t, e)), _t.length === 1 && !Nr && cf(hf); | |
}; | |
function df(t, e) { | |
(this.fun = t), (this.array = e); | |
} | |
df.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
ae.title = "browser"; | |
ae.browser = !0; | |
ae.env = {}; | |
ae.argv = []; | |
ae.version = ""; | |
ae.versions = {}; | |
function mt() {} | |
ae.on = mt; | |
ae.addListener = mt; | |
ae.once = mt; | |
ae.off = mt; | |
ae.removeListener = mt; | |
ae.removeAllListeners = mt; | |
ae.emit = mt; | |
ae.prependListener = mt; | |
ae.prependOnceListener = mt; | |
ae.listeners = function (t) { | |
return []; | |
}; | |
ae.binding = function (t) { | |
throw new Error("process.binding is not supported"); | |
}; | |
ae.cwd = function () { | |
return "/"; | |
}; | |
ae.chdir = function (t) { | |
throw new Error("process.chdir is not supported"); | |
}; | |
ae.umask = function () { | |
return 0; | |
}; | |
}); | |
var tt = M((hI, Pf) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { | |
Symbol: Yi, | |
SymbolAsyncIterator: gf, | |
SymbolIterator: yf, | |
SymbolFor: bf, | |
} = ce(), | |
wf = Yi("kDestroyed"), | |
_f = Yi("kIsErrored"), | |
Os = Yi("kIsReadable"), | |
mf = Yi("kIsDisturbed"), | |
tb = bf("nodejs.webstream.isClosedPromise"), | |
rb = bf("nodejs.webstream.controllerErrorFunction"); | |
function Ji(t, e = !1) { | |
var r; | |
return !!( | |
t && | |
typeof t.pipe == "function" && | |
typeof t.on == "function" && | |
(!e || | |
(typeof t.pause == "function" && typeof t.resume == "function")) && | |
(!t._writableState || | |
((r = t._readableState) === null || r === void 0 | |
? void 0 | |
: r.readable) !== !1) && | |
(!t._writableState || t._readableState) | |
); | |
} | |
function Xi(t) { | |
var e; | |
return !!( | |
t && | |
typeof t.write == "function" && | |
typeof t.on == "function" && | |
(!t._readableState || | |
((e = t._writableState) === null || e === void 0 | |
? void 0 | |
: e.writable) !== !1) | |
); | |
} | |
function ib(t) { | |
return !!( | |
t && | |
typeof t.pipe == "function" && | |
t._readableState && | |
typeof t.on == "function" && | |
typeof t.write == "function" | |
); | |
} | |
function et(t) { | |
return ( | |
t && | |
(t._readableState || | |
t._writableState || | |
(typeof t.write == "function" && typeof t.on == "function") || | |
(typeof t.pipe == "function" && typeof t.on == "function")) | |
); | |
} | |
function vf(t) { | |
return !!( | |
t && | |
!et(t) && | |
typeof t.pipeThrough == "function" && | |
typeof t.getReader == "function" && | |
typeof t.cancel == "function" | |
); | |
} | |
function Ef(t) { | |
return !!( | |
t && | |
!et(t) && | |
typeof t.getWriter == "function" && | |
typeof t.abort == "function" | |
); | |
} | |
function Sf(t) { | |
return !!( | |
t && | |
!et(t) && | |
typeof t.readable == "object" && | |
typeof t.writable == "object" | |
); | |
} | |
function nb(t) { | |
return vf(t) || Ef(t) || Sf(t); | |
} | |
function sb(t, e) { | |
return t == null | |
? !1 | |
: e === !0 | |
? typeof t[gf] == "function" | |
: e === !1 | |
? typeof t[yf] == "function" | |
: typeof t[gf] == "function" || typeof t[yf] == "function"; | |
} | |
function Zi(t) { | |
if (!et(t)) return null; | |
let e = t._writableState, | |
r = t._readableState, | |
i = e || r; | |
return !!(t.destroyed || t[wf] || (i != null && i.destroyed)); | |
} | |
function Af(t) { | |
if (!Xi(t)) return null; | |
if (t.writableEnded === !0) return !0; | |
let e = t._writableState; | |
return e != null && e.errored | |
? !1 | |
: typeof e?.ended != "boolean" | |
? null | |
: e.ended; | |
} | |
function ob(t, e) { | |
if (!Xi(t)) return null; | |
if (t.writableFinished === !0) return !0; | |
let r = t._writableState; | |
return r != null && r.errored | |
? !1 | |
: typeof r?.finished != "boolean" | |
? null | |
: !!(r.finished || (e === !1 && r.ended === !0 && r.length === 0)); | |
} | |
function ab(t) { | |
if (!Ji(t)) return null; | |
if (t.readableEnded === !0) return !0; | |
let e = t._readableState; | |
return !e || e.errored | |
? !1 | |
: typeof e?.ended != "boolean" | |
? null | |
: e.ended; | |
} | |
function If(t, e) { | |
if (!Ji(t)) return null; | |
let r = t._readableState; | |
return r != null && r.errored | |
? !1 | |
: typeof r?.endEmitted != "boolean" | |
? null | |
: !!(r.endEmitted || (e === !1 && r.ended === !0 && r.length === 0)); | |
} | |
function Tf(t) { | |
return t && t[Os] != null | |
? t[Os] | |
: typeof t?.readable != "boolean" | |
? null | |
: Zi(t) | |
? !1 | |
: Ji(t) && t.readable && !If(t); | |
} | |
function Rf(t) { | |
return typeof t?.writable != "boolean" | |
? null | |
: Zi(t) | |
? !1 | |
: Xi(t) && t.writable && !Af(t); | |
} | |
function lb(t, e) { | |
return et(t) | |
? Zi(t) | |
? !0 | |
: !((e?.readable !== !1 && Tf(t)) || (e?.writable !== !1 && Rf(t))) | |
: null; | |
} | |
function ub(t) { | |
var e, r; | |
return et(t) | |
? t.writableErrored | |
? t.writableErrored | |
: (e = | |
(r = t._writableState) === null || r === void 0 | |
? void 0 | |
: r.errored) !== null && e !== void 0 | |
? e | |
: null | |
: null; | |
} | |
function fb(t) { | |
var e, r; | |
return et(t) | |
? t.readableErrored | |
? t.readableErrored | |
: (e = | |
(r = t._readableState) === null || r === void 0 | |
? void 0 | |
: r.errored) !== null && e !== void 0 | |
? e | |
: null | |
: null; | |
} | |
function cb(t) { | |
if (!et(t)) return null; | |
if (typeof t.closed == "boolean") return t.closed; | |
let e = t._writableState, | |
r = t._readableState; | |
return typeof e?.closed == "boolean" || typeof r?.closed == "boolean" | |
? e?.closed || r?.closed | |
: typeof t._closed == "boolean" && Cf(t) | |
? t._closed | |
: null; | |
} | |
function Cf(t) { | |
return ( | |
typeof t._closed == "boolean" && | |
typeof t._defaultKeepAlive == "boolean" && | |
typeof t._removedConnection == "boolean" && | |
typeof t._removedContLen == "boolean" | |
); | |
} | |
function Bf(t) { | |
return typeof t._sent100 == "boolean" && Cf(t); | |
} | |
function hb(t) { | |
var e; | |
return ( | |
typeof t._consuming == "boolean" && | |
typeof t._dumped == "boolean" && | |
((e = t.req) === null || e === void 0 ? void 0 : e.upgradeOrConnect) === | |
void 0 | |
); | |
} | |
function db(t) { | |
if (!et(t)) return null; | |
let e = t._writableState, | |
r = t._readableState, | |
i = e || r; | |
return ( | |
(!i && Bf(t)) || | |
!!(i && i.autoDestroy && i.emitClose && i.closed === !1) | |
); | |
} | |
function pb(t) { | |
var e; | |
return !!( | |
t && | |
((e = t[mf]) !== null && e !== void 0 | |
? e | |
: t.readableDidRead || t.readableAborted) | |
); | |
} | |
function gb(t) { | |
var e, r, i, n, o, s, a, l, c, h; | |
return !!( | |
t && | |
((e = | |
(r = | |
(i = | |
(n = | |
(o = | |
(s = t[_f]) !== null && s !== void 0 | |
? s | |
: t.readableErrored) !== null && o !== void 0 | |
? o | |
: t.writableErrored) !== null && n !== void 0 | |
? n | |
: (a = t._readableState) === null || a === void 0 | |
? void 0 | |
: a.errorEmitted) !== null && i !== void 0 | |
? i | |
: (l = t._writableState) === null || l === void 0 | |
? void 0 | |
: l.errorEmitted) !== null && r !== void 0 | |
? r | |
: (c = t._readableState) === null || c === void 0 | |
? void 0 | |
: c.errored) !== null && e !== void 0 | |
? e | |
: !((h = t._writableState) === null || h === void 0) && h.errored) | |
); | |
} | |
Pf.exports = { | |
kDestroyed: wf, | |
isDisturbed: pb, | |
kIsDisturbed: mf, | |
isErrored: gb, | |
kIsErrored: _f, | |
isReadable: Tf, | |
kIsReadable: Os, | |
kIsClosedPromise: tb, | |
kControllerErrorFunction: rb, | |
isClosed: cb, | |
isDestroyed: Zi, | |
isDuplexNodeStream: ib, | |
isFinished: lb, | |
isIterable: sb, | |
isReadableNodeStream: Ji, | |
isReadableStream: vf, | |
isReadableEnded: ab, | |
isReadableFinished: If, | |
isReadableErrored: fb, | |
isNodeStream: et, | |
isWebStream: nb, | |
isWritable: Rf, | |
isWritableNodeStream: Xi, | |
isWritableStream: Ef, | |
isWritableEnded: Af, | |
isWritableFinished: ob, | |
isWritableErrored: ub, | |
isServerRequest: hb, | |
isServerResponse: Bf, | |
willEmitClose: db, | |
isTransformStream: Sf, | |
}; | |
}); | |
var vt = M((_I, Ns) => { | |
_(); | |
v(); | |
m(); | |
var qt = Nt(), | |
{ AbortError: Df, codes: yb } = Ae(), | |
{ ERR_INVALID_ARG_TYPE: bb, ERR_STREAM_PREMATURE_CLOSE: kf } = yb, | |
{ kEmptyObject: Ms, once: Ls } = Je(), | |
{ | |
validateAbortSignal: wb, | |
validateFunction: _b, | |
validateObject: mb, | |
validateBoolean: vb, | |
} = hi(), | |
{ Promise: Eb, PromisePrototypeThen: Sb } = ce(), | |
{ | |
isClosed: Ab, | |
isReadable: Of, | |
isReadableNodeStream: xs, | |
isReadableStream: Ib, | |
isReadableFinished: xf, | |
isReadableErrored: Mf, | |
isWritable: Lf, | |
isWritableNodeStream: Uf, | |
isWritableStream: Tb, | |
isWritableFinished: Nf, | |
isWritableErrored: qf, | |
isNodeStream: Rb, | |
willEmitClose: Cb, | |
kIsClosedPromise: Bb, | |
} = tt(); | |
function Pb(t) { | |
return t.setHeader && typeof t.abort == "function"; | |
} | |
var Us = () => {}; | |
function jf(t, e, r) { | |
var i, n; | |
if ( | |
(arguments.length === 2 | |
? ((r = e), (e = Ms)) | |
: e == null | |
? (e = Ms) | |
: mb(e, "options"), | |
_b(r, "callback"), | |
wb(e.signal, "options.signal"), | |
(r = Ls(r)), | |
Ib(t) || Tb(t)) | |
) | |
return kb(t, e, r); | |
if (!Rb(t)) | |
throw new bb( | |
"stream", | |
["ReadableStream", "WritableStream", "Stream"], | |
t, | |
); | |
let o = (i = e.readable) !== null && i !== void 0 ? i : xs(t), | |
s = (n = e.writable) !== null && n !== void 0 ? n : Uf(t), | |
a = t._writableState, | |
l = t._readableState, | |
c = () => { | |
t.writable || g(); | |
}, | |
h = Cb(t) && xs(t) === o && Uf(t) === s, | |
d = Nf(t, !1), | |
g = () => { | |
(d = !0), | |
t.destroyed && (h = !1), | |
!(h && (!t.readable || o)) && (!o || y) && r.call(t); | |
}, | |
y = xf(t, !1), | |
w = () => { | |
(y = !0), | |
t.destroyed && (h = !1), | |
!(h && (!t.writable || s)) && (!s || d) && r.call(t); | |
}, | |
S = (N) => { | |
r.call(t, N); | |
}, | |
E = Ab(t), | |
I = () => { | |
E = !0; | |
let N = qf(t) || Mf(t); | |
if (N && typeof N != "boolean") return r.call(t, N); | |
if (o && !y && xs(t, !0) && !xf(t, !1)) return r.call(t, new kf()); | |
if (s && !d && !Nf(t, !1)) return r.call(t, new kf()); | |
r.call(t); | |
}, | |
C = () => { | |
E = !0; | |
let N = qf(t) || Mf(t); | |
if (N && typeof N != "boolean") return r.call(t, N); | |
r.call(t); | |
}, | |
R = () => { | |
t.req.on("finish", g); | |
}; | |
Pb(t) | |
? (t.on("complete", g), | |
h || t.on("abort", I), | |
t.req ? R() : t.on("request", R)) | |
: s && !a && (t.on("end", c), t.on("close", c)), | |
!h && typeof t.aborted == "boolean" && t.on("aborted", I), | |
t.on("end", w), | |
t.on("finish", g), | |
e.error !== !1 && t.on("error", S), | |
t.on("close", I), | |
E | |
? qt.nextTick(I) | |
: (a != null && a.errorEmitted) || (l != null && l.errorEmitted) | |
? h || qt.nextTick(C) | |
: ((!o && (!h || Of(t)) && (d || Lf(t) === !1)) || | |
(!s && (!h || Lf(t)) && (y || Of(t) === !1)) || | |
(l && t.req && t.aborted)) && | |
qt.nextTick(C); | |
let U = () => { | |
(r = Us), | |
t.removeListener("aborted", I), | |
t.removeListener("complete", g), | |
t.removeListener("abort", I), | |
t.removeListener("request", R), | |
t.req && t.req.removeListener("finish", g), | |
t.removeListener("end", c), | |
t.removeListener("close", c), | |
t.removeListener("finish", g), | |
t.removeListener("end", w), | |
t.removeListener("error", S), | |
t.removeListener("close", I); | |
}; | |
if (e.signal && !E) { | |
let N = () => { | |
let W = r; | |
U(), W.call(t, new Df(void 0, { cause: e.signal.reason })); | |
}; | |
if (e.signal.aborted) qt.nextTick(N); | |
else { | |
let W = r; | |
(r = Ls((...K) => { | |
e.signal.removeEventListener("abort", N), W.apply(t, K); | |
})), | |
e.signal.addEventListener("abort", N); | |
} | |
} | |
return U; | |
} | |
function kb(t, e, r) { | |
let i = !1, | |
n = Us; | |
if (e.signal) | |
if ( | |
((n = () => { | |
(i = !0), r.call(t, new Df(void 0, { cause: e.signal.reason })); | |
}), | |
e.signal.aborted) | |
) | |
qt.nextTick(n); | |
else { | |
let s = r; | |
(r = Ls((...a) => { | |
e.signal.removeEventListener("abort", n), s.apply(t, a); | |
})), | |
e.signal.addEventListener("abort", n); | |
} | |
let o = (...s) => { | |
i || qt.nextTick(() => r.apply(t, s)); | |
}; | |
return Sb(t[Bb].promise, o, o), Us; | |
} | |
function Ob(t, e) { | |
var r; | |
let i = !1; | |
return ( | |
e === null && (e = Ms), | |
(r = e) !== null && | |
r !== void 0 && | |
r.cleanup && | |
(vb(e.cleanup, "cleanup"), (i = e.cleanup)), | |
new Eb((n, o) => { | |
let s = jf(t, e, (a) => { | |
i && s(), a ? o(a) : n(); | |
}); | |
}) | |
); | |
} | |
Ns.exports = jf; | |
Ns.exports.finished = Ob; | |
}); | |
var ir = M((TI, Gf) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var rt = Nt(), | |
{ | |
aggregateTwoErrors: xb, | |
codes: { ERR_MULTIPLE_CALLBACK: Mb }, | |
AbortError: Lb, | |
} = Ae(), | |
{ Symbol: $f } = ce(), | |
{ | |
kDestroyed: Ub, | |
isDestroyed: Nb, | |
isFinished: qb, | |
isServerRequest: Db, | |
} = tt(), | |
Hf = $f("kDestroy"), | |
qs = $f("kConstruct"); | |
function Vf(t, e, r) { | |
t && | |
(t.stack, | |
e && !e.errored && (e.errored = t), | |
r && !r.errored && (r.errored = t)); | |
} | |
function jb(t, e) { | |
let r = this._readableState, | |
i = this._writableState, | |
n = i || r; | |
return (i != null && i.destroyed) || (r != null && r.destroyed) | |
? (typeof e == "function" && e(), this) | |
: (Vf(t, i, r), | |
i && (i.destroyed = !0), | |
r && (r.destroyed = !0), | |
n.constructed | |
? Ff(this, t, e) | |
: this.once(Hf, function (o) { | |
Ff(this, xb(o, t), e); | |
}), | |
this); | |
} | |
function Ff(t, e, r) { | |
let i = !1; | |
function n(o) { | |
if (i) return; | |
i = !0; | |
let s = t._readableState, | |
a = t._writableState; | |
Vf(o, a, s), | |
a && (a.closed = !0), | |
s && (s.closed = !0), | |
typeof r == "function" && r(o), | |
o ? rt.nextTick(Fb, t, o) : rt.nextTick(zf, t); | |
} | |
try { | |
t._destroy(e || null, n); | |
} catch (o) { | |
n(o); | |
} | |
} | |
function Fb(t, e) { | |
Ds(t, e), zf(t); | |
} | |
function zf(t) { | |
let e = t._readableState, | |
r = t._writableState; | |
r && (r.closeEmitted = !0), | |
e && (e.closeEmitted = !0), | |
((r != null && r.emitClose) || (e != null && e.emitClose)) && | |
t.emit("close"); | |
} | |
function Ds(t, e) { | |
let r = t._readableState, | |
i = t._writableState; | |
(i != null && i.errorEmitted) || | |
(r != null && r.errorEmitted) || | |
(i && (i.errorEmitted = !0), | |
r && (r.errorEmitted = !0), | |
t.emit("error", e)); | |
} | |
function Wb() { | |
let t = this._readableState, | |
e = this._writableState; | |
t && | |
((t.constructed = !0), | |
(t.closed = !1), | |
(t.closeEmitted = !1), | |
(t.destroyed = !1), | |
(t.errored = null), | |
(t.errorEmitted = !1), | |
(t.reading = !1), | |
(t.ended = t.readable === !1), | |
(t.endEmitted = t.readable === !1)), | |
e && | |
((e.constructed = !0), | |
(e.destroyed = !1), | |
(e.closed = !1), | |
(e.closeEmitted = !1), | |
(e.errored = null), | |
(e.errorEmitted = !1), | |
(e.finalCalled = !1), | |
(e.prefinished = !1), | |
(e.ended = e.writable === !1), | |
(e.ending = e.writable === !1), | |
(e.finished = e.writable === !1)); | |
} | |
function js(t, e, r) { | |
let i = t._readableState, | |
n = t._writableState; | |
if ((n != null && n.destroyed) || (i != null && i.destroyed)) return this; | |
(i != null && i.autoDestroy) || (n != null && n.autoDestroy) | |
? t.destroy(e) | |
: e && | |
(e.stack, | |
n && !n.errored && (n.errored = e), | |
i && !i.errored && (i.errored = e), | |
r ? rt.nextTick(Ds, t, e) : Ds(t, e)); | |
} | |
function $b(t, e) { | |
if (typeof t._construct != "function") return; | |
let r = t._readableState, | |
i = t._writableState; | |
r && (r.constructed = !1), | |
i && (i.constructed = !1), | |
t.once(qs, e), | |
!(t.listenerCount(qs) > 1) && rt.nextTick(Hb, t); | |
} | |
function Hb(t) { | |
let e = !1; | |
function r(i) { | |
if (e) { | |
js(t, i ?? new Mb()); | |
return; | |
} | |
e = !0; | |
let n = t._readableState, | |
o = t._writableState, | |
s = o || n; | |
n && (n.constructed = !0), | |
o && (o.constructed = !0), | |
s.destroyed ? t.emit(Hf, i) : i ? js(t, i, !0) : rt.nextTick(Vb, t); | |
} | |
try { | |
t._construct((i) => { | |
rt.nextTick(r, i); | |
}); | |
} catch (i) { | |
rt.nextTick(r, i); | |
} | |
} | |
function Vb(t) { | |
t.emit(qs); | |
} | |
function Wf(t) { | |
return t?.setHeader && typeof t.abort == "function"; | |
} | |
function Kf(t) { | |
t.emit("close"); | |
} | |
function zb(t, e) { | |
t.emit("error", e), rt.nextTick(Kf, t); | |
} | |
function Kb(t, e) { | |
!t || | |
Nb(t) || | |
(!e && !qb(t) && (e = new Lb()), | |
Db(t) | |
? ((t.socket = null), t.destroy(e)) | |
: Wf(t) | |
? t.abort() | |
: Wf(t.req) | |
? t.req.abort() | |
: typeof t.destroy == "function" | |
? t.destroy(e) | |
: typeof t.close == "function" | |
? t.close() | |
: e | |
? rt.nextTick(zb, t, e) | |
: rt.nextTick(Kf, t), | |
t.destroyed || (t[Ub] = !0)); | |
} | |
Gf.exports = { | |
construct: $b, | |
destroyer: Kb, | |
destroy: jb, | |
undestroy: Wb, | |
errorOrDestroy: js, | |
}; | |
}); | |
function Y() { | |
Y.init.call(this); | |
} | |
function en(t) { | |
if (typeof t != "function") | |
throw new TypeError( | |
'The "listener" argument must be of type Function. Received type ' + | |
typeof t, | |
); | |
} | |
function nc(t) { | |
return t._maxListeners === void 0 ? Y.defaultMaxListeners : t._maxListeners; | |
} | |
function Xf(t, e, r, i) { | |
var n, o, s, a; | |
if ( | |
(en(r), | |
(o = t._events) === void 0 | |
? ((o = t._events = Object.create(null)), (t._eventsCount = 0)) | |
: (o.newListener !== void 0 && | |
(t.emit("newListener", e, r.listener ? r.listener : r), | |
(o = t._events)), | |
(s = o[e])), | |
s === void 0) | |
) | |
(s = o[e] = r), ++t._eventsCount; | |
else if ( | |
(typeof s == "function" | |
? (s = o[e] = i ? [r, s] : [s, r]) | |
: i | |
? s.unshift(r) | |
: s.push(r), | |
(n = nc(t)) > 0 && s.length > n && !s.warned) | |
) { | |
s.warned = !0; | |
var l = new Error( | |
"Possible EventEmitter memory leak detected. " + | |
s.length + | |
" " + | |
String(e) + | |
" listeners added. Use emitter.setMaxListeners() to increase limit", | |
); | |
(l.name = "MaxListenersExceededWarning"), | |
(l.emitter = t), | |
(l.type = e), | |
(l.count = s.length), | |
(a = l), | |
console && console.warn && console.warn(a); | |
} | |
return t; | |
} | |
function Gb() { | |
if (!this.fired) | |
return ( | |
this.target.removeListener(this.type, this.wrapFn), | |
(this.fired = !0), | |
arguments.length === 0 | |
? this.listener.call(this.target) | |
: this.listener.apply(this.target, arguments) | |
); | |
} | |
function Zf(t, e, r) { | |
var i = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, | |
n = Gb.bind(i); | |
return (n.listener = r), (i.wrapFn = n), n; | |
} | |
function ec(t, e, r) { | |
var i = t._events; | |
if (i === void 0) return []; | |
var n = i[e]; | |
return n === void 0 | |
? [] | |
: typeof n == "function" | |
? r | |
? [n.listener || n] | |
: [n] | |
: r | |
? (function (o) { | |
for (var s = new Array(o.length), a = 0; a < s.length; ++a) | |
s[a] = o[a].listener || o[a]; | |
return s; | |
})(n) | |
: sc(n, n.length); | |
} | |
function tc(t) { | |
var e = this._events; | |
if (e !== void 0) { | |
var r = e[t]; | |
if (typeof r == "function") return 1; | |
if (r !== void 0) return r.length; | |
} | |
return 0; | |
} | |
function sc(t, e) { | |
for (var r = new Array(e), i = 0; i < e; ++i) r[i] = t[i]; | |
return r; | |
} | |
var rc, | |
ic, | |
qr, | |
Qf, | |
Yf, | |
Jf, | |
Be, | |
Fs = _e(() => { | |
_(); | |
v(); | |
m(); | |
(qr = typeof Reflect == "object" ? Reflect : null), | |
(Qf = | |
qr && typeof qr.apply == "function" | |
? qr.apply | |
: function (t, e, r) { | |
return Function.prototype.apply.call(t, e, r); | |
}); | |
ic = | |
qr && typeof qr.ownKeys == "function" | |
? qr.ownKeys | |
: Object.getOwnPropertySymbols | |
? function (t) { | |
return Object.getOwnPropertyNames(t).concat( | |
Object.getOwnPropertySymbols(t), | |
); | |
} | |
: function (t) { | |
return Object.getOwnPropertyNames(t); | |
}; | |
Yf = | |
Number.isNaN || | |
function (t) { | |
return t != t; | |
}; | |
(rc = Y), | |
(Y.EventEmitter = Y), | |
(Y.prototype._events = void 0), | |
(Y.prototype._eventsCount = 0), | |
(Y.prototype._maxListeners = void 0); | |
Jf = 10; | |
Object.defineProperty(Y, "defaultMaxListeners", { | |
enumerable: !0, | |
get: function () { | |
return Jf; | |
}, | |
set: function (t) { | |
if (typeof t != "number" || t < 0 || Yf(t)) | |
throw new RangeError( | |
'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + | |
t + | |
".", | |
); | |
Jf = t; | |
}, | |
}), | |
(Y.init = function () { | |
(this._events !== void 0 && | |
this._events !== Object.getPrototypeOf(this)._events) || | |
((this._events = Object.create(null)), (this._eventsCount = 0)), | |
(this._maxListeners = this._maxListeners || void 0); | |
}), | |
(Y.prototype.setMaxListeners = function (t) { | |
if (typeof t != "number" || t < 0 || Yf(t)) | |
throw new RangeError( | |
'The value of "n" is out of range. It must be a non-negative number. Received ' + | |
t + | |
".", | |
); | |
return (this._maxListeners = t), this; | |
}), | |
(Y.prototype.getMaxListeners = function () { | |
return nc(this); | |
}), | |
(Y.prototype.emit = function (t) { | |
for (var e = [], r = 1; r < arguments.length; r++) | |
e.push(arguments[r]); | |
var i = t === "error", | |
n = this._events; | |
if (n !== void 0) i = i && n.error === void 0; | |
else if (!i) return !1; | |
if (i) { | |
var o; | |
if ((e.length > 0 && (o = e[0]), o instanceof Error)) throw o; | |
var s = new Error( | |
"Unhandled error." + (o ? " (" + o.message + ")" : ""), | |
); | |
throw ((s.context = o), s); | |
} | |
var a = n[t]; | |
if (a === void 0) return !1; | |
if (typeof a == "function") Qf(a, this, e); | |
else { | |
var l = a.length, | |
c = sc(a, l); | |
for (r = 0; r < l; ++r) Qf(c[r], this, e); | |
} | |
return !0; | |
}), | |
(Y.prototype.addListener = function (t, e) { | |
return Xf(this, t, e, !1); | |
}), | |
(Y.prototype.on = Y.prototype.addListener), | |
(Y.prototype.prependListener = function (t, e) { | |
return Xf(this, t, e, !0); | |
}), | |
(Y.prototype.once = function (t, e) { | |
return en(e), this.on(t, Zf(this, t, e)), this; | |
}), | |
(Y.prototype.prependOnceListener = function (t, e) { | |
return en(e), this.prependListener(t, Zf(this, t, e)), this; | |
}), | |
(Y.prototype.removeListener = function (t, e) { | |
var r, i, n, o, s; | |
if ((en(e), (i = this._events) === void 0)) return this; | |
if ((r = i[t]) === void 0) return this; | |
if (r === e || r.listener === e) | |
--this._eventsCount == 0 | |
? (this._events = Object.create(null)) | |
: (delete i[t], | |
i.removeListener && | |
this.emit("removeListener", t, r.listener || e)); | |
else if (typeof r != "function") { | |
for (n = -1, o = r.length - 1; o >= 0; o--) | |
if (r[o] === e || r[o].listener === e) { | |
(s = r[o].listener), (n = o); | |
break; | |
} | |
if (n < 0) return this; | |
n === 0 | |
? r.shift() | |
: (function (a, l) { | |
for (; l + 1 < a.length; l++) a[l] = a[l + 1]; | |
a.pop(); | |
})(r, n), | |
r.length === 1 && (i[t] = r[0]), | |
i.removeListener !== void 0 && | |
this.emit("removeListener", t, s || e); | |
} | |
return this; | |
}), | |
(Y.prototype.off = Y.prototype.removeListener), | |
(Y.prototype.removeAllListeners = function (t) { | |
var e, r, i; | |
if ((r = this._events) === void 0) return this; | |
if (r.removeListener === void 0) | |
return ( | |
arguments.length === 0 | |
? ((this._events = Object.create(null)), | |
(this._eventsCount = 0)) | |
: r[t] !== void 0 && | |
(--this._eventsCount == 0 | |
? (this._events = Object.create(null)) | |
: delete r[t]), | |
this | |
); | |
if (arguments.length === 0) { | |
var n, | |
o = Object.keys(r); | |
for (i = 0; i < o.length; ++i) | |
(n = o[i]) !== "removeListener" && this.removeAllListeners(n); | |
return ( | |
this.removeAllListeners("removeListener"), | |
(this._events = Object.create(null)), | |
(this._eventsCount = 0), | |
this | |
); | |
} | |
if (typeof (e = r[t]) == "function") this.removeListener(t, e); | |
else if (e !== void 0) | |
for (i = e.length - 1; i >= 0; i--) this.removeListener(t, e[i]); | |
return this; | |
}), | |
(Y.prototype.listeners = function (t) { | |
return ec(this, t, !0); | |
}), | |
(Y.prototype.rawListeners = function (t) { | |
return ec(this, t, !1); | |
}), | |
(Y.listenerCount = function (t, e) { | |
return typeof t.listenerCount == "function" | |
? t.listenerCount(e) | |
: tc.call(t, e); | |
}), | |
(Y.prototype.listenerCount = tc), | |
(Y.prototype.eventNames = function () { | |
return this._eventsCount > 0 ? ic(this._events) : []; | |
}); | |
Be = rc; | |
Be.EventEmitter; | |
Be.defaultMaxListeners; | |
Be.init; | |
Be.listenerCount; | |
Be.EventEmitter; | |
Be.defaultMaxListeners; | |
Be.init; | |
Be.listenerCount; | |
}); | |
var nr = {}; | |
Jt(nr, { | |
EventEmitter: () => Qb, | |
default: () => Be, | |
defaultMaxListeners: () => Yb, | |
init: () => Jb, | |
listenerCount: () => Xb, | |
on: () => Zb, | |
once: () => ew, | |
}); | |
var Qb, | |
Yb, | |
Jb, | |
Xb, | |
Zb, | |
ew, | |
sr = _e(() => { | |
_(); | |
v(); | |
m(); | |
Fs(); | |
Fs(); | |
Be.once = function (t, e) { | |
return new Promise((r, i) => { | |
function n(...s) { | |
o !== void 0 && t.removeListener("error", o), r(s); | |
} | |
let o; | |
e !== "error" && | |
((o = (s) => { | |
t.removeListener(name, n), i(s); | |
}), | |
t.once("error", o)), | |
t.once(e, n); | |
}); | |
}; | |
Be.on = function (t, e) { | |
let r = [], | |
i = [], | |
n = null, | |
o = !1, | |
s = { | |
async next() { | |
let c = r.shift(); | |
if (c) return createIterResult(c, !1); | |
if (n) { | |
let h = Promise.reject(n); | |
return (n = null), h; | |
} | |
return o | |
? createIterResult(void 0, !0) | |
: new Promise((h, d) => i.push({ resolve: h, reject: d })); | |
}, | |
async return() { | |
t.removeListener(e, a), t.removeListener("error", l), (o = !0); | |
for (let c of i) c.resolve(createIterResult(void 0, !0)); | |
return createIterResult(void 0, !0); | |
}, | |
throw(c) { | |
(n = c), t.removeListener(e, a), t.removeListener("error", l); | |
}, | |
[Symbol.asyncIterator]() { | |
return this; | |
}, | |
}; | |
return t.on(e, a), t.on("error", l), s; | |
function a(...c) { | |
let h = i.shift(); | |
h ? h.resolve(createIterResult(c, !1)) : r.push(c); | |
} | |
function l(c) { | |
o = !0; | |
let h = i.shift(); | |
h ? h.reject(c) : (n = c), s.return(); | |
} | |
}; | |
({ | |
EventEmitter: Qb, | |
defaultMaxListeners: Yb, | |
init: Jb, | |
listenerCount: Xb, | |
on: Zb, | |
once: ew, | |
} = Be); | |
}); | |
var nn = M((GI, ac) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { ArrayIsArray: tw, ObjectSetPrototypeOf: oc } = ce(), | |
{ EventEmitter: tn } = (sr(), X(nr)); | |
function rn(t) { | |
tn.call(this, t); | |
} | |
oc(rn.prototype, tn.prototype); | |
oc(rn, tn); | |
rn.prototype.pipe = function (t, e) { | |
let r = this; | |
function i(h) { | |
t.writable && t.write(h) === !1 && r.pause && r.pause(); | |
} | |
r.on("data", i); | |
function n() { | |
r.readable && r.resume && r.resume(); | |
} | |
t.on("drain", n), | |
!t._isStdio && | |
(!e || e.end !== !1) && | |
(r.on("end", s), r.on("close", a)); | |
let o = !1; | |
function s() { | |
o || ((o = !0), t.end()); | |
} | |
function a() { | |
o || ((o = !0), typeof t.destroy == "function" && t.destroy()); | |
} | |
function l(h) { | |
c(), tn.listenerCount(this, "error") === 0 && this.emit("error", h); | |
} | |
Ws(r, "error", l), Ws(t, "error", l); | |
function c() { | |
r.removeListener("data", i), | |
t.removeListener("drain", n), | |
r.removeListener("end", s), | |
r.removeListener("close", a), | |
r.removeListener("error", l), | |
t.removeListener("error", l), | |
r.removeListener("end", c), | |
r.removeListener("close", c), | |
t.removeListener("close", c); | |
} | |
return ( | |
r.on("end", c), r.on("close", c), t.on("close", c), t.emit("pipe", r), t | |
); | |
}; | |
function Ws(t, e, r) { | |
if (typeof t.prependListener == "function") | |
return t.prependListener(e, r); | |
!t._events || !t._events[e] | |
? t.on(e, r) | |
: tw(t._events[e]) | |
? t._events[e].unshift(r) | |
: (t._events[e] = [r, t._events[e]]); | |
} | |
ac.exports = { Stream: rn, prependListener: Ws }; | |
}); | |
var di = M((tT, sn) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { AbortError: lc, codes: rw } = Ae(), | |
{ | |
isNodeStream: uc, | |
isWebStream: iw, | |
kControllerErrorFunction: nw, | |
} = tt(), | |
sw = vt(), | |
{ ERR_INVALID_ARG_TYPE: fc } = rw, | |
ow = (t, e) => { | |
if (typeof t != "object" || !("aborted" in t)) | |
throw new fc(e, "AbortSignal", t); | |
}; | |
sn.exports.addAbortSignal = function (e, r) { | |
if ((ow(e, "signal"), !uc(r) && !iw(r))) | |
throw new fc( | |
"stream", | |
["ReadableStream", "WritableStream", "Stream"], | |
r, | |
); | |
return sn.exports.addAbortSignalNoValidate(e, r); | |
}; | |
sn.exports.addAbortSignalNoValidate = function (t, e) { | |
if (typeof t != "object" || !("aborted" in t)) return e; | |
let r = uc(e) | |
? () => { | |
e.destroy(new lc(void 0, { cause: t.reason })); | |
} | |
: () => { | |
e[nw](new lc(void 0, { cause: t.reason })); | |
}; | |
return ( | |
t.aborted | |
? r() | |
: (t.addEventListener("abort", r), | |
sw(e, () => t.removeEventListener("abort", r))), | |
e | |
); | |
}; | |
}); | |
var dc = M((uT, hc) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { | |
StringPrototypeSlice: cc, | |
SymbolIterator: aw, | |
TypedArrayPrototypeSet: on, | |
Uint8Array: lw, | |
} = ce(), | |
{ Buffer: $s } = (be(), X(me)), | |
{ inspect: uw } = Je(); | |
hc.exports = class { | |
constructor() { | |
(this.head = null), (this.tail = null), (this.length = 0); | |
} | |
push(e) { | |
let r = { data: e, next: null }; | |
this.length > 0 ? (this.tail.next = r) : (this.head = r), | |
(this.tail = r), | |
++this.length; | |
} | |
unshift(e) { | |
let r = { data: e, next: this.head }; | |
this.length === 0 && (this.tail = r), (this.head = r), ++this.length; | |
} | |
shift() { | |
if (this.length === 0) return; | |
let e = this.head.data; | |
return ( | |
this.length === 1 | |
? (this.head = this.tail = null) | |
: (this.head = this.head.next), | |
--this.length, | |
e | |
); | |
} | |
clear() { | |
(this.head = this.tail = null), (this.length = 0); | |
} | |
join(e) { | |
if (this.length === 0) return ""; | |
let r = this.head, | |
i = "" + r.data; | |
for (; (r = r.next) !== null; ) i += e + r.data; | |
return i; | |
} | |
concat(e) { | |
if (this.length === 0) return $s.alloc(0); | |
let r = $s.allocUnsafe(e >>> 0), | |
i = this.head, | |
n = 0; | |
for (; i; ) on(r, i.data, n), (n += i.data.length), (i = i.next); | |
return r; | |
} | |
consume(e, r) { | |
let i = this.head.data; | |
if (e < i.length) { | |
let n = i.slice(0, e); | |
return (this.head.data = i.slice(e)), n; | |
} | |
return e === i.length | |
? this.shift() | |
: r | |
? this._getString(e) | |
: this._getBuffer(e); | |
} | |
first() { | |
return this.head.data; | |
} | |
*[aw]() { | |
for (let e = this.head; e; e = e.next) yield e.data; | |
} | |
_getString(e) { | |
let r = "", | |
i = this.head, | |
n = 0; | |
do { | |
let o = i.data; | |
if (e > o.length) (r += o), (e -= o.length); | |
else { | |
e === o.length | |
? ((r += o), | |
++n, | |
i.next ? (this.head = i.next) : (this.head = this.tail = null)) | |
: ((r += cc(o, 0, e)), (this.head = i), (i.data = cc(o, e))); | |
break; | |
} | |
++n; | |
} while ((i = i.next) !== null); | |
return (this.length -= n), r; | |
} | |
_getBuffer(e) { | |
let r = $s.allocUnsafe(e), | |
i = e, | |
n = this.head, | |
o = 0; | |
do { | |
let s = n.data; | |
if (e > s.length) on(r, s, i - e), (e -= s.length); | |
else { | |
e === s.length | |
? (on(r, s, i - e), | |
++o, | |
n.next ? (this.head = n.next) : (this.head = this.tail = null)) | |
: (on(r, new lw(s.buffer, s.byteOffset, e), i - e), | |
(this.head = n), | |
(n.data = s.slice(e))); | |
break; | |
} | |
++o; | |
} while ((n = n.next) !== null); | |
return (this.length -= o), r; | |
} | |
[Symbol.for("nodejs.util.inspect.custom")](e, r) { | |
return uw(this, { ...r, depth: 0, customInspect: !1 }); | |
} | |
}; | |
}); | |
var an = M((yT, gc) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { MathFloor: fw, NumberIsInteger: cw } = ce(), | |
{ ERR_INVALID_ARG_VALUE: hw } = Ae().codes; | |
function dw(t, e, r) { | |
return t.highWaterMark != null ? t.highWaterMark : e ? t[r] : null; | |
} | |
function pc(t) { | |
return t ? 16 : 16 * 1024; | |
} | |
function pw(t, e, r, i) { | |
let n = dw(e, i, r); | |
if (n != null) { | |
if (!cw(n) || n < 0) { | |
let o = i ? `options.${r}` : "options.highWaterMark"; | |
throw new hw(o, n); | |
} | |
return fw(n); | |
} | |
return pc(t.objectMode); | |
} | |
gc.exports = { getHighWaterMark: pw, getDefaultHighWaterMark: pc }; | |
}); | |
function wc(t) { | |
var e = t.length; | |
if (e % 4 > 0) | |
throw new Error("Invalid string. Length must be a multiple of 4"); | |
var r = t.indexOf("="); | |
return r === -1 && (r = e), [r, r === e ? 0 : 4 - (r % 4)]; | |
} | |
function gw(t, e, r) { | |
for (var i, n, o = [], s = e; s < r; s += 3) | |
(i = | |
((t[s] << 16) & 16711680) + | |
((t[s + 1] << 8) & 65280) + | |
(255 & t[s + 2])), | |
o.push( | |
$e[((n = i) >> 18) & 63] + | |
$e[(n >> 12) & 63] + | |
$e[(n >> 6) & 63] + | |
$e[63 & n], | |
); | |
return o.join(""); | |
} | |
function Et(t) { | |
if (t > 2147483647) | |
throw new RangeError( | |
'The value "' + t + '" is invalid for option "size"', | |
); | |
var e = new Uint8Array(t); | |
return Object.setPrototypeOf(e, O.prototype), e; | |
} | |
function O(t, e, r) { | |
if (typeof t == "number") { | |
if (typeof e == "string") | |
throw new TypeError( | |
'The "string" argument must be of type string. Received type number', | |
); | |
return Ks(t); | |
} | |
return Cc(t, e, r); | |
} | |
function Cc(t, e, r) { | |
if (typeof t == "string") | |
return (function (o, s) { | |
if ( | |
((typeof s == "string" && s !== "") || (s = "utf8"), !O.isEncoding(s)) | |
) | |
throw new TypeError("Unknown encoding: " + s); | |
var a = 0 | Pc(o, s), | |
l = Et(a), | |
c = l.write(o, s); | |
return c !== a && (l = l.slice(0, c)), l; | |
})(t, e); | |
if (ArrayBuffer.isView(t)) return Hs(t); | |
if (t == null) | |
throw new TypeError( | |
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + | |
typeof t, | |
); | |
if ( | |
St(t, ArrayBuffer) || | |
(t && St(t.buffer, ArrayBuffer)) || | |
(typeof SharedArrayBuffer < "u" && | |
(St(t, SharedArrayBuffer) || (t && St(t.buffer, SharedArrayBuffer)))) | |
) | |
return mc(t, e, r); | |
if (typeof t == "number") | |
throw new TypeError( | |
'The "value" argument must not be of type number. Received type number', | |
); | |
var i = t.valueOf && t.valueOf(); | |
if (i != null && i !== t) return O.from(i, e, r); | |
var n = (function (o) { | |
if (O.isBuffer(o)) { | |
var s = 0 | Ys(o.length), | |
a = Et(s); | |
return a.length === 0 || o.copy(a, 0, 0, s), a; | |
} | |
if (o.length !== void 0) | |
return typeof o.length != "number" || Js(o.length) ? Et(0) : Hs(o); | |
if (o.type === "Buffer" && Array.isArray(o.data)) return Hs(o.data); | |
})(t); | |
if (n) return n; | |
if ( | |
typeof Symbol < "u" && | |
Symbol.toPrimitive != null && | |
typeof t[Symbol.toPrimitive] == "function" | |
) | |
return O.from(t[Symbol.toPrimitive]("string"), e, r); | |
throw new TypeError( | |
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + | |
typeof t, | |
); | |
} | |
function Bc(t) { | |
if (typeof t != "number") | |
throw new TypeError('"size" argument must be of type number'); | |
if (t < 0) | |
throw new RangeError( | |
'The value "' + t + '" is invalid for option "size"', | |
); | |
} | |
function Ks(t) { | |
return Bc(t), Et(t < 0 ? 0 : 0 | Ys(t)); | |
} | |
function Hs(t) { | |
for ( | |
var e = t.length < 0 ? 0 : 0 | Ys(t.length), r = Et(e), i = 0; | |
i < e; | |
i += 1 | |
) | |
r[i] = 255 & t[i]; | |
return r; | |
} | |
function mc(t, e, r) { | |
if (e < 0 || t.byteLength < e) | |
throw new RangeError('"offset" is outside of buffer bounds'); | |
if (t.byteLength < e + (r || 0)) | |
throw new RangeError('"length" is outside of buffer bounds'); | |
var i; | |
return ( | |
(i = | |
e === void 0 && r === void 0 | |
? new Uint8Array(t) | |
: r === void 0 | |
? new Uint8Array(t, e) | |
: new Uint8Array(t, e, r)), | |
Object.setPrototypeOf(i, O.prototype), | |
i | |
); | |
} | |
function Ys(t) { | |
if (t >= 2147483647) | |
throw new RangeError( | |
"Attempt to allocate Buffer larger than maximum size: 0x" + | |
(2147483647).toString(16) + | |
" bytes", | |
); | |
return 0 | t; | |
} | |
function Pc(t, e) { | |
if (O.isBuffer(t)) return t.length; | |
if (ArrayBuffer.isView(t) || St(t, ArrayBuffer)) return t.byteLength; | |
if (typeof t != "string") | |
throw new TypeError( | |
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + | |
typeof t, | |
); | |
var r = t.length, | |
i = arguments.length > 2 && arguments[2] === !0; | |
if (!i && r === 0) return 0; | |
for (var n = !1; ; ) | |
switch (e) { | |
case "ascii": | |
case "latin1": | |
case "binary": | |
return r; | |
case "utf8": | |
case "utf-8": | |
return Gs(t).length; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return 2 * r; | |
case "hex": | |
return r >>> 1; | |
case "base64": | |
return Mc(t).length; | |
default: | |
if (n) return i ? -1 : Gs(t).length; | |
(e = ("" + e).toLowerCase()), (n = !0); | |
} | |
} | |
function bw(t, e, r) { | |
var i = !1; | |
if ( | |
((e === void 0 || e < 0) && (e = 0), | |
e > this.length || | |
((r === void 0 || r > this.length) && (r = this.length), r <= 0) || | |
(r >>>= 0) <= (e >>>= 0)) | |
) | |
return ""; | |
for (t || (t = "utf8"); ; ) | |
switch (t) { | |
case "hex": | |
return Tw(this, e, r); | |
case "utf8": | |
case "utf-8": | |
return Oc(this, e, r); | |
case "ascii": | |
return Aw(this, e, r); | |
case "latin1": | |
case "binary": | |
return Iw(this, e, r); | |
case "base64": | |
return Sw(this, e, r); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return Rw(this, e, r); | |
default: | |
if (i) throw new TypeError("Unknown encoding: " + t); | |
(t = (t + "").toLowerCase()), (i = !0); | |
} | |
} | |
function ar(t, e, r) { | |
var i = t[e]; | |
(t[e] = t[r]), (t[r] = i); | |
} | |
function vc(t, e, r, i, n) { | |
if (t.length === 0) return -1; | |
if ( | |
(typeof r == "string" | |
? ((i = r), (r = 0)) | |
: r > 2147483647 | |
? (r = 2147483647) | |
: r < -2147483648 && (r = -2147483648), | |
Js((r = +r)) && (r = n ? 0 : t.length - 1), | |
r < 0 && (r = t.length + r), | |
r >= t.length) | |
) { | |
if (n) return -1; | |
r = t.length - 1; | |
} else if (r < 0) { | |
if (!n) return -1; | |
r = 0; | |
} | |
if ((typeof e == "string" && (e = O.from(e, i)), O.isBuffer(e))) | |
return e.length === 0 ? -1 : Ec(t, e, r, i, n); | |
if (typeof e == "number") | |
return ( | |
(e &= 255), | |
typeof Uint8Array.prototype.indexOf == "function" | |
? n | |
? Uint8Array.prototype.indexOf.call(t, e, r) | |
: Uint8Array.prototype.lastIndexOf.call(t, e, r) | |
: Ec(t, [e], r, i, n) | |
); | |
throw new TypeError("val must be string, number or Buffer"); | |
} | |
function Ec(t, e, r, i, n) { | |
var o, | |
s = 1, | |
a = t.length, | |
l = e.length; | |
if ( | |
i !== void 0 && | |
((i = String(i).toLowerCase()) === "ucs2" || | |
i === "ucs-2" || | |
i === "utf16le" || | |
i === "utf-16le") | |
) { | |
if (t.length < 2 || e.length < 2) return -1; | |
(s = 2), (a /= 2), (l /= 2), (r /= 2); | |
} | |
function c(y, w) { | |
return s === 1 ? y[w] : y.readUInt16BE(w * s); | |
} | |
if (n) { | |
var h = -1; | |
for (o = r; o < a; o++) | |
if (c(t, o) === c(e, h === -1 ? 0 : o - h)) { | |
if ((h === -1 && (h = o), o - h + 1 === l)) return h * s; | |
} else h !== -1 && (o -= o - h), (h = -1); | |
} else | |
for (r + l > a && (r = a - l), o = r; o >= 0; o--) { | |
for (var d = !0, g = 0; g < l; g++) | |
if (c(t, o + g) !== c(e, g)) { | |
d = !1; | |
break; | |
} | |
if (d) return o; | |
} | |
return -1; | |
} | |
function ww(t, e, r, i) { | |
r = Number(r) || 0; | |
var n = t.length - r; | |
i ? (i = Number(i)) > n && (i = n) : (i = n); | |
var o = e.length; | |
i > o / 2 && (i = o / 2); | |
for (var s = 0; s < i; ++s) { | |
var a = parseInt(e.substr(2 * s, 2), 16); | |
if (Js(a)) return s; | |
t[r + s] = a; | |
} | |
return s; | |
} | |
function _w(t, e, r, i) { | |
return cn(Gs(e, t.length - r), t, r, i); | |
} | |
function kc(t, e, r, i) { | |
return cn( | |
(function (n) { | |
for (var o = [], s = 0; s < n.length; ++s) | |
o.push(255 & n.charCodeAt(s)); | |
return o; | |
})(e), | |
t, | |
r, | |
i, | |
); | |
} | |
function mw(t, e, r, i) { | |
return kc(t, e, r, i); | |
} | |
function vw(t, e, r, i) { | |
return cn(Mc(e), t, r, i); | |
} | |
function Ew(t, e, r, i) { | |
return cn( | |
(function (n, o) { | |
for (var s, a, l, c = [], h = 0; h < n.length && !((o -= 2) < 0); ++h) | |
(s = n.charCodeAt(h)), | |
(a = s >> 8), | |
(l = s % 256), | |
c.push(l), | |
c.push(a); | |
return c; | |
})(e, t.length - r), | |
t, | |
r, | |
i, | |
); | |
} | |
function Sw(t, e, r) { | |
return e === 0 && r === t.length | |
? zs.fromByteArray(t) | |
: zs.fromByteArray(t.slice(e, r)); | |
} | |
function Oc(t, e, r) { | |
r = Math.min(t.length, r); | |
for (var i = [], n = e; n < r; ) { | |
var o, | |
s, | |
a, | |
l, | |
c = t[n], | |
h = null, | |
d = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1; | |
if (n + d <= r) | |
switch (d) { | |
case 1: | |
c < 128 && (h = c); | |
break; | |
case 2: | |
(192 & (o = t[n + 1])) == 128 && | |
(l = ((31 & c) << 6) | (63 & o)) > 127 && | |
(h = l); | |
break; | |
case 3: | |
(o = t[n + 1]), | |
(s = t[n + 2]), | |
(192 & o) == 128 && | |
(192 & s) == 128 && | |
(l = ((15 & c) << 12) | ((63 & o) << 6) | (63 & s)) > 2047 && | |
(l < 55296 || l > 57343) && | |
(h = l); | |
break; | |
case 4: | |
(o = t[n + 1]), | |
(s = t[n + 2]), | |
(a = t[n + 3]), | |
(192 & o) == 128 && | |
(192 & s) == 128 && | |
(192 & a) == 128 && | |
(l = | |
((15 & c) << 18) | | |
((63 & o) << 12) | | |
((63 & s) << 6) | | |
(63 & a)) > 65535 && | |
l < 1114112 && | |
(h = l); | |
} | |
h === null | |
? ((h = 65533), (d = 1)) | |
: h > 65535 && | |
((h -= 65536), | |
i.push(((h >>> 10) & 1023) | 55296), | |
(h = 56320 | (1023 & h))), | |
i.push(h), | |
(n += d); | |
} | |
return (function (g) { | |
var y = g.length; | |
if (y <= 4096) return String.fromCharCode.apply(String, g); | |
for (var w = "", S = 0; S < y; ) | |
w += String.fromCharCode.apply(String, g.slice(S, (S += 4096))); | |
return w; | |
})(i); | |
} | |
function Aw(t, e, r) { | |
var i = ""; | |
r = Math.min(t.length, r); | |
for (var n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]); | |
return i; | |
} | |
function Iw(t, e, r) { | |
var i = ""; | |
r = Math.min(t.length, r); | |
for (var n = e; n < r; ++n) i += String.fromCharCode(t[n]); | |
return i; | |
} | |
function Tw(t, e, r) { | |
var i = t.length; | |
(!e || e < 0) && (e = 0), (!r || r < 0 || r > i) && (r = i); | |
for (var n = "", o = e; o < r; ++o) n += Bw[t[o]]; | |
return n; | |
} | |
function Rw(t, e, r) { | |
for (var i = t.slice(e, r), n = "", o = 0; o < i.length; o += 2) | |
n += String.fromCharCode(i[o] + 256 * i[o + 1]); | |
return n; | |
} | |
function we(t, e, r) { | |
if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint"); | |
if (t + e > r) | |
throw new RangeError("Trying to access beyond buffer length"); | |
} | |
function Pe(t, e, r, i, n, o) { | |
if (!O.isBuffer(t)) | |
throw new TypeError('"buffer" argument must be a Buffer instance'); | |
if (e > n || e < o) | |
throw new RangeError('"value" argument is out of bounds'); | |
if (r + i > t.length) throw new RangeError("Index out of range"); | |
} | |
function xc(t, e, r, i, n, o) { | |
if (r + i > t.length) throw new RangeError("Index out of range"); | |
if (r < 0) throw new RangeError("Index out of range"); | |
} | |
function Sc(t, e, r, i, n) { | |
return ( | |
(e = +e), | |
(r >>>= 0), | |
n || xc(t, 0, r, 4), | |
Dr.write(t, e, r, i, 23, 4), | |
r + 4 | |
); | |
} | |
function Ac(t, e, r, i, n) { | |
return ( | |
(e = +e), | |
(r >>>= 0), | |
n || xc(t, 0, r, 8), | |
Dr.write(t, e, r, i, 52, 8), | |
r + 8 | |
); | |
} | |
function Gs(t, e) { | |
var r; | |
e = e || 1 / 0; | |
for (var i = t.length, n = null, o = [], s = 0; s < i; ++s) { | |
if ((r = t.charCodeAt(s)) > 55295 && r < 57344) { | |
if (!n) { | |
if (r > 56319) { | |
(e -= 3) > -1 && o.push(239, 191, 189); | |
continue; | |
} | |
if (s + 1 === i) { | |
(e -= 3) > -1 && o.push(239, 191, 189); | |
continue; | |
} | |
n = r; | |
continue; | |
} | |
if (r < 56320) { | |
(e -= 3) > -1 && o.push(239, 191, 189), (n = r); | |
continue; | |
} | |
r = 65536 + (((n - 55296) << 10) | (r - 56320)); | |
} else n && (e -= 3) > -1 && o.push(239, 191, 189); | |
if (((n = null), r < 128)) { | |
if ((e -= 1) < 0) break; | |
o.push(r); | |
} else if (r < 2048) { | |
if ((e -= 2) < 0) break; | |
o.push((r >> 6) | 192, (63 & r) | 128); | |
} else if (r < 65536) { | |
if ((e -= 3) < 0) break; | |
o.push((r >> 12) | 224, ((r >> 6) & 63) | 128, (63 & r) | 128); | |
} else { | |
if (!(r < 1114112)) throw new Error("Invalid code point"); | |
if ((e -= 4) < 0) break; | |
o.push( | |
(r >> 18) | 240, | |
((r >> 12) & 63) | 128, | |
((r >> 6) & 63) | 128, | |
(63 & r) | 128, | |
); | |
} | |
} | |
return o; | |
} | |
function Mc(t) { | |
return zs.toByteArray( | |
(function (e) { | |
if ((e = (e = e.split("=")[0]).trim().replace(Cw, "")).length < 2) | |
return ""; | |
for (; e.length % 4 != 0; ) e += "="; | |
return e; | |
})(t), | |
); | |
} | |
function cn(t, e, r, i) { | |
for (var n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) | |
e[n + r] = t[n]; | |
return n; | |
} | |
function St(t, e) { | |
return ( | |
t instanceof e || | |
(t != null && | |
t.constructor != null && | |
t.constructor.name != null && | |
t.constructor.name === e.name) | |
); | |
} | |
function Js(t) { | |
return t != t; | |
} | |
function Ic(t, e) { | |
for (var r in t) e[r] = t[r]; | |
} | |
function lr(t, e, r) { | |
return it(t, e, r); | |
} | |
function pi(t) { | |
var e; | |
switch ( | |
((this.encoding = (function (r) { | |
var i = (function (n) { | |
if (!n) return "utf8"; | |
for (var o; ; ) | |
switch (n) { | |
case "utf8": | |
case "utf-8": | |
return "utf8"; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return "utf16le"; | |
case "latin1": | |
case "binary": | |
return "latin1"; | |
case "base64": | |
case "ascii": | |
case "hex": | |
return n; | |
default: | |
if (o) return; | |
(n = ("" + n).toLowerCase()), (o = !0); | |
} | |
})(r); | |
if (typeof i != "string" && (Qs.isEncoding === Tc || !Tc(r))) | |
throw new Error("Unknown encoding: " + r); | |
return i || r; | |
})(t)), | |
this.encoding) | |
) { | |
case "utf16le": | |
(this.text = Ow), (this.end = xw), (e = 4); | |
break; | |
case "utf8": | |
(this.fillLast = kw), (e = 4); | |
break; | |
case "base64": | |
(this.text = Mw), (this.end = Lw), (e = 3); | |
break; | |
default: | |
return (this.write = Uw), (this.end = Nw), void 0; | |
} | |
(this.lastNeed = 0), | |
(this.lastTotal = 0), | |
(this.lastChar = Qs.allocUnsafe(e)); | |
} | |
function Vs(t) { | |
return t <= 127 | |
? 0 | |
: t >> 5 == 6 | |
? 2 | |
: t >> 4 == 14 | |
? 3 | |
: t >> 3 == 30 | |
? 4 | |
: t >> 6 == 2 | |
? -1 | |
: -2; | |
} | |
function kw(t) { | |
var e = this.lastTotal - this.lastNeed, | |
r = (function (i, n, o) { | |
if ((192 & n[0]) != 128) return (i.lastNeed = 0), "\uFFFD"; | |
if (i.lastNeed > 1 && n.length > 1) { | |
if ((192 & n[1]) != 128) return (i.lastNeed = 1), "\uFFFD"; | |
if (i.lastNeed > 2 && n.length > 2 && (192 & n[2]) != 128) | |
return (i.lastNeed = 2), "\uFFFD"; | |
} | |
})(this, t); | |
return r !== void 0 | |
? r | |
: this.lastNeed <= t.length | |
? (t.copy(this.lastChar, e, 0, this.lastNeed), | |
this.lastChar.toString(this.encoding, 0, this.lastTotal)) | |
: (t.copy(this.lastChar, e, 0, t.length), | |
(this.lastNeed -= t.length), | |
void 0); | |
} | |
function Ow(t, e) { | |
if ((t.length - e) % 2 == 0) { | |
var r = t.toString("utf16le", e); | |
if (r) { | |
var i = r.charCodeAt(r.length - 1); | |
if (i >= 55296 && i <= 56319) | |
return ( | |
(this.lastNeed = 2), | |
(this.lastTotal = 4), | |
(this.lastChar[0] = t[t.length - 2]), | |
(this.lastChar[1] = t[t.length - 1]), | |
r.slice(0, -1) | |
); | |
} | |
return r; | |
} | |
return ( | |
(this.lastNeed = 1), | |
(this.lastTotal = 2), | |
(this.lastChar[0] = t[t.length - 1]), | |
t.toString("utf16le", e, t.length - 1) | |
); | |
} | |
function xw(t) { | |
var e = t && t.length ? this.write(t) : ""; | |
if (this.lastNeed) { | |
var r = this.lastTotal - this.lastNeed; | |
return e + this.lastChar.toString("utf16le", 0, r); | |
} | |
return e; | |
} | |
function Mw(t, e) { | |
var r = (t.length - e) % 3; | |
return r === 0 | |
? t.toString("base64", e) | |
: ((this.lastNeed = 3 - r), | |
(this.lastTotal = 3), | |
r === 1 | |
? (this.lastChar[0] = t[t.length - 1]) | |
: ((this.lastChar[0] = t[t.length - 2]), | |
(this.lastChar[1] = t[t.length - 1])), | |
t.toString("base64", e, t.length - r)); | |
} | |
function Lw(t) { | |
var e = t && t.length ? this.write(t) : ""; | |
return this.lastNeed | |
? e + this.lastChar.toString("base64", 0, 3 - this.lastNeed) | |
: e; | |
} | |
function Uw(t) { | |
return t.toString(this.encoding); | |
} | |
function Nw(t) { | |
return t && t.length ? this.write(t) : ""; | |
} | |
var Rc, | |
$e, | |
Oe, | |
yc, | |
ln, | |
or, | |
bc, | |
yw, | |
At, | |
zs, | |
Dr, | |
_c, | |
Cw, | |
Bw, | |
un, | |
fn, | |
it, | |
Pw, | |
ur, | |
Qs, | |
Tc, | |
Xs = _e(() => { | |
_(); | |
v(); | |
m(); | |
for ( | |
Rc = { | |
byteLength: function (t) { | |
var e = wc(t), | |
r = e[0], | |
i = e[1]; | |
return (3 * (r + i)) / 4 - i; | |
}, | |
toByteArray: function (t) { | |
var e, | |
r, | |
i = wc(t), | |
n = i[0], | |
o = i[1], | |
s = new yc( | |
(function (c, h, d) { | |
return (3 * (h + d)) / 4 - d; | |
})(0, n, o), | |
), | |
a = 0, | |
l = o > 0 ? n - 4 : n; | |
for (r = 0; r < l; r += 4) | |
(e = | |
(Oe[t.charCodeAt(r)] << 18) | | |
(Oe[t.charCodeAt(r + 1)] << 12) | | |
(Oe[t.charCodeAt(r + 2)] << 6) | | |
Oe[t.charCodeAt(r + 3)]), | |
(s[a++] = (e >> 16) & 255), | |
(s[a++] = (e >> 8) & 255), | |
(s[a++] = 255 & e); | |
return ( | |
o === 2 && | |
((e = | |
(Oe[t.charCodeAt(r)] << 2) | (Oe[t.charCodeAt(r + 1)] >> 4)), | |
(s[a++] = 255 & e)), | |
o === 1 && | |
((e = | |
(Oe[t.charCodeAt(r)] << 10) | | |
(Oe[t.charCodeAt(r + 1)] << 4) | | |
(Oe[t.charCodeAt(r + 2)] >> 2)), | |
(s[a++] = (e >> 8) & 255), | |
(s[a++] = 255 & e)), | |
s | |
); | |
}, | |
fromByteArray: function (t) { | |
for ( | |
var e, r = t.length, i = r % 3, n = [], o = 0, s = r - i; | |
o < s; | |
o += 16383 | |
) | |
n.push(gw(t, o, o + 16383 > s ? s : o + 16383)); | |
return ( | |
i === 1 | |
? ((e = t[r - 1]), | |
n.push($e[e >> 2] + $e[(e << 4) & 63] + "==")) | |
: i === 2 && | |
((e = (t[r - 2] << 8) + t[r - 1]), | |
n.push( | |
$e[e >> 10] + $e[(e >> 4) & 63] + $e[(e << 2) & 63] + "=", | |
)), | |
n.join("") | |
); | |
}, | |
}, | |
$e = [], | |
Oe = [], | |
yc = typeof Uint8Array < "u" ? Uint8Array : Array, | |
ln = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", | |
or = 0, | |
bc = ln.length; | |
or < bc; | |
++or | |
) | |
($e[or] = ln[or]), (Oe[ln.charCodeAt(or)] = or); | |
(Oe["-".charCodeAt(0)] = 62), (Oe["_".charCodeAt(0)] = 63); | |
(yw = { | |
read: function (t, e, r, i, n) { | |
var o, | |
s, | |
a = 8 * n - i - 1, | |
l = (1 << a) - 1, | |
c = l >> 1, | |
h = -7, | |
d = r ? n - 1 : 0, | |
g = r ? -1 : 1, | |
y = t[e + d]; | |
for ( | |
d += g, o = y & ((1 << -h) - 1), y >>= -h, h += a; | |
h > 0; | |
o = 256 * o + t[e + d], d += g, h -= 8 | |
); | |
for ( | |
s = o & ((1 << -h) - 1), o >>= -h, h += i; | |
h > 0; | |
s = 256 * s + t[e + d], d += g, h -= 8 | |
); | |
if (o === 0) o = 1 - c; | |
else { | |
if (o === l) return s ? NaN : (1 / 0) * (y ? -1 : 1); | |
(s += Math.pow(2, i)), (o -= c); | |
} | |
return (y ? -1 : 1) * s * Math.pow(2, o - i); | |
}, | |
write: function (t, e, r, i, n, o) { | |
var s, | |
a, | |
l, | |
c = 8 * o - n - 1, | |
h = (1 << c) - 1, | |
d = h >> 1, | |
g = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, | |
y = i ? 0 : o - 1, | |
w = i ? 1 : -1, | |
S = e < 0 || (e === 0 && 1 / e < 0) ? 1 : 0; | |
for ( | |
e = Math.abs(e), | |
isNaN(e) || e === 1 / 0 | |
? ((a = isNaN(e) ? 1 : 0), (s = h)) | |
: ((s = Math.floor(Math.log(e) / Math.LN2)), | |
e * (l = Math.pow(2, -s)) < 1 && (s--, (l *= 2)), | |
(e += s + d >= 1 ? g / l : g * Math.pow(2, 1 - d)) * l >= 2 && | |
(s++, (l /= 2)), | |
s + d >= h | |
? ((a = 0), (s = h)) | |
: s + d >= 1 | |
? ((a = (e * l - 1) * Math.pow(2, n)), (s += d)) | |
: ((a = e * Math.pow(2, d - 1) * Math.pow(2, n)), | |
(s = 0))); | |
n >= 8; | |
t[r + y] = 255 & a, y += w, a /= 256, n -= 8 | |
); | |
for ( | |
s = (s << n) | a, c += n; | |
c > 0; | |
t[r + y] = 255 & s, y += w, s /= 256, c -= 8 | |
); | |
t[r + y - w] |= 128 * S; | |
}, | |
}), | |
(At = {}), | |
(zs = Rc), | |
(Dr = yw), | |
(_c = | |
typeof Symbol == "function" && typeof Symbol.for == "function" | |
? Symbol.for("nodejs.util.inspect.custom") | |
: null); | |
(At.Buffer = O), | |
(At.SlowBuffer = function (t) { | |
return +t != t && (t = 0), O.alloc(+t); | |
}), | |
(At.INSPECT_MAX_BYTES = 50); | |
(At.kMaxLength = 2147483647), | |
(O.TYPED_ARRAY_SUPPORT = (function () { | |
try { | |
var t = new Uint8Array(1), | |
e = { | |
foo: function () { | |
return 42; | |
}, | |
}; | |
return ( | |
Object.setPrototypeOf(e, Uint8Array.prototype), | |
Object.setPrototypeOf(t, e), | |
t.foo() === 42 | |
); | |
} catch { | |
return !1; | |
} | |
})()), | |
O.TYPED_ARRAY_SUPPORT || | |
typeof console > "u" || | |
typeof console.error != "function" || | |
console.error( | |
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.", | |
), | |
Object.defineProperty(O.prototype, "parent", { | |
enumerable: !0, | |
get: function () { | |
if (O.isBuffer(this)) return this.buffer; | |
}, | |
}), | |
Object.defineProperty(O.prototype, "offset", { | |
enumerable: !0, | |
get: function () { | |
if (O.isBuffer(this)) return this.byteOffset; | |
}, | |
}), | |
(O.poolSize = 8192), | |
(O.from = function (t, e, r) { | |
return Cc(t, e, r); | |
}), | |
Object.setPrototypeOf(O.prototype, Uint8Array.prototype), | |
Object.setPrototypeOf(O, Uint8Array), | |
(O.alloc = function (t, e, r) { | |
return (function (i, n, o) { | |
return ( | |
Bc(i), | |
i <= 0 | |
? Et(i) | |
: n !== void 0 | |
? typeof o == "string" | |
? Et(i).fill(n, o) | |
: Et(i).fill(n) | |
: Et(i) | |
); | |
})(t, e, r); | |
}), | |
(O.allocUnsafe = function (t) { | |
return Ks(t); | |
}), | |
(O.allocUnsafeSlow = function (t) { | |
return Ks(t); | |
}), | |
(O.isBuffer = function (t) { | |
return t != null && t._isBuffer === !0 && t !== O.prototype; | |
}), | |
(O.compare = function (t, e) { | |
if ( | |
(St(t, Uint8Array) && (t = O.from(t, t.offset, t.byteLength)), | |
St(e, Uint8Array) && (e = O.from(e, e.offset, e.byteLength)), | |
!O.isBuffer(t) || !O.isBuffer(e)) | |
) | |
throw new TypeError( | |
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', | |
); | |
if (t === e) return 0; | |
for ( | |
var r = t.length, i = e.length, n = 0, o = Math.min(r, i); | |
n < o; | |
++n | |
) | |
if (t[n] !== e[n]) { | |
(r = t[n]), (i = e[n]); | |
break; | |
} | |
return r < i ? -1 : i < r ? 1 : 0; | |
}), | |
(O.isEncoding = function (t) { | |
switch (String(t).toLowerCase()) { | |
case "hex": | |
case "utf8": | |
case "utf-8": | |
case "ascii": | |
case "latin1": | |
case "binary": | |
case "base64": | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return !0; | |
default: | |
return !1; | |
} | |
}), | |
(O.concat = function (t, e) { | |
if (!Array.isArray(t)) | |
throw new TypeError('"list" argument must be an Array of Buffers'); | |
if (t.length === 0) return O.alloc(0); | |
var r; | |
if (e === void 0) | |
for (e = 0, r = 0; r < t.length; ++r) e += t[r].length; | |
var i = O.allocUnsafe(e), | |
n = 0; | |
for (r = 0; r < t.length; ++r) { | |
var o = t[r]; | |
if ((St(o, Uint8Array) && (o = O.from(o)), !O.isBuffer(o))) | |
throw new TypeError( | |
'"list" argument must be an Array of Buffers', | |
); | |
o.copy(i, n), (n += o.length); | |
} | |
return i; | |
}), | |
(O.byteLength = Pc), | |
(O.prototype._isBuffer = !0), | |
(O.prototype.swap16 = function () { | |
var t = this.length; | |
if (t % 2 != 0) | |
throw new RangeError("Buffer size must be a multiple of 16-bits"); | |
for (var e = 0; e < t; e += 2) ar(this, e, e + 1); | |
return this; | |
}), | |
(O.prototype.swap32 = function () { | |
var t = this.length; | |
if (t % 4 != 0) | |
throw new RangeError("Buffer size must be a multiple of 32-bits"); | |
for (var e = 0; e < t; e += 4) | |
ar(this, e, e + 3), ar(this, e + 1, e + 2); | |
return this; | |
}), | |
(O.prototype.swap64 = function () { | |
var t = this.length; | |
if (t % 8 != 0) | |
throw new RangeError("Buffer size must be a multiple of 64-bits"); | |
for (var e = 0; e < t; e += 8) | |
ar(this, e, e + 7), | |
ar(this, e + 1, e + 6), | |
ar(this, e + 2, e + 5), | |
ar(this, e + 3, e + 4); | |
return this; | |
}), | |
(O.prototype.toString = function () { | |
var t = this.length; | |
return t === 0 | |
? "" | |
: arguments.length === 0 | |
? Oc(this, 0, t) | |
: bw.apply(this, arguments); | |
}), | |
(O.prototype.toLocaleString = O.prototype.toString), | |
(O.prototype.equals = function (t) { | |
if (!O.isBuffer(t)) throw new TypeError("Argument must be a Buffer"); | |
return this === t || O.compare(this, t) === 0; | |
}), | |
(O.prototype.inspect = function () { | |
var t = "", | |
e = At.INSPECT_MAX_BYTES; | |
return ( | |
(t = this.toString("hex", 0, e) | |
.replace(/(.{2})/g, "$1 ") | |
.trim()), | |
this.length > e && (t += " ... "), | |
"<Buffer " + t + ">" | |
); | |
}), | |
_c && (O.prototype[_c] = O.prototype.inspect), | |
(O.prototype.compare = function (t, e, r, i, n) { | |
if ( | |
(St(t, Uint8Array) && (t = O.from(t, t.offset, t.byteLength)), | |
!O.isBuffer(t)) | |
) | |
throw new TypeError( | |
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + | |
typeof t, | |
); | |
if ( | |
(e === void 0 && (e = 0), | |
r === void 0 && (r = t ? t.length : 0), | |
i === void 0 && (i = 0), | |
n === void 0 && (n = this.length), | |
e < 0 || r > t.length || i < 0 || n > this.length) | |
) | |
throw new RangeError("out of range index"); | |
if (i >= n && e >= r) return 0; | |
if (i >= n) return -1; | |
if (e >= r) return 1; | |
if (this === t) return 0; | |
for ( | |
var o = (n >>>= 0) - (i >>>= 0), | |
s = (r >>>= 0) - (e >>>= 0), | |
a = Math.min(o, s), | |
l = this.slice(i, n), | |
c = t.slice(e, r), | |
h = 0; | |
h < a; | |
++h | |
) | |
if (l[h] !== c[h]) { | |
(o = l[h]), (s = c[h]); | |
break; | |
} | |
return o < s ? -1 : s < o ? 1 : 0; | |
}), | |
(O.prototype.includes = function (t, e, r) { | |
return this.indexOf(t, e, r) !== -1; | |
}), | |
(O.prototype.indexOf = function (t, e, r) { | |
return vc(this, t, e, r, !0); | |
}), | |
(O.prototype.lastIndexOf = function (t, e, r) { | |
return vc(this, t, e, r, !1); | |
}), | |
(O.prototype.write = function (t, e, r, i) { | |
if (e === void 0) (i = "utf8"), (r = this.length), (e = 0); | |
else if (r === void 0 && typeof e == "string") | |
(i = e), (r = this.length), (e = 0); | |
else { | |
if (!isFinite(e)) | |
throw new Error( | |
"Buffer.write(string, encoding, offset[, length]) is no longer supported", | |
); | |
(e >>>= 0), | |
isFinite(r) | |
? ((r >>>= 0), i === void 0 && (i = "utf8")) | |
: ((i = r), (r = void 0)); | |
} | |
var n = this.length - e; | |
if ( | |
((r === void 0 || r > n) && (r = n), | |
(t.length > 0 && (r < 0 || e < 0)) || e > this.length) | |
) | |
throw new RangeError("Attempt to write outside buffer bounds"); | |
i || (i = "utf8"); | |
for (var o = !1; ; ) | |
switch (i) { | |
case "hex": | |
return ww(this, t, e, r); | |
case "utf8": | |
case "utf-8": | |
return _w(this, t, e, r); | |
case "ascii": | |
return kc(this, t, e, r); | |
case "latin1": | |
case "binary": | |
return mw(this, t, e, r); | |
case "base64": | |
return vw(this, t, e, r); | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return Ew(this, t, e, r); | |
default: | |
if (o) throw new TypeError("Unknown encoding: " + i); | |
(i = ("" + i).toLowerCase()), (o = !0); | |
} | |
}), | |
(O.prototype.toJSON = function () { | |
return { | |
type: "Buffer", | |
data: Array.prototype.slice.call(this._arr || this, 0), | |
}; | |
}); | |
(O.prototype.slice = function (t, e) { | |
var r = this.length; | |
(t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), | |
(e = e === void 0 ? r : ~~e) < 0 | |
? (e += r) < 0 && (e = 0) | |
: e > r && (e = r), | |
e < t && (e = t); | |
var i = this.subarray(t, e); | |
return Object.setPrototypeOf(i, O.prototype), i; | |
}), | |
(O.prototype.readUIntLE = function (t, e, r) { | |
(t >>>= 0), (e >>>= 0), r || we(t, e, this.length); | |
for (var i = this[t], n = 1, o = 0; ++o < e && (n *= 256); ) | |
i += this[t + o] * n; | |
return i; | |
}), | |
(O.prototype.readUIntBE = function (t, e, r) { | |
(t >>>= 0), (e >>>= 0), r || we(t, e, this.length); | |
for (var i = this[t + --e], n = 1; e > 0 && (n *= 256); ) | |
i += this[t + --e] * n; | |
return i; | |
}), | |
(O.prototype.readUInt8 = function (t, e) { | |
return (t >>>= 0), e || we(t, 1, this.length), this[t]; | |
}), | |
(O.prototype.readUInt16LE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 2, this.length), this[t] | (this[t + 1] << 8) | |
); | |
}), | |
(O.prototype.readUInt16BE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 2, this.length), (this[t] << 8) | this[t + 1] | |
); | |
}), | |
(O.prototype.readUInt32LE = function (t, e) { | |
return ( | |
(t >>>= 0), | |
e || we(t, 4, this.length), | |
(this[t] | (this[t + 1] << 8) | (this[t + 2] << 16)) + | |
16777216 * this[t + 3] | |
); | |
}), | |
(O.prototype.readUInt32BE = function (t, e) { | |
return ( | |
(t >>>= 0), | |
e || we(t, 4, this.length), | |
16777216 * this[t] + | |
((this[t + 1] << 16) | (this[t + 2] << 8) | this[t + 3]) | |
); | |
}), | |
(O.prototype.readIntLE = function (t, e, r) { | |
(t >>>= 0), (e >>>= 0), r || we(t, e, this.length); | |
for (var i = this[t], n = 1, o = 0; ++o < e && (n *= 256); ) | |
i += this[t + o] * n; | |
return i >= (n *= 128) && (i -= Math.pow(2, 8 * e)), i; | |
}), | |
(O.prototype.readIntBE = function (t, e, r) { | |
(t >>>= 0), (e >>>= 0), r || we(t, e, this.length); | |
for (var i = e, n = 1, o = this[t + --i]; i > 0 && (n *= 256); ) | |
o += this[t + --i] * n; | |
return o >= (n *= 128) && (o -= Math.pow(2, 8 * e)), o; | |
}), | |
(O.prototype.readInt8 = function (t, e) { | |
return ( | |
(t >>>= 0), | |
e || we(t, 1, this.length), | |
128 & this[t] ? -1 * (255 - this[t] + 1) : this[t] | |
); | |
}), | |
(O.prototype.readInt16LE = function (t, e) { | |
(t >>>= 0), e || we(t, 2, this.length); | |
var r = this[t] | (this[t + 1] << 8); | |
return 32768 & r ? 4294901760 | r : r; | |
}), | |
(O.prototype.readInt16BE = function (t, e) { | |
(t >>>= 0), e || we(t, 2, this.length); | |
var r = this[t + 1] | (this[t] << 8); | |
return 32768 & r ? 4294901760 | r : r; | |
}), | |
(O.prototype.readInt32LE = function (t, e) { | |
return ( | |
(t >>>= 0), | |
e || we(t, 4, this.length), | |
this[t] | | |
(this[t + 1] << 8) | | |
(this[t + 2] << 16) | | |
(this[t + 3] << 24) | |
); | |
}), | |
(O.prototype.readInt32BE = function (t, e) { | |
return ( | |
(t >>>= 0), | |
e || we(t, 4, this.length), | |
(this[t] << 24) | | |
(this[t + 1] << 16) | | |
(this[t + 2] << 8) | | |
this[t + 3] | |
); | |
}), | |
(O.prototype.readFloatLE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 4, this.length), Dr.read(this, t, !0, 23, 4) | |
); | |
}), | |
(O.prototype.readFloatBE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 4, this.length), Dr.read(this, t, !1, 23, 4) | |
); | |
}), | |
(O.prototype.readDoubleLE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 8, this.length), Dr.read(this, t, !0, 52, 8) | |
); | |
}), | |
(O.prototype.readDoubleBE = function (t, e) { | |
return ( | |
(t >>>= 0), e || we(t, 8, this.length), Dr.read(this, t, !1, 52, 8) | |
); | |
}), | |
(O.prototype.writeUIntLE = function (t, e, r, i) { | |
(t = +t), | |
(e >>>= 0), | |
(r >>>= 0), | |
i || Pe(this, t, e, r, Math.pow(2, 8 * r) - 1, 0); | |
var n = 1, | |
o = 0; | |
for (this[e] = 255 & t; ++o < r && (n *= 256); ) | |
this[e + o] = (t / n) & 255; | |
return e + r; | |
}), | |
(O.prototype.writeUIntBE = function (t, e, r, i) { | |
(t = +t), | |
(e >>>= 0), | |
(r >>>= 0), | |
i || Pe(this, t, e, r, Math.pow(2, 8 * r) - 1, 0); | |
var n = r - 1, | |
o = 1; | |
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256); ) | |
this[e + n] = (t / o) & 255; | |
return e + r; | |
}), | |
(O.prototype.writeUInt8 = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 1, 255, 0), | |
(this[e] = 255 & t), | |
e + 1 | |
); | |
}), | |
(O.prototype.writeUInt16LE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 2, 65535, 0), | |
(this[e] = 255 & t), | |
(this[e + 1] = t >>> 8), | |
e + 2 | |
); | |
}), | |
(O.prototype.writeUInt16BE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 2, 65535, 0), | |
(this[e] = t >>> 8), | |
(this[e + 1] = 255 & t), | |
e + 2 | |
); | |
}), | |
(O.prototype.writeUInt32LE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 4, 4294967295, 0), | |
(this[e + 3] = t >>> 24), | |
(this[e + 2] = t >>> 16), | |
(this[e + 1] = t >>> 8), | |
(this[e] = 255 & t), | |
e + 4 | |
); | |
}), | |
(O.prototype.writeUInt32BE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 4, 4294967295, 0), | |
(this[e] = t >>> 24), | |
(this[e + 1] = t >>> 16), | |
(this[e + 2] = t >>> 8), | |
(this[e + 3] = 255 & t), | |
e + 4 | |
); | |
}), | |
(O.prototype.writeIntLE = function (t, e, r, i) { | |
if (((t = +t), (e >>>= 0), !i)) { | |
var n = Math.pow(2, 8 * r - 1); | |
Pe(this, t, e, r, n - 1, -n); | |
} | |
var o = 0, | |
s = 1, | |
a = 0; | |
for (this[e] = 255 & t; ++o < r && (s *= 256); ) | |
t < 0 && a === 0 && this[e + o - 1] !== 0 && (a = 1), | |
(this[e + o] = (((t / s) >> 0) - a) & 255); | |
return e + r; | |
}), | |
(O.prototype.writeIntBE = function (t, e, r, i) { | |
if (((t = +t), (e >>>= 0), !i)) { | |
var n = Math.pow(2, 8 * r - 1); | |
Pe(this, t, e, r, n - 1, -n); | |
} | |
var o = r - 1, | |
s = 1, | |
a = 0; | |
for (this[e + o] = 255 & t; --o >= 0 && (s *= 256); ) | |
t < 0 && a === 0 && this[e + o + 1] !== 0 && (a = 1), | |
(this[e + o] = (((t / s) >> 0) - a) & 255); | |
return e + r; | |
}), | |
(O.prototype.writeInt8 = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 1, 127, -128), | |
t < 0 && (t = 255 + t + 1), | |
(this[e] = 255 & t), | |
e + 1 | |
); | |
}), | |
(O.prototype.writeInt16LE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 2, 32767, -32768), | |
(this[e] = 255 & t), | |
(this[e + 1] = t >>> 8), | |
e + 2 | |
); | |
}), | |
(O.prototype.writeInt16BE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 2, 32767, -32768), | |
(this[e] = t >>> 8), | |
(this[e + 1] = 255 & t), | |
e + 2 | |
); | |
}), | |
(O.prototype.writeInt32LE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 4, 2147483647, -2147483648), | |
(this[e] = 255 & t), | |
(this[e + 1] = t >>> 8), | |
(this[e + 2] = t >>> 16), | |
(this[e + 3] = t >>> 24), | |
e + 4 | |
); | |
}), | |
(O.prototype.writeInt32BE = function (t, e, r) { | |
return ( | |
(t = +t), | |
(e >>>= 0), | |
r || Pe(this, t, e, 4, 2147483647, -2147483648), | |
t < 0 && (t = 4294967295 + t + 1), | |
(this[e] = t >>> 24), | |
(this[e + 1] = t >>> 16), | |
(this[e + 2] = t >>> 8), | |
(this[e + 3] = 255 & t), | |
e + 4 | |
); | |
}), | |
(O.prototype.writeFloatLE = function (t, e, r) { | |
return Sc(this, t, e, !0, r); | |
}), | |
(O.prototype.writeFloatBE = function (t, e, r) { | |
return Sc(this, t, e, !1, r); | |
}), | |
(O.prototype.writeDoubleLE = function (t, e, r) { | |
return Ac(this, t, e, !0, r); | |
}), | |
(O.prototype.writeDoubleBE = function (t, e, r) { | |
return Ac(this, t, e, !1, r); | |
}), | |
(O.prototype.copy = function (t, e, r, i) { | |
if (!O.isBuffer(t)) | |
throw new TypeError("argument should be a Buffer"); | |
if ( | |
(r || (r = 0), | |
i || i === 0 || (i = this.length), | |
e >= t.length && (e = t.length), | |
e || (e = 0), | |
i > 0 && i < r && (i = r), | |
i === r || t.length === 0 || this.length === 0) | |
) | |
return 0; | |
if (e < 0) throw new RangeError("targetStart out of bounds"); | |
if (r < 0 || r >= this.length) | |
throw new RangeError("Index out of range"); | |
if (i < 0) throw new RangeError("sourceEnd out of bounds"); | |
i > this.length && (i = this.length), | |
t.length - e < i - r && (i = t.length - e + r); | |
var n = i - r; | |
if ( | |
this === t && | |
typeof Uint8Array.prototype.copyWithin == "function" | |
) | |
this.copyWithin(e, r, i); | |
else if (this === t && r < e && e < i) | |
for (var o = n - 1; o >= 0; --o) t[o + e] = this[o + r]; | |
else Uint8Array.prototype.set.call(t, this.subarray(r, i), e); | |
return n; | |
}), | |
(O.prototype.fill = function (t, e, r, i) { | |
if (typeof t == "string") { | |
if ( | |
(typeof e == "string" | |
? ((i = e), (e = 0), (r = this.length)) | |
: typeof r == "string" && ((i = r), (r = this.length)), | |
i !== void 0 && typeof i != "string") | |
) | |
throw new TypeError("encoding must be a string"); | |
if (typeof i == "string" && !O.isEncoding(i)) | |
throw new TypeError("Unknown encoding: " + i); | |
if (t.length === 1) { | |
var n = t.charCodeAt(0); | |
((i === "utf8" && n < 128) || i === "latin1") && (t = n); | |
} | |
} else | |
typeof t == "number" | |
? (t &= 255) | |
: typeof t == "boolean" && (t = Number(t)); | |
if (e < 0 || this.length < e || this.length < r) | |
throw new RangeError("Out of range index"); | |
if (r <= e) return this; | |
var o; | |
if ( | |
((e >>>= 0), | |
(r = r === void 0 ? this.length : r >>> 0), | |
t || (t = 0), | |
typeof t == "number") | |
) | |
for (o = e; o < r; ++o) this[o] = t; | |
else { | |
var s = O.isBuffer(t) ? t : O.from(t, i), | |
a = s.length; | |
if (a === 0) | |
throw new TypeError( | |
'The value "' + t + '" is invalid for argument "value"', | |
); | |
for (o = 0; o < r - e; ++o) this[o + e] = s[o % a]; | |
} | |
return this; | |
}); | |
Cw = /[^+/0-9A-Za-z-_]/g; | |
Bw = (function () { | |
for (var t = new Array(256), e = 0; e < 16; ++e) | |
for (var r = 16 * e, i = 0; i < 16; ++i) | |
t[r + i] = "0123456789abcdef"[e] + "0123456789abcdef"[i]; | |
return t; | |
})(); | |
At.Buffer; | |
At.INSPECT_MAX_BYTES; | |
At.kMaxLength; | |
(un = {}), (fn = At), (it = fn.Buffer); | |
it.from && it.alloc && it.allocUnsafe && it.allocUnsafeSlow | |
? (un = fn) | |
: (Ic(fn, un), (un.Buffer = lr)), | |
(lr.prototype = Object.create(it.prototype)), | |
Ic(it, lr), | |
(lr.from = function (t, e, r) { | |
if (typeof t == "number") | |
throw new TypeError("Argument must not be a number"); | |
return it(t, e, r); | |
}), | |
(lr.alloc = function (t, e, r) { | |
if (typeof t != "number") | |
throw new TypeError("Argument must be a number"); | |
var i = it(t); | |
return ( | |
e !== void 0 | |
? typeof r == "string" | |
? i.fill(e, r) | |
: i.fill(e) | |
: i.fill(0), | |
i | |
); | |
}), | |
(lr.allocUnsafe = function (t) { | |
if (typeof t != "number") | |
throw new TypeError("Argument must be a number"); | |
return it(t); | |
}), | |
(lr.allocUnsafeSlow = function (t) { | |
if (typeof t != "number") | |
throw new TypeError("Argument must be a number"); | |
return fn.SlowBuffer(t); | |
}); | |
(Pw = un), | |
(ur = {}), | |
(Qs = Pw.Buffer), | |
(Tc = | |
Qs.isEncoding || | |
function (t) { | |
switch ((t = "" + t) && t.toLowerCase()) { | |
case "hex": | |
case "utf8": | |
case "utf-8": | |
case "ascii": | |
case "binary": | |
case "base64": | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
case "raw": | |
return !0; | |
default: | |
return !1; | |
} | |
}); | |
(ur.StringDecoder = pi), | |
(pi.prototype.write = function (t) { | |
if (t.length === 0) return ""; | |
var e, r; | |
if (this.lastNeed) { | |
if ((e = this.fillLast(t)) === void 0) return ""; | |
(r = this.lastNeed), (this.lastNeed = 0); | |
} else r = 0; | |
return r < t.length | |
? e | |
? e + this.text(t, r) | |
: this.text(t, r) | |
: e || ""; | |
}), | |
(pi.prototype.end = function (t) { | |
var e = t && t.length ? this.write(t) : ""; | |
return this.lastNeed ? e + "\uFFFD" : e; | |
}), | |
(pi.prototype.text = function (t, e) { | |
var r = (function (n, o, s) { | |
var a = o.length - 1; | |
if (a < s) return 0; | |
var l = Vs(o[a]); | |
return l >= 0 | |
? (l > 0 && (n.lastNeed = l - 1), l) | |
: --a < s || l === -2 | |
? 0 | |
: (l = Vs(o[a])) >= 0 | |
? (l > 0 && (n.lastNeed = l - 2), l) | |
: --a < s || l === -2 | |
? 0 | |
: (l = Vs(o[a])) >= 0 | |
? (l > 0 && (l === 2 ? (l = 0) : (n.lastNeed = l - 3)), l) | |
: 0; | |
})(this, t, e); | |
if (!this.lastNeed) return t.toString("utf8", e); | |
this.lastTotal = r; | |
var i = t.length - (r - this.lastNeed); | |
return t.copy(this.lastChar, 0, i), t.toString("utf8", e, i); | |
}), | |
(pi.prototype.fillLast = function (t) { | |
if (this.lastNeed <= t.length) | |
return ( | |
t.copy( | |
this.lastChar, | |
this.lastTotal - this.lastNeed, | |
0, | |
this.lastNeed, | |
), | |
this.lastChar.toString(this.encoding, 0, this.lastTotal) | |
); | |
t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length), | |
(this.lastNeed -= t.length); | |
}); | |
ur.StringDecoder; | |
ur.StringDecoder; | |
}); | |
var Lc = {}; | |
Jt(Lc, { StringDecoder: () => qw, default: () => ur }); | |
var qw, | |
Uc = _e(() => { | |
_(); | |
v(); | |
m(); | |
Xs(); | |
Xs(); | |
qw = ur.StringDecoder; | |
}); | |
var Zs = M((qT, jc) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var Nc = Nt(), | |
{ | |
PromisePrototypeThen: Dw, | |
SymbolAsyncIterator: qc, | |
SymbolIterator: Dc, | |
} = ce(), | |
{ Buffer: jw } = (be(), X(me)), | |
{ ERR_INVALID_ARG_TYPE: Fw, ERR_STREAM_NULL_VALUES: Ww } = Ae().codes; | |
function $w(t, e, r) { | |
let i; | |
if (typeof e == "string" || e instanceof jw) | |
return new t({ | |
objectMode: !0, | |
...r, | |
read() { | |
this.push(e), this.push(null); | |
}, | |
}); | |
let n; | |
if (e && e[qc]) (n = !0), (i = e[qc]()); | |
else if (e && e[Dc]) (n = !1), (i = e[Dc]()); | |
else throw new Fw("iterable", ["Iterable"], e); | |
let o = new t({ objectMode: !0, highWaterMark: 1, ...r }), | |
s = !1; | |
(o._read = function () { | |
s || ((s = !0), l()); | |
}), | |
(o._destroy = function (c, h) { | |
Dw( | |
a(c), | |
() => Nc.nextTick(h, c), | |
(d) => Nc.nextTick(h, d || c), | |
); | |
}); | |
async function a(c) { | |
let h = c != null, | |
d = typeof i.throw == "function"; | |
if (h && d) { | |
let { value: g, done: y } = await i.throw(c); | |
if ((await g, y)) return; | |
} | |
if (typeof i.return == "function") { | |
let { value: g } = await i.return(); | |
await g; | |
} | |
} | |
async function l() { | |
for (;;) { | |
try { | |
let { value: c, done: h } = n ? await i.next() : i.next(); | |
if (h) o.push(null); | |
else { | |
let d = c && typeof c.then == "function" ? await c : c; | |
if (d === null) throw ((s = !1), new Ww()); | |
if (o.push(d)) continue; | |
s = !1; | |
} | |
} catch (c) { | |
o.destroy(c); | |
} | |
break; | |
} | |
} | |
return o; | |
} | |
jc.exports = $w; | |
}); | |
var gi = M((VT, Zc) => { | |
_(); | |
v(); | |
m(); | |
var He = Nt(), | |
{ | |
ArrayPrototypeIndexOf: Hw, | |
NumberIsInteger: Vw, | |
NumberIsNaN: zw, | |
NumberParseInt: Kw, | |
ObjectDefineProperties: $c, | |
ObjectKeys: Gw, | |
ObjectSetPrototypeOf: Hc, | |
Promise: Qw, | |
SafeSet: Yw, | |
SymbolAsyncIterator: Jw, | |
Symbol: Xw, | |
} = ce(); | |
Zc.exports = F; | |
F.ReadableState = so; | |
var { EventEmitter: Zw } = (sr(), X(nr)), | |
{ Stream: Dt, prependListener: e_ } = nn(), | |
{ Buffer: eo } = (be(), X(me)), | |
{ addAbortSignal: t_ } = di(), | |
r_ = vt(), | |
H = Je().debuglog("stream", (t) => { | |
H = t; | |
}), | |
i_ = dc(), | |
Fr = ir(), | |
{ getHighWaterMark: n_, getDefaultHighWaterMark: s_ } = an(), | |
{ | |
aggregateTwoErrors: Fc, | |
codes: { | |
ERR_INVALID_ARG_TYPE: o_, | |
ERR_METHOD_NOT_IMPLEMENTED: a_, | |
ERR_OUT_OF_RANGE: l_, | |
ERR_STREAM_PUSH_AFTER_EOF: u_, | |
ERR_STREAM_UNSHIFT_AFTER_END_EVENT: f_, | |
}, | |
} = Ae(), | |
{ validateObject: c_ } = hi(), | |
fr = Xw("kPaused"), | |
{ StringDecoder: Vc } = (Uc(), X(Lc)), | |
h_ = Zs(); | |
Hc(F.prototype, Dt.prototype); | |
Hc(F, Dt); | |
var to = () => {}, | |
{ errorOrDestroy: jr } = Fr; | |
function so(t, e, r) { | |
typeof r != "boolean" && (r = e instanceof nt()), | |
(this.objectMode = !!(t && t.objectMode)), | |
r && | |
(this.objectMode = this.objectMode || !!(t && t.readableObjectMode)), | |
(this.highWaterMark = t | |
? n_(this, t, "readableHighWaterMark", r) | |
: s_(!1)), | |
(this.buffer = new i_()), | |
(this.length = 0), | |
(this.pipes = []), | |
(this.flowing = null), | |
(this.ended = !1), | |
(this.endEmitted = !1), | |
(this.reading = !1), | |
(this.constructed = !0), | |
(this.sync = !0), | |
(this.needReadable = !1), | |
(this.emittedReadable = !1), | |
(this.readableListening = !1), | |
(this.resumeScheduled = !1), | |
(this[fr] = null), | |
(this.errorEmitted = !1), | |
(this.emitClose = !t || t.emitClose !== !1), | |
(this.autoDestroy = !t || t.autoDestroy !== !1), | |
(this.destroyed = !1), | |
(this.errored = null), | |
(this.closed = !1), | |
(this.closeEmitted = !1), | |
(this.defaultEncoding = (t && t.defaultEncoding) || "utf8"), | |
(this.awaitDrainWriters = null), | |
(this.multiAwaitDrain = !1), | |
(this.readingMore = !1), | |
(this.dataEmitted = !1), | |
(this.decoder = null), | |
(this.encoding = null), | |
t && | |
t.encoding && | |
((this.decoder = new Vc(t.encoding)), (this.encoding = t.encoding)); | |
} | |
function F(t) { | |
if (!(this instanceof F)) return new F(t); | |
let e = this instanceof nt(); | |
(this._readableState = new so(t, this, e)), | |
t && | |
(typeof t.read == "function" && (this._read = t.read), | |
typeof t.destroy == "function" && (this._destroy = t.destroy), | |
typeof t.construct == "function" && (this._construct = t.construct), | |
t.signal && !e && t_(t.signal, this)), | |
Dt.call(this, t), | |
Fr.construct(this, () => { | |
this._readableState.needReadable && hn(this, this._readableState); | |
}); | |
} | |
F.prototype.destroy = Fr.destroy; | |
F.prototype._undestroy = Fr.undestroy; | |
F.prototype._destroy = function (t, e) { | |
e(t); | |
}; | |
F.prototype[Zw.captureRejectionSymbol] = function (t) { | |
this.destroy(t); | |
}; | |
F.prototype.push = function (t, e) { | |
return zc(this, t, e, !1); | |
}; | |
F.prototype.unshift = function (t, e) { | |
return zc(this, t, e, !0); | |
}; | |
function zc(t, e, r, i) { | |
H("readableAddChunk", e); | |
let n = t._readableState, | |
o; | |
if ( | |
(n.objectMode || | |
(typeof e == "string" | |
? ((r = r || n.defaultEncoding), | |
n.encoding !== r && | |
(i && n.encoding | |
? (e = eo.from(e, r).toString(n.encoding)) | |
: ((e = eo.from(e, r)), (r = "")))) | |
: e instanceof eo | |
? (r = "") | |
: Dt._isUint8Array(e) | |
? ((e = Dt._uint8ArrayToBuffer(e)), (r = "")) | |
: e != null && | |
(o = new o_("chunk", ["string", "Buffer", "Uint8Array"], e))), | |
o) | |
) | |
jr(t, o); | |
else if (e === null) (n.reading = !1), g_(t, n); | |
else if (n.objectMode || (e && e.length > 0)) | |
if (i) | |
if (n.endEmitted) jr(t, new f_()); | |
else { | |
if (n.destroyed || n.errored) return !1; | |
ro(t, n, e, !0); | |
} | |
else if (n.ended) jr(t, new u_()); | |
else { | |
if (n.destroyed || n.errored) return !1; | |
(n.reading = !1), | |
n.decoder && !r | |
? ((e = n.decoder.write(e)), | |
n.objectMode || e.length !== 0 ? ro(t, n, e, !1) : hn(t, n)) | |
: ro(t, n, e, !1); | |
} | |
else i || ((n.reading = !1), hn(t, n)); | |
return !n.ended && (n.length < n.highWaterMark || n.length === 0); | |
} | |
function ro(t, e, r, i) { | |
e.flowing && e.length === 0 && !e.sync && t.listenerCount("data") > 0 | |
? (e.multiAwaitDrain | |
? e.awaitDrainWriters.clear() | |
: (e.awaitDrainWriters = null), | |
(e.dataEmitted = !0), | |
t.emit("data", r)) | |
: ((e.length += e.objectMode ? 1 : r.length), | |
i ? e.buffer.unshift(r) : e.buffer.push(r), | |
e.needReadable && dn(t)), | |
hn(t, e); | |
} | |
F.prototype.isPaused = function () { | |
let t = this._readableState; | |
return t[fr] === !0 || t.flowing === !1; | |
}; | |
F.prototype.setEncoding = function (t) { | |
let e = new Vc(t); | |
(this._readableState.decoder = e), | |
(this._readableState.encoding = this._readableState.decoder.encoding); | |
let r = this._readableState.buffer, | |
i = ""; | |
for (let n of r) i += e.write(n); | |
return ( | |
r.clear(), | |
i !== "" && r.push(i), | |
(this._readableState.length = i.length), | |
this | |
); | |
}; | |
var d_ = 1073741824; | |
function p_(t) { | |
if (t > d_) throw new l_("size", "<= 1GiB", t); | |
return ( | |
t--, | |
(t |= t >>> 1), | |
(t |= t >>> 2), | |
(t |= t >>> 4), | |
(t |= t >>> 8), | |
(t |= t >>> 16), | |
t++, | |
t | |
); | |
} | |
function Wc(t, e) { | |
return t <= 0 || (e.length === 0 && e.ended) | |
? 0 | |
: e.objectMode | |
? 1 | |
: zw(t) | |
? e.flowing && e.length | |
? e.buffer.first().length | |
: e.length | |
: t <= e.length | |
? t | |
: e.ended | |
? e.length | |
: 0; | |
} | |
F.prototype.read = function (t) { | |
H("read", t), t === void 0 ? (t = NaN) : Vw(t) || (t = Kw(t, 10)); | |
let e = this._readableState, | |
r = t; | |
if ( | |
(t > e.highWaterMark && (e.highWaterMark = p_(t)), | |
t !== 0 && (e.emittedReadable = !1), | |
t === 0 && | |
e.needReadable && | |
((e.highWaterMark !== 0 | |
? e.length >= e.highWaterMark | |
: e.length > 0) || | |
e.ended)) | |
) | |
return ( | |
H("read: emitReadable", e.length, e.ended), | |
e.length === 0 && e.ended ? io(this) : dn(this), | |
null | |
); | |
if (((t = Wc(t, e)), t === 0 && e.ended)) | |
return e.length === 0 && io(this), null; | |
let i = e.needReadable; | |
if ( | |
(H("need readable", i), | |
(e.length === 0 || e.length - t < e.highWaterMark) && | |
((i = !0), H("length less than watermark", i)), | |
e.ended || e.reading || e.destroyed || e.errored || !e.constructed) | |
) | |
(i = !1), H("reading, ended or constructing", i); | |
else if (i) { | |
H("do read"), | |
(e.reading = !0), | |
(e.sync = !0), | |
e.length === 0 && (e.needReadable = !0); | |
try { | |
this._read(e.highWaterMark); | |
} catch (o) { | |
jr(this, o); | |
} | |
(e.sync = !1), e.reading || (t = Wc(r, e)); | |
} | |
let n; | |
return ( | |
t > 0 ? (n = Jc(t, e)) : (n = null), | |
n === null | |
? ((e.needReadable = e.length <= e.highWaterMark), (t = 0)) | |
: ((e.length -= t), | |
e.multiAwaitDrain | |
? e.awaitDrainWriters.clear() | |
: (e.awaitDrainWriters = null)), | |
e.length === 0 && | |
(e.ended || (e.needReadable = !0), r !== t && e.ended && io(this)), | |
n !== null && | |
!e.errorEmitted && | |
!e.closeEmitted && | |
((e.dataEmitted = !0), this.emit("data", n)), | |
n | |
); | |
}; | |
function g_(t, e) { | |
if ((H("onEofChunk"), !e.ended)) { | |
if (e.decoder) { | |
let r = e.decoder.end(); | |
r && | |
r.length && | |
(e.buffer.push(r), (e.length += e.objectMode ? 1 : r.length)); | |
} | |
(e.ended = !0), | |
e.sync | |
? dn(t) | |
: ((e.needReadable = !1), (e.emittedReadable = !0), Kc(t)); | |
} | |
} | |
function dn(t) { | |
let e = t._readableState; | |
H("emitReadable", e.needReadable, e.emittedReadable), | |
(e.needReadable = !1), | |
e.emittedReadable || | |
(H("emitReadable", e.flowing), | |
(e.emittedReadable = !0), | |
He.nextTick(Kc, t)); | |
} | |
function Kc(t) { | |
let e = t._readableState; | |
H("emitReadable_", e.destroyed, e.length, e.ended), | |
!e.destroyed && | |
!e.errored && | |
(e.length || e.ended) && | |
(t.emit("readable"), (e.emittedReadable = !1)), | |
(e.needReadable = | |
!e.flowing && !e.ended && e.length <= e.highWaterMark), | |
Qc(t); | |
} | |
function hn(t, e) { | |
!e.readingMore && | |
e.constructed && | |
((e.readingMore = !0), He.nextTick(y_, t, e)); | |
} | |
function y_(t, e) { | |
for ( | |
; | |
!e.reading && | |
!e.ended && | |
(e.length < e.highWaterMark || (e.flowing && e.length === 0)); | |
) { | |
let r = e.length; | |
if ((H("maybeReadMore read 0"), t.read(0), r === e.length)) break; | |
} | |
e.readingMore = !1; | |
} | |
F.prototype._read = function (t) { | |
throw new a_("_read()"); | |
}; | |
F.prototype.pipe = function (t, e) { | |
let r = this, | |
i = this._readableState; | |
i.pipes.length === 1 && | |
(i.multiAwaitDrain || | |
((i.multiAwaitDrain = !0), | |
(i.awaitDrainWriters = new Yw( | |
i.awaitDrainWriters ? [i.awaitDrainWriters] : [], | |
)))), | |
i.pipes.push(t), | |
H("pipe count=%d opts=%j", i.pipes.length, e); | |
let o = | |
(!e || e.end !== !1) && t !== He.stdout && t !== He.stderr ? a : E; | |
i.endEmitted ? He.nextTick(o) : r.once("end", o), t.on("unpipe", s); | |
function s(I, C) { | |
H("onunpipe"), | |
I === r && C && C.hasUnpiped === !1 && ((C.hasUnpiped = !0), h()); | |
} | |
function a() { | |
H("onend"), t.end(); | |
} | |
let l, | |
c = !1; | |
function h() { | |
H("cleanup"), | |
t.removeListener("close", w), | |
t.removeListener("finish", S), | |
l && t.removeListener("drain", l), | |
t.removeListener("error", y), | |
t.removeListener("unpipe", s), | |
r.removeListener("end", a), | |
r.removeListener("end", E), | |
r.removeListener("data", g), | |
(c = !0), | |
l && | |
i.awaitDrainWriters && | |
(!t._writableState || t._writableState.needDrain) && | |
l(); | |
} | |
function d() { | |
c || | |
(i.pipes.length === 1 && i.pipes[0] === t | |
? (H("false write response, pause", 0), | |
(i.awaitDrainWriters = t), | |
(i.multiAwaitDrain = !1)) | |
: i.pipes.length > 1 && | |
i.pipes.includes(t) && | |
(H("false write response, pause", i.awaitDrainWriters.size), | |
i.awaitDrainWriters.add(t)), | |
r.pause()), | |
l || ((l = b_(r, t)), t.on("drain", l)); | |
} | |
r.on("data", g); | |
function g(I) { | |
H("ondata"); | |
let C = t.write(I); | |
H("dest.write", C), C === !1 && d(); | |
} | |
function y(I) { | |
if ( | |
(H("onerror", I), | |
E(), | |
t.removeListener("error", y), | |
t.listenerCount("error") === 0) | |
) { | |
let C = t._writableState || t._readableState; | |
C && !C.errorEmitted ? jr(t, I) : t.emit("error", I); | |
} | |
} | |
e_(t, "error", y); | |
function w() { | |
t.removeListener("finish", S), E(); | |
} | |
t.once("close", w); | |
function S() { | |
H("onfinish"), t.removeListener("close", w), E(); | |
} | |
t.once("finish", S); | |
function E() { | |
H("unpipe"), r.unpipe(t); | |
} | |
return ( | |
t.emit("pipe", r), | |
t.writableNeedDrain === !0 | |
? i.flowing && d() | |
: i.flowing || (H("pipe resume"), r.resume()), | |
t | |
); | |
}; | |
function b_(t, e) { | |
return function () { | |
let i = t._readableState; | |
i.awaitDrainWriters === e | |
? (H("pipeOnDrain", 1), (i.awaitDrainWriters = null)) | |
: i.multiAwaitDrain && | |
(H("pipeOnDrain", i.awaitDrainWriters.size), | |
i.awaitDrainWriters.delete(e)), | |
(!i.awaitDrainWriters || i.awaitDrainWriters.size === 0) && | |
t.listenerCount("data") && | |
t.resume(); | |
}; | |
} | |
F.prototype.unpipe = function (t) { | |
let e = this._readableState, | |
r = { hasUnpiped: !1 }; | |
if (e.pipes.length === 0) return this; | |
if (!t) { | |
let n = e.pipes; | |
(e.pipes = []), this.pause(); | |
for (let o = 0; o < n.length; o++) | |
n[o].emit("unpipe", this, { hasUnpiped: !1 }); | |
return this; | |
} | |
let i = Hw(e.pipes, t); | |
return i === -1 | |
? this | |
: (e.pipes.splice(i, 1), | |
e.pipes.length === 0 && this.pause(), | |
t.emit("unpipe", this, r), | |
this); | |
}; | |
F.prototype.on = function (t, e) { | |
let r = Dt.prototype.on.call(this, t, e), | |
i = this._readableState; | |
return ( | |
t === "data" | |
? ((i.readableListening = this.listenerCount("readable") > 0), | |
i.flowing !== !1 && this.resume()) | |
: t === "readable" && | |
!i.endEmitted && | |
!i.readableListening && | |
((i.readableListening = i.needReadable = !0), | |
(i.flowing = !1), | |
(i.emittedReadable = !1), | |
H("on readable", i.length, i.reading), | |
i.length ? dn(this) : i.reading || He.nextTick(w_, this)), | |
r | |
); | |
}; | |
F.prototype.addListener = F.prototype.on; | |
F.prototype.removeListener = function (t, e) { | |
let r = Dt.prototype.removeListener.call(this, t, e); | |
return t === "readable" && He.nextTick(Gc, this), r; | |
}; | |
F.prototype.off = F.prototype.removeListener; | |
F.prototype.removeAllListeners = function (t) { | |
let e = Dt.prototype.removeAllListeners.apply(this, arguments); | |
return (t === "readable" || t === void 0) && He.nextTick(Gc, this), e; | |
}; | |
function Gc(t) { | |
let e = t._readableState; | |
(e.readableListening = t.listenerCount("readable") > 0), | |
e.resumeScheduled && e[fr] === !1 | |
? (e.flowing = !0) | |
: t.listenerCount("data") > 0 | |
? t.resume() | |
: e.readableListening || (e.flowing = null); | |
} | |
function w_(t) { | |
H("readable nexttick read 0"), t.read(0); | |
} | |
F.prototype.resume = function () { | |
let t = this._readableState; | |
return ( | |
t.flowing || | |
(H("resume"), (t.flowing = !t.readableListening), __(this, t)), | |
(t[fr] = !1), | |
this | |
); | |
}; | |
function __(t, e) { | |
e.resumeScheduled || ((e.resumeScheduled = !0), He.nextTick(m_, t, e)); | |
} | |
function m_(t, e) { | |
H("resume", e.reading), | |
e.reading || t.read(0), | |
(e.resumeScheduled = !1), | |
t.emit("resume"), | |
Qc(t), | |
e.flowing && !e.reading && t.read(0); | |
} | |
F.prototype.pause = function () { | |
return ( | |
H("call pause flowing=%j", this._readableState.flowing), | |
this._readableState.flowing !== !1 && | |
(H("pause"), (this._readableState.flowing = !1), this.emit("pause")), | |
(this._readableState[fr] = !0), | |
this | |
); | |
}; | |
function Qc(t) { | |
let e = t._readableState; | |
for (H("flow", e.flowing); e.flowing && t.read() !== null; ); | |
} | |
F.prototype.wrap = function (t) { | |
let e = !1; | |
t.on("data", (i) => { | |
!this.push(i) && t.pause && ((e = !0), t.pause()); | |
}), | |
t.on("end", () => { | |
this.push(null); | |
}), | |
t.on("error", (i) => { | |
jr(this, i); | |
}), | |
t.on("close", () => { | |
this.destroy(); | |
}), | |
t.on("destroy", () => { | |
this.destroy(); | |
}), | |
(this._read = () => { | |
e && t.resume && ((e = !1), t.resume()); | |
}); | |
let r = Gw(t); | |
for (let i = 1; i < r.length; i++) { | |
let n = r[i]; | |
this[n] === void 0 && | |
typeof t[n] == "function" && | |
(this[n] = t[n].bind(t)); | |
} | |
return this; | |
}; | |
F.prototype[Jw] = function () { | |
return Yc(this); | |
}; | |
F.prototype.iterator = function (t) { | |
return t !== void 0 && c_(t, "options"), Yc(this, t); | |
}; | |
function Yc(t, e) { | |
typeof t.read != "function" && (t = F.wrap(t, { objectMode: !0 })); | |
let r = v_(t, e); | |
return (r.stream = t), r; | |
} | |
async function* v_(t, e) { | |
let r = to; | |
function i(s) { | |
this === t ? (r(), (r = to)) : (r = s); | |
} | |
t.on("readable", i); | |
let n, | |
o = r_(t, { writable: !1 }, (s) => { | |
(n = s ? Fc(n, s) : null), r(), (r = to); | |
}); | |
try { | |
for (;;) { | |
let s = t.destroyed ? null : t.read(); | |
if (s !== null) yield s; | |
else { | |
if (n) throw n; | |
if (n === null) return; | |
await new Qw(i); | |
} | |
} | |
} catch (s) { | |
throw ((n = Fc(n, s)), n); | |
} finally { | |
(n || e?.destroyOnReturn !== !1) && | |
(n === void 0 || t._readableState.autoDestroy) | |
? Fr.destroyer(t, null) | |
: (t.off("readable", i), o()); | |
} | |
} | |
$c(F.prototype, { | |
readable: { | |
__proto__: null, | |
get() { | |
let t = this._readableState; | |
return ( | |
!!t && | |
t.readable !== !1 && | |
!t.destroyed && | |
!t.errorEmitted && | |
!t.endEmitted | |
); | |
}, | |
set(t) { | |
this._readableState && (this._readableState.readable = !!t); | |
}, | |
}, | |
readableDidRead: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return this._readableState.dataEmitted; | |
}, | |
}, | |
readableAborted: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return !!( | |
this._readableState.readable !== !1 && | |
(this._readableState.destroyed || this._readableState.errored) && | |
!this._readableState.endEmitted | |
); | |
}, | |
}, | |
readableHighWaterMark: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return this._readableState.highWaterMark; | |
}, | |
}, | |
readableBuffer: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return this._readableState && this._readableState.buffer; | |
}, | |
}, | |
readableFlowing: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return this._readableState.flowing; | |
}, | |
set: function (t) { | |
this._readableState && (this._readableState.flowing = t); | |
}, | |
}, | |
readableLength: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState.length; | |
}, | |
}, | |
readableObjectMode: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState ? this._readableState.objectMode : !1; | |
}, | |
}, | |
readableEncoding: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState ? this._readableState.encoding : null; | |
}, | |
}, | |
errored: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState ? this._readableState.errored : null; | |
}, | |
}, | |
closed: { | |
__proto__: null, | |
get() { | |
return this._readableState ? this._readableState.closed : !1; | |
}, | |
}, | |
destroyed: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState ? this._readableState.destroyed : !1; | |
}, | |
set(t) { | |
this._readableState && (this._readableState.destroyed = t); | |
}, | |
}, | |
readableEnded: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._readableState ? this._readableState.endEmitted : !1; | |
}, | |
}, | |
}); | |
$c(so.prototype, { | |
pipesCount: { | |
__proto__: null, | |
get() { | |
return this.pipes.length; | |
}, | |
}, | |
paused: { | |
__proto__: null, | |
get() { | |
return this[fr] !== !1; | |
}, | |
set(t) { | |
this[fr] = !!t; | |
}, | |
}, | |
}); | |
F._fromList = Jc; | |
function Jc(t, e) { | |
if (e.length === 0) return null; | |
let r; | |
return ( | |
e.objectMode | |
? (r = e.buffer.shift()) | |
: !t || t >= e.length | |
? (e.decoder | |
? (r = e.buffer.join("")) | |
: e.buffer.length === 1 | |
? (r = e.buffer.first()) | |
: (r = e.buffer.concat(e.length)), | |
e.buffer.clear()) | |
: (r = e.buffer.consume(t, e.decoder)), | |
r | |
); | |
} | |
function io(t) { | |
let e = t._readableState; | |
H("endReadable", e.endEmitted), | |
e.endEmitted || ((e.ended = !0), He.nextTick(E_, e, t)); | |
} | |
function E_(t, e) { | |
if ( | |
(H("endReadableNT", t.endEmitted, t.length), | |
!t.errored && !t.closeEmitted && !t.endEmitted && t.length === 0) | |
) { | |
if ( | |
((t.endEmitted = !0), | |
e.emit("end"), | |
e.writable && e.allowHalfOpen === !1) | |
) | |
He.nextTick(S_, e); | |
else if (t.autoDestroy) { | |
let r = e._writableState; | |
(!r || (r.autoDestroy && (r.finished || r.writable === !1))) && | |
e.destroy(); | |
} | |
} | |
} | |
function S_(t) { | |
t.writable && !t.writableEnded && !t.destroyed && t.end(); | |
} | |
F.from = function (t, e) { | |
return h_(F, t, e); | |
}; | |
var no; | |
function Xc() { | |
return no === void 0 && (no = {}), no; | |
} | |
F.fromWeb = function (t, e) { | |
return Xc().newStreamReadableFromReadableStream(t, e); | |
}; | |
F.toWeb = function (t, e) { | |
return Xc().newReadableStreamFromStreamReadable(t, e); | |
}; | |
F.wrap = function (t, e) { | |
var r, i; | |
return new F({ | |
objectMode: | |
(r = | |
(i = t.readableObjectMode) !== null && i !== void 0 | |
? i | |
: t.objectMode) !== null && r !== void 0 | |
? r | |
: !0, | |
...e, | |
destroy(n, o) { | |
Fr.destroyer(t, n), o(n); | |
}, | |
}).wrap(t); | |
}; | |
}); | |
var ho = M((XT, ch) => { | |
_(); | |
v(); | |
m(); | |
var cr = Nt(), | |
{ | |
ArrayPrototypeSlice: rh, | |
Error: A_, | |
FunctionPrototypeSymbolHasInstance: ih, | |
ObjectDefineProperty: nh, | |
ObjectDefineProperties: I_, | |
ObjectSetPrototypeOf: sh, | |
StringPrototypeToLowerCase: T_, | |
Symbol: R_, | |
SymbolHasInstance: C_, | |
} = ce(); | |
ch.exports = ie; | |
ie.WritableState = wi; | |
var { EventEmitter: B_ } = (sr(), X(nr)), | |
yi = nn().Stream, | |
{ Buffer: pn } = (be(), X(me)), | |
bn = ir(), | |
{ addAbortSignal: P_ } = di(), | |
{ getHighWaterMark: k_, getDefaultHighWaterMark: O_ } = an(), | |
{ | |
ERR_INVALID_ARG_TYPE: x_, | |
ERR_METHOD_NOT_IMPLEMENTED: M_, | |
ERR_MULTIPLE_CALLBACK: oh, | |
ERR_STREAM_CANNOT_PIPE: L_, | |
ERR_STREAM_DESTROYED: bi, | |
ERR_STREAM_ALREADY_FINISHED: U_, | |
ERR_STREAM_NULL_VALUES: N_, | |
ERR_STREAM_WRITE_AFTER_END: q_, | |
ERR_UNKNOWN_ENCODING: ah, | |
} = Ae().codes, | |
{ errorOrDestroy: Wr } = bn; | |
sh(ie.prototype, yi.prototype); | |
sh(ie, yi); | |
function lo() {} | |
var $r = R_("kOnFinished"); | |
function wi(t, e, r) { | |
typeof r != "boolean" && (r = e instanceof nt()), | |
(this.objectMode = !!(t && t.objectMode)), | |
r && | |
(this.objectMode = this.objectMode || !!(t && t.writableObjectMode)), | |
(this.highWaterMark = t | |
? k_(this, t, "writableHighWaterMark", r) | |
: O_(!1)), | |
(this.finalCalled = !1), | |
(this.needDrain = !1), | |
(this.ending = !1), | |
(this.ended = !1), | |
(this.finished = !1), | |
(this.destroyed = !1); | |
let i = !!(t && t.decodeStrings === !1); | |
(this.decodeStrings = !i), | |
(this.defaultEncoding = (t && t.defaultEncoding) || "utf8"), | |
(this.length = 0), | |
(this.writing = !1), | |
(this.corked = 0), | |
(this.sync = !0), | |
(this.bufferProcessing = !1), | |
(this.onwrite = j_.bind(void 0, e)), | |
(this.writecb = null), | |
(this.writelen = 0), | |
(this.afterWriteTickInfo = null), | |
yn(this), | |
(this.pendingcb = 0), | |
(this.constructed = !0), | |
(this.prefinished = !1), | |
(this.errorEmitted = !1), | |
(this.emitClose = !t || t.emitClose !== !1), | |
(this.autoDestroy = !t || t.autoDestroy !== !1), | |
(this.errored = null), | |
(this.closed = !1), | |
(this.closeEmitted = !1), | |
(this[$r] = []); | |
} | |
function yn(t) { | |
(t.buffered = []), | |
(t.bufferedIndex = 0), | |
(t.allBuffers = !0), | |
(t.allNoop = !0); | |
} | |
wi.prototype.getBuffer = function () { | |
return rh(this.buffered, this.bufferedIndex); | |
}; | |
nh(wi.prototype, "bufferedRequestCount", { | |
__proto__: null, | |
get() { | |
return this.buffered.length - this.bufferedIndex; | |
}, | |
}); | |
function ie(t) { | |
let e = this instanceof nt(); | |
if (!e && !ih(ie, this)) return new ie(t); | |
(this._writableState = new wi(t, this, e)), | |
t && | |
(typeof t.write == "function" && (this._write = t.write), | |
typeof t.writev == "function" && (this._writev = t.writev), | |
typeof t.destroy == "function" && (this._destroy = t.destroy), | |
typeof t.final == "function" && (this._final = t.final), | |
typeof t.construct == "function" && (this._construct = t.construct), | |
t.signal && P_(t.signal, this)), | |
yi.call(this, t), | |
bn.construct(this, () => { | |
let r = this._writableState; | |
r.writing || fo(this, r), co(this, r); | |
}); | |
} | |
nh(ie, C_, { | |
__proto__: null, | |
value: function (t) { | |
return ih(this, t) | |
? !0 | |
: this !== ie | |
? !1 | |
: t && t._writableState instanceof wi; | |
}, | |
}); | |
ie.prototype.pipe = function () { | |
Wr(this, new L_()); | |
}; | |
function lh(t, e, r, i) { | |
let n = t._writableState; | |
if (typeof r == "function") (i = r), (r = n.defaultEncoding); | |
else { | |
if (!r) r = n.defaultEncoding; | |
else if (r !== "buffer" && !pn.isEncoding(r)) throw new ah(r); | |
typeof i != "function" && (i = lo); | |
} | |
if (e === null) throw new N_(); | |
if (!n.objectMode) | |
if (typeof e == "string") | |
n.decodeStrings !== !1 && ((e = pn.from(e, r)), (r = "buffer")); | |
else if (e instanceof pn) r = "buffer"; | |
else if (yi._isUint8Array(e)) | |
(e = yi._uint8ArrayToBuffer(e)), (r = "buffer"); | |
else throw new x_("chunk", ["string", "Buffer", "Uint8Array"], e); | |
let o; | |
return ( | |
n.ending ? (o = new q_()) : n.destroyed && (o = new bi("write")), | |
o | |
? (cr.nextTick(i, o), Wr(t, o, !0), o) | |
: (n.pendingcb++, D_(t, n, e, r, i)) | |
); | |
} | |
ie.prototype.write = function (t, e, r) { | |
return lh(this, t, e, r) === !0; | |
}; | |
ie.prototype.cork = function () { | |
this._writableState.corked++; | |
}; | |
ie.prototype.uncork = function () { | |
let t = this._writableState; | |
t.corked && (t.corked--, t.writing || fo(this, t)); | |
}; | |
ie.prototype.setDefaultEncoding = function (e) { | |
if ((typeof e == "string" && (e = T_(e)), !pn.isEncoding(e))) | |
throw new ah(e); | |
return (this._writableState.defaultEncoding = e), this; | |
}; | |
function D_(t, e, r, i, n) { | |
let o = e.objectMode ? 1 : r.length; | |
e.length += o; | |
let s = e.length < e.highWaterMark; | |
return ( | |
s || (e.needDrain = !0), | |
e.writing || e.corked || e.errored || !e.constructed | |
? (e.buffered.push({ chunk: r, encoding: i, callback: n }), | |
e.allBuffers && i !== "buffer" && (e.allBuffers = !1), | |
e.allNoop && n !== lo && (e.allNoop = !1)) | |
: ((e.writelen = o), | |
(e.writecb = n), | |
(e.writing = !0), | |
(e.sync = !0), | |
t._write(r, i, e.onwrite), | |
(e.sync = !1)), | |
s && !e.errored && !e.destroyed | |
); | |
} | |
function eh(t, e, r, i, n, o, s) { | |
(e.writelen = i), | |
(e.writecb = s), | |
(e.writing = !0), | |
(e.sync = !0), | |
e.destroyed | |
? e.onwrite(new bi("write")) | |
: r | |
? t._writev(n, e.onwrite) | |
: t._write(n, o, e.onwrite), | |
(e.sync = !1); | |
} | |
function th(t, e, r, i) { | |
--e.pendingcb, i(r), uo(e), Wr(t, r); | |
} | |
function j_(t, e) { | |
let r = t._writableState, | |
i = r.sync, | |
n = r.writecb; | |
if (typeof n != "function") { | |
Wr(t, new oh()); | |
return; | |
} | |
(r.writing = !1), | |
(r.writecb = null), | |
(r.length -= r.writelen), | |
(r.writelen = 0), | |
e | |
? (e.stack, | |
r.errored || (r.errored = e), | |
t._readableState && | |
!t._readableState.errored && | |
(t._readableState.errored = e), | |
i ? cr.nextTick(th, t, r, e, n) : th(t, r, e, n)) | |
: (r.buffered.length > r.bufferedIndex && fo(t, r), | |
i | |
? r.afterWriteTickInfo !== null && r.afterWriteTickInfo.cb === n | |
? r.afterWriteTickInfo.count++ | |
: ((r.afterWriteTickInfo = { | |
count: 1, | |
cb: n, | |
stream: t, | |
state: r, | |
}), | |
cr.nextTick(F_, r.afterWriteTickInfo)) | |
: uh(t, r, 1, n)); | |
} | |
function F_({ stream: t, state: e, count: r, cb: i }) { | |
return (e.afterWriteTickInfo = null), uh(t, e, r, i); | |
} | |
function uh(t, e, r, i) { | |
for ( | |
!e.ending && | |
!t.destroyed && | |
e.length === 0 && | |
e.needDrain && | |
((e.needDrain = !1), t.emit("drain")); | |
r-- > 0; | |
) | |
e.pendingcb--, i(); | |
e.destroyed && uo(e), co(t, e); | |
} | |
function uo(t) { | |
if (t.writing) return; | |
for (let n = t.bufferedIndex; n < t.buffered.length; ++n) { | |
var e; | |
let { chunk: o, callback: s } = t.buffered[n], | |
a = t.objectMode ? 1 : o.length; | |
(t.length -= a), | |
s((e = t.errored) !== null && e !== void 0 ? e : new bi("write")); | |
} | |
let r = t[$r].splice(0); | |
for (let n = 0; n < r.length; n++) { | |
var i; | |
r[n]((i = t.errored) !== null && i !== void 0 ? i : new bi("end")); | |
} | |
yn(t); | |
} | |
function fo(t, e) { | |
if (e.corked || e.bufferProcessing || e.destroyed || !e.constructed) | |
return; | |
let { buffered: r, bufferedIndex: i, objectMode: n } = e, | |
o = r.length - i; | |
if (!o) return; | |
let s = i; | |
if (((e.bufferProcessing = !0), o > 1 && t._writev)) { | |
e.pendingcb -= o - 1; | |
let a = e.allNoop | |
? lo | |
: (c) => { | |
for (let h = s; h < r.length; ++h) r[h].callback(c); | |
}, | |
l = e.allNoop && s === 0 ? r : rh(r, s); | |
(l.allBuffers = e.allBuffers), eh(t, e, !0, e.length, l, "", a), yn(e); | |
} else { | |
do { | |
let { chunk: a, encoding: l, callback: c } = r[s]; | |
r[s++] = null; | |
let h = n ? 1 : a.length; | |
eh(t, e, !1, h, a, l, c); | |
} while (s < r.length && !e.writing); | |
s === r.length | |
? yn(e) | |
: s > 256 | |
? (r.splice(0, s), (e.bufferedIndex = 0)) | |
: (e.bufferedIndex = s); | |
} | |
e.bufferProcessing = !1; | |
} | |
ie.prototype._write = function (t, e, r) { | |
if (this._writev) this._writev([{ chunk: t, encoding: e }], r); | |
else throw new M_("_write()"); | |
}; | |
ie.prototype._writev = null; | |
ie.prototype.end = function (t, e, r) { | |
let i = this._writableState; | |
typeof t == "function" | |
? ((r = t), (t = null), (e = null)) | |
: typeof e == "function" && ((r = e), (e = null)); | |
let n; | |
if (t != null) { | |
let o = lh(this, t, e); | |
o instanceof A_ && (n = o); | |
} | |
return ( | |
i.corked && ((i.corked = 1), this.uncork()), | |
n || | |
(!i.errored && !i.ending | |
? ((i.ending = !0), co(this, i, !0), (i.ended = !0)) | |
: i.finished | |
? (n = new U_("end")) | |
: i.destroyed && (n = new bi("end"))), | |
typeof r == "function" && | |
(n || i.finished ? cr.nextTick(r, n) : i[$r].push(r)), | |
this | |
); | |
}; | |
function gn(t) { | |
return ( | |
t.ending && | |
!t.destroyed && | |
t.constructed && | |
t.length === 0 && | |
!t.errored && | |
t.buffered.length === 0 && | |
!t.finished && | |
!t.writing && | |
!t.errorEmitted && | |
!t.closeEmitted | |
); | |
} | |
function W_(t, e) { | |
let r = !1; | |
function i(n) { | |
if (r) { | |
Wr(t, n ?? oh()); | |
return; | |
} | |
if (((r = !0), e.pendingcb--, n)) { | |
let o = e[$r].splice(0); | |
for (let s = 0; s < o.length; s++) o[s](n); | |
Wr(t, n, e.sync); | |
} else | |
gn(e) && | |
((e.prefinished = !0), | |
t.emit("prefinish"), | |
e.pendingcb++, | |
cr.nextTick(ao, t, e)); | |
} | |
(e.sync = !0), e.pendingcb++; | |
try { | |
t._final(i); | |
} catch (n) { | |
i(n); | |
} | |
e.sync = !1; | |
} | |
function $_(t, e) { | |
!e.prefinished && | |
!e.finalCalled && | |
(typeof t._final == "function" && !e.destroyed | |
? ((e.finalCalled = !0), W_(t, e)) | |
: ((e.prefinished = !0), t.emit("prefinish"))); | |
} | |
function co(t, e, r) { | |
gn(e) && | |
($_(t, e), | |
e.pendingcb === 0 && | |
(r | |
? (e.pendingcb++, | |
cr.nextTick( | |
(i, n) => { | |
gn(n) ? ao(i, n) : n.pendingcb--; | |
}, | |
t, | |
e, | |
)) | |
: gn(e) && (e.pendingcb++, ao(t, e)))); | |
} | |
function ao(t, e) { | |
e.pendingcb--, (e.finished = !0); | |
let r = e[$r].splice(0); | |
for (let i = 0; i < r.length; i++) r[i](); | |
if ((t.emit("finish"), e.autoDestroy)) { | |
let i = t._readableState; | |
(!i || (i.autoDestroy && (i.endEmitted || i.readable === !1))) && | |
t.destroy(); | |
} | |
} | |
I_(ie.prototype, { | |
closed: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.closed : !1; | |
}, | |
}, | |
destroyed: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.destroyed : !1; | |
}, | |
set(t) { | |
this._writableState && (this._writableState.destroyed = t); | |
}, | |
}, | |
writable: { | |
__proto__: null, | |
get() { | |
let t = this._writableState; | |
return ( | |
!!t && | |
t.writable !== !1 && | |
!t.destroyed && | |
!t.errored && | |
!t.ending && | |
!t.ended | |
); | |
}, | |
set(t) { | |
this._writableState && (this._writableState.writable = !!t); | |
}, | |
}, | |
writableFinished: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.finished : !1; | |
}, | |
}, | |
writableObjectMode: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.objectMode : !1; | |
}, | |
}, | |
writableBuffer: { | |
__proto__: null, | |
get() { | |
return this._writableState && this._writableState.getBuffer(); | |
}, | |
}, | |
writableEnded: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.ending : !1; | |
}, | |
}, | |
writableNeedDrain: { | |
__proto__: null, | |
get() { | |
let t = this._writableState; | |
return t ? !t.destroyed && !t.ending && t.needDrain : !1; | |
}, | |
}, | |
writableHighWaterMark: { | |
__proto__: null, | |
get() { | |
return this._writableState && this._writableState.highWaterMark; | |
}, | |
}, | |
writableCorked: { | |
__proto__: null, | |
get() { | |
return this._writableState ? this._writableState.corked : 0; | |
}, | |
}, | |
writableLength: { | |
__proto__: null, | |
get() { | |
return this._writableState && this._writableState.length; | |
}, | |
}, | |
errored: { | |
__proto__: null, | |
enumerable: !1, | |
get() { | |
return this._writableState ? this._writableState.errored : null; | |
}, | |
}, | |
writableAborted: { | |
__proto__: null, | |
enumerable: !1, | |
get: function () { | |
return !!( | |
this._writableState.writable !== !1 && | |
(this._writableState.destroyed || this._writableState.errored) && | |
!this._writableState.finished | |
); | |
}, | |
}, | |
}); | |
var H_ = bn.destroy; | |
ie.prototype.destroy = function (t, e) { | |
let r = this._writableState; | |
return ( | |
!r.destroyed && | |
(r.bufferedIndex < r.buffered.length || r[$r].length) && | |
cr.nextTick(uo, r), | |
H_.call(this, t, e), | |
this | |
); | |
}; | |
ie.prototype._undestroy = bn.undestroy; | |
ie.prototype._destroy = function (t, e) { | |
e(t); | |
}; | |
ie.prototype[B_.captureRejectionSymbol] = function (t) { | |
this.destroy(t); | |
}; | |
var oo; | |
function fh() { | |
return oo === void 0 && (oo = {}), oo; | |
} | |
ie.fromWeb = function (t, e) { | |
return fh().newStreamWritableFromWritableStream(t, e); | |
}; | |
ie.toWeb = function (t) { | |
return fh().newWritableStreamFromStreamWritable(t); | |
}; | |
}); | |
var Sh = M((s2, Eh) => { | |
_(); | |
v(); | |
m(); | |
var po = Nt(), | |
V_ = (be(), X(me)), | |
{ | |
isReadable: z_, | |
isWritable: K_, | |
isIterable: hh, | |
isNodeStream: G_, | |
isReadableNodeStream: dh, | |
isWritableNodeStream: ph, | |
isDuplexNodeStream: Q_, | |
} = tt(), | |
gh = vt(), | |
{ | |
AbortError: vh, | |
codes: { ERR_INVALID_ARG_TYPE: Y_, ERR_INVALID_RETURN_VALUE: yh }, | |
} = Ae(), | |
{ destroyer: Hr } = ir(), | |
J_ = nt(), | |
X_ = gi(), | |
{ createDeferredPromise: bh } = Je(), | |
wh = Zs(), | |
_h = globalThis.Blob || V_.Blob, | |
Z_ = | |
typeof _h < "u" | |
? function (e) { | |
return e instanceof _h; | |
} | |
: function (e) { | |
return !1; | |
}, | |
e0 = globalThis.AbortController || zi().AbortController, | |
{ FunctionPrototypeCall: mh } = ce(), | |
hr = class extends J_ { | |
constructor(e) { | |
super(e), | |
e?.readable === !1 && | |
((this._readableState.readable = !1), | |
(this._readableState.ended = !0), | |
(this._readableState.endEmitted = !0)), | |
e?.writable === !1 && | |
((this._writableState.writable = !1), | |
(this._writableState.ending = !0), | |
(this._writableState.ended = !0), | |
(this._writableState.finished = !0)); | |
} | |
}; | |
Eh.exports = function t(e, r) { | |
if (Q_(e)) return e; | |
if (dh(e)) return wn({ readable: e }); | |
if (ph(e)) return wn({ writable: e }); | |
if (G_(e)) return wn({ writable: !1, readable: !1 }); | |
if (typeof e == "function") { | |
let { value: n, write: o, final: s, destroy: a } = t0(e); | |
if (hh(n)) | |
return wh(hr, n, { objectMode: !0, write: o, final: s, destroy: a }); | |
let l = n?.then; | |
if (typeof l == "function") { | |
let c, | |
h = mh( | |
l, | |
n, | |
(d) => { | |
if (d != null) throw new yh("nully", "body", d); | |
}, | |
(d) => { | |
Hr(c, d); | |
}, | |
); | |
return (c = new hr({ | |
objectMode: !0, | |
readable: !1, | |
write: o, | |
final(d) { | |
s(async () => { | |
try { | |
await h, po.nextTick(d, null); | |
} catch (g) { | |
po.nextTick(d, g); | |
} | |
}); | |
}, | |
destroy: a, | |
})); | |
} | |
throw new yh("Iterable, AsyncIterable or AsyncFunction", r, n); | |
} | |
if (Z_(e)) return t(e.arrayBuffer()); | |
if (hh(e)) return wh(hr, e, { objectMode: !0, writable: !1 }); | |
if (typeof e?.writable == "object" || typeof e?.readable == "object") { | |
let n = | |
e != null && e.readable | |
? dh(e?.readable) | |
? e?.readable | |
: t(e.readable) | |
: void 0, | |
o = | |
e != null && e.writable | |
? ph(e?.writable) | |
? e?.writable | |
: t(e.writable) | |
: void 0; | |
return wn({ readable: n, writable: o }); | |
} | |
let i = e?.then; | |
if (typeof i == "function") { | |
let n; | |
return ( | |
mh( | |
i, | |
e, | |
(o) => { | |
o != null && n.push(o), n.push(null); | |
}, | |
(o) => { | |
Hr(n, o); | |
}, | |
), | |
(n = new hr({ objectMode: !0, writable: !1, read() {} })) | |
); | |
} | |
throw new Y_( | |
r, | |
[ | |
"Blob", | |
"ReadableStream", | |
"WritableStream", | |
"Stream", | |
"Iterable", | |
"AsyncIterable", | |
"Function", | |
"{ readable, writable } pair", | |
"Promise", | |
], | |
e, | |
); | |
}; | |
function t0(t) { | |
let { promise: e, resolve: r } = bh(), | |
i = new e0(), | |
n = i.signal; | |
return { | |
value: t( | |
(async function* () { | |
for (;;) { | |
let s = e; | |
e = null; | |
let { chunk: a, done: l, cb: c } = await s; | |
if ((po.nextTick(c), l)) return; | |
if (n.aborted) throw new vh(void 0, { cause: n.reason }); | |
({ promise: e, resolve: r } = bh()), yield a; | |
} | |
})(), | |
{ signal: n }, | |
), | |
write(s, a, l) { | |
let c = r; | |
(r = null), c({ chunk: s, done: !1, cb: l }); | |
}, | |
final(s) { | |
let a = r; | |
(r = null), a({ done: !0, cb: s }); | |
}, | |
destroy(s, a) { | |
i.abort(), a(s); | |
}, | |
}; | |
} | |
function wn(t) { | |
let e = | |
t.readable && typeof t.readable.read != "function" | |
? X_.wrap(t.readable) | |
: t.readable, | |
r = t.writable, | |
i = !!z_(e), | |
n = !!K_(r), | |
o, | |
s, | |
a, | |
l, | |
c; | |
function h(d) { | |
let g = l; | |
(l = null), g ? g(d) : d && c.destroy(d); | |
} | |
return ( | |
(c = new hr({ | |
readableObjectMode: !!(e != null && e.readableObjectMode), | |
writableObjectMode: !!(r != null && r.writableObjectMode), | |
readable: i, | |
writable: n, | |
})), | |
n && | |
(gh(r, (d) => { | |
(n = !1), d && Hr(e, d), h(d); | |
}), | |
(c._write = function (d, g, y) { | |
r.write(d, g) ? y() : (o = y); | |
}), | |
(c._final = function (d) { | |
r.end(), (s = d); | |
}), | |
r.on("drain", function () { | |
if (o) { | |
let d = o; | |
(o = null), d(); | |
} | |
}), | |
r.on("finish", function () { | |
if (s) { | |
let d = s; | |
(s = null), d(); | |
} | |
})), | |
i && | |
(gh(e, (d) => { | |
(i = !1), d && Hr(e, d), h(d); | |
}), | |
e.on("readable", function () { | |
if (a) { | |
let d = a; | |
(a = null), d(); | |
} | |
}), | |
e.on("end", function () { | |
c.push(null); | |
}), | |
(c._read = function () { | |
for (;;) { | |
let d = e.read(); | |
if (d === null) { | |
a = c._read; | |
return; | |
} | |
if (!c.push(d)) return; | |
} | |
})), | |
(c._destroy = function (d, g) { | |
!d && l !== null && (d = new vh()), | |
(a = null), | |
(o = null), | |
(s = null), | |
l === null ? g(d) : ((l = g), Hr(r, d), Hr(e, d)); | |
}), | |
c | |
); | |
} | |
}); | |
var nt = M((h2, Th) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { | |
ObjectDefineProperties: r0, | |
ObjectGetOwnPropertyDescriptor: It, | |
ObjectKeys: i0, | |
ObjectSetPrototypeOf: Ah, | |
} = ce(); | |
Th.exports = Ve; | |
var bo = gi(), | |
Ne = ho(); | |
Ah(Ve.prototype, bo.prototype); | |
Ah(Ve, bo); | |
{ | |
let t = i0(Ne.prototype); | |
for (let e = 0; e < t.length; e++) { | |
let r = t[e]; | |
Ve.prototype[r] || (Ve.prototype[r] = Ne.prototype[r]); | |
} | |
} | |
function Ve(t) { | |
if (!(this instanceof Ve)) return new Ve(t); | |
bo.call(this, t), | |
Ne.call(this, t), | |
t | |
? ((this.allowHalfOpen = t.allowHalfOpen !== !1), | |
t.readable === !1 && | |
((this._readableState.readable = !1), | |
(this._readableState.ended = !0), | |
(this._readableState.endEmitted = !0)), | |
t.writable === !1 && | |
((this._writableState.writable = !1), | |
(this._writableState.ending = !0), | |
(this._writableState.ended = !0), | |
(this._writableState.finished = !0))) | |
: (this.allowHalfOpen = !0); | |
} | |
r0(Ve.prototype, { | |
writable: { __proto__: null, ...It(Ne.prototype, "writable") }, | |
writableHighWaterMark: { | |
__proto__: null, | |
...It(Ne.prototype, "writableHighWaterMark"), | |
}, | |
writableObjectMode: { | |
__proto__: null, | |
...It(Ne.prototype, "writableObjectMode"), | |
}, | |
writableBuffer: { | |
__proto__: null, | |
...It(Ne.prototype, "writableBuffer"), | |
}, | |
writableLength: { | |
__proto__: null, | |
...It(Ne.prototype, "writableLength"), | |
}, | |
writableFinished: { | |
__proto__: null, | |
...It(Ne.prototype, "writableFinished"), | |
}, | |
writableCorked: { | |
__proto__: null, | |
...It(Ne.prototype, "writableCorked"), | |
}, | |
writableEnded: { __proto__: null, ...It(Ne.prototype, "writableEnded") }, | |
writableNeedDrain: { | |
__proto__: null, | |
...It(Ne.prototype, "writableNeedDrain"), | |
}, | |
destroyed: { | |
__proto__: null, | |
get() { | |
return this._readableState === void 0 || | |
this._writableState === void 0 | |
? !1 | |
: this._readableState.destroyed && this._writableState.destroyed; | |
}, | |
set(t) { | |
this._readableState && | |
this._writableState && | |
((this._readableState.destroyed = t), | |
(this._writableState.destroyed = t)); | |
}, | |
}, | |
}); | |
var go; | |
function Ih() { | |
return go === void 0 && (go = {}), go; | |
} | |
Ve.fromWeb = function (t, e) { | |
return Ih().newStreamDuplexFromReadableWritablePair(t, e); | |
}; | |
Ve.toWeb = function (t) { | |
return Ih().newReadableWritablePairFromDuplex(t); | |
}; | |
var yo; | |
Ve.from = function (t) { | |
return yo || (yo = Sh()), yo(t, "body"); | |
}; | |
}); | |
var mo = M((_2, Ch) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { ObjectSetPrototypeOf: Rh, Symbol: n0 } = ce(); | |
Ch.exports = Tt; | |
var { ERR_METHOD_NOT_IMPLEMENTED: s0 } = Ae().codes, | |
_o = nt(), | |
{ getHighWaterMark: o0 } = an(); | |
Rh(Tt.prototype, _o.prototype); | |
Rh(Tt, _o); | |
var _i = n0("kCallback"); | |
function Tt(t) { | |
if (!(this instanceof Tt)) return new Tt(t); | |
let e = t ? o0(this, t, "readableHighWaterMark", !0) : null; | |
e === 0 && | |
(t = { | |
...t, | |
highWaterMark: null, | |
readableHighWaterMark: e, | |
writableHighWaterMark: t.writableHighWaterMark || 0, | |
}), | |
_o.call(this, t), | |
(this._readableState.sync = !1), | |
(this[_i] = null), | |
t && | |
(typeof t.transform == "function" && (this._transform = t.transform), | |
typeof t.flush == "function" && (this._flush = t.flush)), | |
this.on("prefinish", a0); | |
} | |
function wo(t) { | |
typeof this._flush == "function" && !this.destroyed | |
? this._flush((e, r) => { | |
if (e) { | |
t ? t(e) : this.destroy(e); | |
return; | |
} | |
r != null && this.push(r), this.push(null), t && t(); | |
}) | |
: (this.push(null), t && t()); | |
} | |
function a0() { | |
this._final !== wo && wo.call(this); | |
} | |
Tt.prototype._final = wo; | |
Tt.prototype._transform = function (t, e, r) { | |
throw new s0("_transform()"); | |
}; | |
Tt.prototype._write = function (t, e, r) { | |
let i = this._readableState, | |
n = this._writableState, | |
o = i.length; | |
this._transform(t, e, (s, a) => { | |
if (s) { | |
r(s); | |
return; | |
} | |
a != null && this.push(a), | |
n.ended || o === i.length || i.length < i.highWaterMark | |
? r() | |
: (this[_i] = r); | |
}); | |
}; | |
Tt.prototype._read = function () { | |
if (this[_i]) { | |
let t = this[_i]; | |
(this[_i] = null), t(); | |
} | |
}; | |
}); | |
var Eo = M((T2, Ph) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { ObjectSetPrototypeOf: Bh } = ce(); | |
Ph.exports = Vr; | |
var vo = mo(); | |
Bh(Vr.prototype, vo.prototype); | |
Bh(Vr, vo); | |
function Vr(t) { | |
if (!(this instanceof Vr)) return new Vr(t); | |
vo.call(this, t); | |
} | |
Vr.prototype._transform = function (t, e, r) { | |
r(null, t); | |
}; | |
}); | |
var En = M((x2, Lh) => { | |
_(); | |
v(); | |
m(); | |
var mi = Nt(), | |
{ ArrayIsArray: l0, Promise: u0, SymbolAsyncIterator: f0 } = ce(), | |
vn = vt(), | |
{ once: c0 } = Je(), | |
h0 = ir(), | |
kh = nt(), | |
{ | |
aggregateTwoErrors: d0, | |
codes: { | |
ERR_INVALID_ARG_TYPE: Po, | |
ERR_INVALID_RETURN_VALUE: So, | |
ERR_MISSING_ARGS: p0, | |
ERR_STREAM_DESTROYED: g0, | |
ERR_STREAM_PREMATURE_CLOSE: y0, | |
}, | |
AbortError: b0, | |
} = Ae(), | |
{ validateFunction: w0, validateAbortSignal: _0 } = hi(), | |
{ | |
isIterable: dr, | |
isReadable: Ao, | |
isReadableNodeStream: mn, | |
isNodeStream: Oh, | |
isTransformStream: zr, | |
isWebStream: m0, | |
isReadableStream: Io, | |
isReadableEnded: v0, | |
} = tt(), | |
E0 = globalThis.AbortController || zi().AbortController, | |
To, | |
Ro; | |
function xh(t, e, r) { | |
let i = !1; | |
t.on("close", () => { | |
i = !0; | |
}); | |
let n = vn(t, { readable: e, writable: r }, (o) => { | |
i = !o; | |
}); | |
return { | |
destroy: (o) => { | |
i || ((i = !0), h0.destroyer(t, o || new g0("pipe"))); | |
}, | |
cleanup: n, | |
}; | |
} | |
function S0(t) { | |
return w0(t[t.length - 1], "streams[stream.length - 1]"), t.pop(); | |
} | |
function Co(t) { | |
if (dr(t)) return t; | |
if (mn(t)) return A0(t); | |
throw new Po("val", ["Readable", "Iterable", "AsyncIterable"], t); | |
} | |
async function* A0(t) { | |
Ro || (Ro = gi()), yield* Ro.prototype[f0].call(t); | |
} | |
async function _n(t, e, r, { end: i }) { | |
let n, | |
o = null, | |
s = (c) => { | |
if ((c && (n = c), o)) { | |
let h = o; | |
(o = null), h(); | |
} | |
}, | |
a = () => | |
new u0((c, h) => { | |
n | |
? h(n) | |
: (o = () => { | |
n ? h(n) : c(); | |
}); | |
}); | |
e.on("drain", s); | |
let l = vn(e, { readable: !1 }, s); | |
try { | |
e.writableNeedDrain && (await a()); | |
for await (let c of t) e.write(c) || (await a()); | |
i && e.end(), await a(), r(); | |
} catch (c) { | |
r(n !== c ? d0(n, c) : c); | |
} finally { | |
l(), e.off("drain", s); | |
} | |
} | |
async function Bo(t, e, r, { end: i }) { | |
zr(e) && (e = e.writable); | |
let n = e.getWriter(); | |
try { | |
for await (let o of t) await n.ready, n.write(o).catch(() => {}); | |
await n.ready, i && (await n.close()), r(); | |
} catch (o) { | |
try { | |
await n.abort(o), r(o); | |
} catch (s) { | |
r(s); | |
} | |
} | |
} | |
function I0(...t) { | |
return Mh(t, c0(S0(t))); | |
} | |
function Mh(t, e, r) { | |
if ((t.length === 1 && l0(t[0]) && (t = t[0]), t.length < 2)) | |
throw new p0("streams"); | |
let i = new E0(), | |
n = i.signal, | |
o = r?.signal, | |
s = []; | |
_0(o, "options.signal"); | |
function a() { | |
y(new b0()); | |
} | |
o?.addEventListener("abort", a); | |
let l, | |
c, | |
h = [], | |
d = 0; | |
function g(C) { | |
y(C, --d === 0); | |
} | |
function y(C, R) { | |
if ( | |
(C && (!l || l.code === "ERR_STREAM_PREMATURE_CLOSE") && (l = C), | |
!(!l && !R)) | |
) { | |
for (; h.length; ) h.shift()(l); | |
o?.removeEventListener("abort", a), | |
i.abort(), | |
R && (l || s.forEach((U) => U()), mi.nextTick(e, l, c)); | |
} | |
} | |
let w; | |
for (let C = 0; C < t.length; C++) { | |
let R = t[C], | |
U = C < t.length - 1, | |
N = C > 0, | |
W = U || r?.end !== !1, | |
K = C === t.length - 1; | |
if (Oh(R)) { | |
let z = function (Q) { | |
Q && | |
Q.name !== "AbortError" && | |
Q.code !== "ERR_STREAM_PREMATURE_CLOSE" && | |
g(Q); | |
}; | |
var I = z; | |
if (W) { | |
let { destroy: Q, cleanup: pe } = xh(R, U, N); | |
h.push(Q), Ao(R) && K && s.push(pe); | |
} | |
R.on("error", z), | |
Ao(R) && | |
K && | |
s.push(() => { | |
R.removeListener("error", z); | |
}); | |
} | |
if (C === 0) | |
if (typeof R == "function") { | |
if (((w = R({ signal: n })), !dr(w))) | |
throw new So("Iterable, AsyncIterable or Stream", "source", w); | |
} else dr(R) || mn(R) || zr(R) ? (w = R) : (w = kh.from(R)); | |
else if (typeof R == "function") { | |
if (zr(w)) { | |
var S; | |
w = Co((S = w) === null || S === void 0 ? void 0 : S.readable); | |
} else w = Co(w); | |
if (((w = R(w, { signal: n })), U)) { | |
if (!dr(w, !0)) | |
throw new So("AsyncIterable", `transform[${C - 1}]`, w); | |
} else { | |
var E; | |
To || (To = Eo()); | |
let z = new To({ objectMode: !0 }), | |
Q = (E = w) === null || E === void 0 ? void 0 : E.then; | |
if (typeof Q == "function") | |
d++, | |
Q.call( | |
w, | |
(ge) => { | |
(c = ge), | |
ge != null && z.write(ge), | |
W && z.end(), | |
mi.nextTick(g); | |
}, | |
(ge) => { | |
z.destroy(ge), mi.nextTick(g, ge); | |
}, | |
); | |
else if (dr(w, !0)) d++, _n(w, z, g, { end: W }); | |
else if (Io(w) || zr(w)) { | |
let ge = w.readable || w; | |
d++, _n(ge, z, g, { end: W }); | |
} else throw new So("AsyncIterable or Promise", "destination", w); | |
w = z; | |
let { destroy: pe, cleanup: Yt } = xh(w, !1, !0); | |
h.push(pe), K && s.push(Yt); | |
} | |
} else if (Oh(R)) { | |
if (mn(w)) { | |
d += 2; | |
let z = T0(w, R, g, { end: W }); | |
Ao(R) && K && s.push(z); | |
} else if (zr(w) || Io(w)) { | |
let z = w.readable || w; | |
d++, _n(z, R, g, { end: W }); | |
} else if (dr(w)) d++, _n(w, R, g, { end: W }); | |
else | |
throw new Po( | |
"val", | |
[ | |
"Readable", | |
"Iterable", | |
"AsyncIterable", | |
"ReadableStream", | |
"TransformStream", | |
], | |
w, | |
); | |
w = R; | |
} else if (m0(R)) { | |
if (mn(w)) d++, Bo(Co(w), R, g, { end: W }); | |
else if (Io(w) || dr(w)) d++, Bo(w, R, g, { end: W }); | |
else if (zr(w)) d++, Bo(w.readable, R, g, { end: W }); | |
else | |
throw new Po( | |
"val", | |
[ | |
"Readable", | |
"Iterable", | |
"AsyncIterable", | |
"ReadableStream", | |
"TransformStream", | |
], | |
w, | |
); | |
w = R; | |
} else w = kh.from(R); | |
} | |
return ( | |
((n != null && n.aborted) || (o != null && o.aborted)) && | |
mi.nextTick(a), | |
w | |
); | |
} | |
function T0(t, e, r, { end: i }) { | |
let n = !1; | |
if ( | |
(e.on("close", () => { | |
n || r(new y0()); | |
}), | |
t.pipe(e, { end: !1 }), | |
i) | |
) { | |
let s = function () { | |
(n = !0), e.end(); | |
}; | |
var o = s; | |
v0(t) ? mi.nextTick(s) : t.once("end", s); | |
} else r(); | |
return ( | |
vn(t, { readable: !0, writable: !1 }, (s) => { | |
let a = t._readableState; | |
s && | |
s.code === "ERR_STREAM_PREMATURE_CLOSE" && | |
a && | |
a.ended && | |
!a.errored && | |
!a.errorEmitted | |
? t.once("end", r).once("error", r) | |
: r(s); | |
}), | |
vn(e, { readable: !1, writable: !0 }, r) | |
); | |
} | |
Lh.exports = { pipelineImpl: Mh, pipeline: I0 }; | |
}); | |
var Oo = M((j2, Fh) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { pipeline: R0 } = En(), | |
Sn = nt(), | |
{ destroyer: C0 } = ir(), | |
{ | |
isNodeStream: An, | |
isReadable: Uh, | |
isWritable: Nh, | |
isWebStream: ko, | |
isTransformStream: pr, | |
isWritableStream: qh, | |
isReadableStream: Dh, | |
} = tt(), | |
{ | |
AbortError: B0, | |
codes: { ERR_INVALID_ARG_VALUE: jh, ERR_MISSING_ARGS: P0 }, | |
} = Ae(), | |
k0 = vt(); | |
Fh.exports = function (...e) { | |
if (e.length === 0) throw new P0("streams"); | |
if (e.length === 1) return Sn.from(e[0]); | |
let r = [...e]; | |
if ( | |
(typeof e[0] == "function" && (e[0] = Sn.from(e[0])), | |
typeof e[e.length - 1] == "function") | |
) { | |
let y = e.length - 1; | |
e[y] = Sn.from(e[y]); | |
} | |
for (let y = 0; y < e.length; ++y) | |
if (!(!An(e[y]) && !ko(e[y]))) { | |
if (y < e.length - 1 && !(Uh(e[y]) || Dh(e[y]) || pr(e[y]))) | |
throw new jh(`streams[${y}]`, r[y], "must be readable"); | |
if (y > 0 && !(Nh(e[y]) || qh(e[y]) || pr(e[y]))) | |
throw new jh(`streams[${y}]`, r[y], "must be writable"); | |
} | |
let i, n, o, s, a; | |
function l(y) { | |
let w = s; | |
(s = null), w ? w(y) : y ? a.destroy(y) : !g && !d && a.destroy(); | |
} | |
let c = e[0], | |
h = R0(e, l), | |
d = !!(Nh(c) || qh(c) || pr(c)), | |
g = !!(Uh(h) || Dh(h) || pr(h)); | |
if ( | |
((a = new Sn({ | |
writableObjectMode: !!(c != null && c.writableObjectMode), | |
readableObjectMode: !!(h != null && h.writableObjectMode), | |
writable: d, | |
readable: g, | |
})), | |
d) | |
) { | |
if (An(c)) | |
(a._write = function (w, S, E) { | |
c.write(w, S) ? E() : (i = E); | |
}), | |
(a._final = function (w) { | |
c.end(), (n = w); | |
}), | |
c.on("drain", function () { | |
if (i) { | |
let w = i; | |
(i = null), w(); | |
} | |
}); | |
else if (ko(c)) { | |
let S = (pr(c) ? c.writable : c).getWriter(); | |
(a._write = async function (E, I, C) { | |
try { | |
await S.ready, S.write(E).catch(() => {}), C(); | |
} catch (R) { | |
C(R); | |
} | |
}), | |
(a._final = async function (E) { | |
try { | |
await S.ready, S.close().catch(() => {}), (n = E); | |
} catch (I) { | |
E(I); | |
} | |
}); | |
} | |
let y = pr(h) ? h.readable : h; | |
k0(y, () => { | |
if (n) { | |
let w = n; | |
(n = null), w(); | |
} | |
}); | |
} | |
if (g) { | |
if (An(h)) | |
h.on("readable", function () { | |
if (o) { | |
let y = o; | |
(o = null), y(); | |
} | |
}), | |
h.on("end", function () { | |
a.push(null); | |
}), | |
(a._read = function () { | |
for (;;) { | |
let y = h.read(); | |
if (y === null) { | |
o = a._read; | |
return; | |
} | |
if (!a.push(y)) return; | |
} | |
}); | |
else if (ko(h)) { | |
let w = (pr(h) ? h.readable : h).getReader(); | |
a._read = async function () { | |
for (;;) | |
try { | |
let { value: S, done: E } = await w.read(); | |
if (!a.push(S)) return; | |
if (E) { | |
a.push(null); | |
return; | |
} | |
} catch { | |
return; | |
} | |
}; | |
} | |
} | |
return ( | |
(a._destroy = function (y, w) { | |
!y && s !== null && (y = new B0()), | |
(o = null), | |
(i = null), | |
(n = null), | |
s === null ? w(y) : ((s = w), An(h) && C0(h, y)); | |
}), | |
a | |
); | |
}; | |
}); | |
var Qh = M((K2, Lo) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var Vh = globalThis.AbortController || zi().AbortController, | |
{ | |
codes: { | |
ERR_INVALID_ARG_VALUE: O0, | |
ERR_INVALID_ARG_TYPE: vi, | |
ERR_MISSING_ARGS: x0, | |
ERR_OUT_OF_RANGE: M0, | |
}, | |
AbortError: st, | |
} = Ae(), | |
{ | |
validateAbortSignal: gr, | |
validateInteger: L0, | |
validateObject: yr, | |
} = hi(), | |
U0 = ce().Symbol("kWeak"), | |
{ finished: N0 } = vt(), | |
q0 = Oo(), | |
{ addAbortSignalNoValidate: D0 } = di(), | |
{ isWritable: j0, isNodeStream: F0 } = tt(), | |
{ | |
ArrayPrototypePush: W0, | |
MathFloor: $0, | |
Number: H0, | |
NumberIsNaN: V0, | |
Promise: Wh, | |
PromiseReject: $h, | |
PromisePrototypeThen: z0, | |
Symbol: zh, | |
} = ce(), | |
In = zh("kEmpty"), | |
Hh = zh("kEof"); | |
function K0(t, e) { | |
if ( | |
(e != null && yr(e, "options"), | |
e?.signal != null && gr(e.signal, "options.signal"), | |
F0(t) && !j0(t)) | |
) | |
throw new O0("stream", t, "must be writable"); | |
let r = q0(this, t); | |
return e != null && e.signal && D0(e.signal, r), r; | |
} | |
function Tn(t, e) { | |
if (typeof t != "function") | |
throw new vi("fn", ["Function", "AsyncFunction"], t); | |
e != null && yr(e, "options"), | |
e?.signal != null && gr(e.signal, "options.signal"); | |
let r = 1; | |
return ( | |
e?.concurrency != null && (r = $0(e.concurrency)), | |
L0(r, "concurrency", 1), | |
async function* () { | |
var n, o; | |
let s = new Vh(), | |
a = this, | |
l = [], | |
c = s.signal, | |
h = { signal: c }, | |
d = () => s.abort(); | |
e != null && | |
(n = e.signal) !== null && | |
n !== void 0 && | |
n.aborted && | |
d(), | |
e == null || | |
(o = e.signal) === null || | |
o === void 0 || | |
o.addEventListener("abort", d); | |
let g, | |
y, | |
w = !1; | |
function S() { | |
w = !0; | |
} | |
async function E() { | |
try { | |
for await (let R of a) { | |
var I; | |
if (w) return; | |
if (c.aborted) throw new st(); | |
try { | |
R = t(R, h); | |
} catch (U) { | |
R = $h(U); | |
} | |
R !== In && | |
(typeof ((I = R) === null || I === void 0 | |
? void 0 | |
: I.catch) == "function" && R.catch(S), | |
l.push(R), | |
g && (g(), (g = null)), | |
!w && | |
l.length && | |
l.length >= r && | |
(await new Wh((U) => { | |
y = U; | |
}))); | |
} | |
l.push(Hh); | |
} catch (R) { | |
let U = $h(R); | |
z0(U, void 0, S), l.push(U); | |
} finally { | |
var C; | |
(w = !0), | |
g && (g(), (g = null)), | |
e == null || | |
(C = e.signal) === null || | |
C === void 0 || | |
C.removeEventListener("abort", d); | |
} | |
} | |
E(); | |
try { | |
for (;;) { | |
for (; l.length > 0; ) { | |
let I = await l[0]; | |
if (I === Hh) return; | |
if (c.aborted) throw new st(); | |
I !== In && (yield I), l.shift(), y && (y(), (y = null)); | |
} | |
await new Wh((I) => { | |
g = I; | |
}); | |
} | |
} finally { | |
s.abort(), (w = !0), y && (y(), (y = null)); | |
} | |
}.call(this) | |
); | |
} | |
function G0(t = void 0) { | |
return ( | |
t != null && yr(t, "options"), | |
t?.signal != null && gr(t.signal, "options.signal"), | |
async function* () { | |
let r = 0; | |
for await (let n of this) { | |
var i; | |
if ( | |
t != null && | |
(i = t.signal) !== null && | |
i !== void 0 && | |
i.aborted | |
) | |
throw new st({ cause: t.signal.reason }); | |
yield [r++, n]; | |
} | |
}.call(this) | |
); | |
} | |
async function Kh(t, e = void 0) { | |
for await (let r of Mo.call(this, t, e)) return !0; | |
return !1; | |
} | |
async function Q0(t, e = void 0) { | |
if (typeof t != "function") | |
throw new vi("fn", ["Function", "AsyncFunction"], t); | |
return !(await Kh.call(this, async (...r) => !(await t(...r)), e)); | |
} | |
async function Y0(t, e) { | |
for await (let r of Mo.call(this, t, e)) return r; | |
} | |
async function J0(t, e) { | |
if (typeof t != "function") | |
throw new vi("fn", ["Function", "AsyncFunction"], t); | |
async function r(i, n) { | |
return await t(i, n), In; | |
} | |
for await (let i of Tn.call(this, r, e)); | |
} | |
function Mo(t, e) { | |
if (typeof t != "function") | |
throw new vi("fn", ["Function", "AsyncFunction"], t); | |
async function r(i, n) { | |
return (await t(i, n)) ? i : In; | |
} | |
return Tn.call(this, r, e); | |
} | |
var xo = class extends x0 { | |
constructor() { | |
super("reduce"), | |
(this.message = | |
"Reduce of an empty stream requires an initial value"); | |
} | |
}; | |
async function X0(t, e, r) { | |
var i; | |
if (typeof t != "function") | |
throw new vi("reducer", ["Function", "AsyncFunction"], t); | |
r != null && yr(r, "options"), | |
r?.signal != null && gr(r.signal, "options.signal"); | |
let n = arguments.length > 1; | |
if (r != null && (i = r.signal) !== null && i !== void 0 && i.aborted) { | |
let c = new st(void 0, { cause: r.signal.reason }); | |
throw (this.once("error", () => {}), await N0(this.destroy(c)), c); | |
} | |
let o = new Vh(), | |
s = o.signal; | |
if (r != null && r.signal) { | |
let c = { once: !0, [U0]: this }; | |
r.signal.addEventListener("abort", () => o.abort(), c); | |
} | |
let a = !1; | |
try { | |
for await (let c of this) { | |
var l; | |
if ( | |
((a = !0), | |
r != null && (l = r.signal) !== null && l !== void 0 && l.aborted) | |
) | |
throw new st(); | |
n ? (e = await t(e, c, { signal: s })) : ((e = c), (n = !0)); | |
} | |
if (!a && !n) throw new xo(); | |
} finally { | |
o.abort(); | |
} | |
return e; | |
} | |
async function Z0(t) { | |
t != null && yr(t, "options"), | |
t?.signal != null && gr(t.signal, "options.signal"); | |
let e = []; | |
for await (let i of this) { | |
var r; | |
if (t != null && (r = t.signal) !== null && r !== void 0 && r.aborted) | |
throw new st(void 0, { cause: t.signal.reason }); | |
W0(e, i); | |
} | |
return e; | |
} | |
function em(t, e) { | |
let r = Tn.call(this, t, e); | |
return async function* () { | |
for await (let n of r) yield* n; | |
}.call(this); | |
} | |
function Gh(t) { | |
if (((t = H0(t)), V0(t))) return 0; | |
if (t < 0) throw new M0("number", ">= 0", t); | |
return t; | |
} | |
function tm(t, e = void 0) { | |
return ( | |
e != null && yr(e, "options"), | |
e?.signal != null && gr(e.signal, "options.signal"), | |
(t = Gh(t)), | |
async function* () { | |
var i; | |
if (e != null && (i = e.signal) !== null && i !== void 0 && i.aborted) | |
throw new st(); | |
for await (let o of this) { | |
var n; | |
if ( | |
e != null && | |
(n = e.signal) !== null && | |
n !== void 0 && | |
n.aborted | |
) | |
throw new st(); | |
t-- <= 0 && (yield o); | |
} | |
}.call(this) | |
); | |
} | |
function rm(t, e = void 0) { | |
return ( | |
e != null && yr(e, "options"), | |
e?.signal != null && gr(e.signal, "options.signal"), | |
(t = Gh(t)), | |
async function* () { | |
var i; | |
if (e != null && (i = e.signal) !== null && i !== void 0 && i.aborted) | |
throw new st(); | |
for await (let o of this) { | |
var n; | |
if ( | |
e != null && | |
(n = e.signal) !== null && | |
n !== void 0 && | |
n.aborted | |
) | |
throw new st(); | |
if (t-- > 0) yield o; | |
else return; | |
} | |
}.call(this) | |
); | |
} | |
Lo.exports.streamReturningOperators = { | |
asIndexedPairs: G0, | |
drop: tm, | |
filter: Mo, | |
flatMap: em, | |
map: Tn, | |
take: rm, | |
compose: K0, | |
}; | |
Lo.exports.promiseReturningOperators = { | |
every: Q0, | |
forEach: J0, | |
reduce: X0, | |
toArray: Z0, | |
some: Kh, | |
find: Y0, | |
}; | |
}); | |
var Uo = M((eR, Yh) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { ArrayPrototypePop: im, Promise: nm } = ce(), | |
{ isIterable: sm, isNodeStream: om, isWebStream: am } = tt(), | |
{ pipelineImpl: lm } = En(), | |
{ finished: um } = vt(); | |
No(); | |
function fm(...t) { | |
return new nm((e, r) => { | |
let i, | |
n, | |
o = t[t.length - 1]; | |
if (o && typeof o == "object" && !om(o) && !sm(o) && !am(o)) { | |
let s = im(t); | |
(i = s.signal), (n = s.end); | |
} | |
lm( | |
t, | |
(s, a) => { | |
s ? r(s) : e(a); | |
}, | |
{ signal: i, end: n }, | |
); | |
}); | |
} | |
Yh.exports = { finished: um, pipeline: fm }; | |
}); | |
var No = M((aR, sd) => { | |
_(); | |
v(); | |
m(); | |
var { Buffer: cm } = (be(), X(me)), | |
{ ObjectDefineProperty: Rt, ObjectKeys: Zh, ReflectApply: ed } = ce(), | |
{ | |
promisify: { custom: td }, | |
} = Je(), | |
{ streamReturningOperators: Jh, promiseReturningOperators: Xh } = Qh(), | |
{ | |
codes: { ERR_ILLEGAL_CONSTRUCTOR: rd }, | |
} = Ae(), | |
hm = Oo(), | |
{ pipeline: id } = En(), | |
{ destroyer: dm } = ir(), | |
nd = vt(), | |
qo = Uo(), | |
Do = tt(), | |
le = (sd.exports = nn().Stream); | |
le.isDisturbed = Do.isDisturbed; | |
le.isErrored = Do.isErrored; | |
le.isReadable = Do.isReadable; | |
le.Readable = gi(); | |
for (let t of Zh(Jh)) { | |
let r = function (...i) { | |
if (new.target) throw rd(); | |
return le.Readable.from(ed(e, this, i)); | |
}; | |
jo = r; | |
let e = Jh[t]; | |
Rt(r, "name", { __proto__: null, value: e.name }), | |
Rt(r, "length", { __proto__: null, value: e.length }), | |
Rt(le.Readable.prototype, t, { | |
__proto__: null, | |
value: r, | |
enumerable: !1, | |
configurable: !0, | |
writable: !0, | |
}); | |
} | |
var jo; | |
for (let t of Zh(Xh)) { | |
let r = function (...n) { | |
if (new.target) throw rd(); | |
return ed(e, this, n); | |
}; | |
jo = r; | |
let e = Xh[t]; | |
Rt(r, "name", { __proto__: null, value: e.name }), | |
Rt(r, "length", { __proto__: null, value: e.length }), | |
Rt(le.Readable.prototype, t, { | |
__proto__: null, | |
value: r, | |
enumerable: !1, | |
configurable: !0, | |
writable: !0, | |
}); | |
} | |
var jo; | |
le.Writable = ho(); | |
le.Duplex = nt(); | |
le.Transform = mo(); | |
le.PassThrough = Eo(); | |
le.pipeline = id; | |
var { addAbortSignal: pm } = di(); | |
le.addAbortSignal = pm; | |
le.finished = nd; | |
le.destroy = dm; | |
le.compose = hm; | |
Rt(le, "promises", { | |
__proto__: null, | |
configurable: !0, | |
enumerable: !0, | |
get() { | |
return qo; | |
}, | |
}); | |
Rt(id, td, { | |
__proto__: null, | |
enumerable: !0, | |
get() { | |
return qo.pipeline; | |
}, | |
}); | |
Rt(nd, td, { | |
__proto__: null, | |
enumerable: !0, | |
get() { | |
return qo.finished; | |
}, | |
}); | |
le.Stream = le; | |
le._isUint8Array = function (e) { | |
return e instanceof Uint8Array; | |
}; | |
le._uint8ArrayToBuffer = function (e) { | |
return cm.from(e.buffer, e.byteOffset, e.byteLength); | |
}; | |
}); | |
var jt = M((pR, ue) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var he = No(), | |
gm = Uo(), | |
ym = he.Readable.destroy; | |
ue.exports = he.Readable; | |
ue.exports._uint8ArrayToBuffer = he._uint8ArrayToBuffer; | |
ue.exports._isUint8Array = he._isUint8Array; | |
ue.exports.isDisturbed = he.isDisturbed; | |
ue.exports.isErrored = he.isErrored; | |
ue.exports.isReadable = he.isReadable; | |
ue.exports.Readable = he.Readable; | |
ue.exports.Writable = he.Writable; | |
ue.exports.Duplex = he.Duplex; | |
ue.exports.Transform = he.Transform; | |
ue.exports.PassThrough = he.PassThrough; | |
ue.exports.addAbortSignal = he.addAbortSignal; | |
ue.exports.finished = he.finished; | |
ue.exports.destroy = he.destroy; | |
ue.exports.destroy = ym; | |
ue.exports.pipeline = he.pipeline; | |
ue.exports.compose = he.compose; | |
Object.defineProperty(he, "promises", { | |
configurable: !0, | |
enumerable: !0, | |
get() { | |
return gm; | |
}, | |
}); | |
ue.exports.Stream = he.Stream; | |
ue.exports.default = ue.exports; | |
}); | |
var od = M((vR, Fo) => { | |
_(); | |
v(); | |
m(); | |
typeof Object.create == "function" | |
? (Fo.exports = function (e, r) { | |
r && | |
((e.super_ = r), | |
(e.prototype = Object.create(r.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0, | |
}, | |
}))); | |
}) | |
: (Fo.exports = function (e, r) { | |
if (r) { | |
e.super_ = r; | |
var i = function () {}; | |
(i.prototype = r.prototype), | |
(e.prototype = new i()), | |
(e.prototype.constructor = e); | |
} | |
}); | |
}); | |
var ud = M((CR, ld) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var { Buffer: ze } = (be(), X(me)), | |
ad = Symbol.for("BufferList"); | |
function ee(t) { | |
if (!(this instanceof ee)) return new ee(t); | |
ee._init.call(this, t); | |
} | |
ee._init = function (e) { | |
Object.defineProperty(this, ad, { value: !0 }), | |
(this._bufs = []), | |
(this.length = 0), | |
e && this.append(e); | |
}; | |
ee.prototype._new = function (e) { | |
return new ee(e); | |
}; | |
ee.prototype._offset = function (e) { | |
if (e === 0) return [0, 0]; | |
let r = 0; | |
for (let i = 0; i < this._bufs.length; i++) { | |
let n = r + this._bufs[i].length; | |
if (e < n || i === this._bufs.length - 1) return [i, e - r]; | |
r = n; | |
} | |
}; | |
ee.prototype._reverseOffset = function (t) { | |
let e = t[0], | |
r = t[1]; | |
for (let i = 0; i < e; i++) r += this._bufs[i].length; | |
return r; | |
}; | |
ee.prototype.get = function (e) { | |
if (e > this.length || e < 0) return; | |
let r = this._offset(e); | |
return this._bufs[r[0]][r[1]]; | |
}; | |
ee.prototype.slice = function (e, r) { | |
return ( | |
typeof e == "number" && e < 0 && (e += this.length), | |
typeof r == "number" && r < 0 && (r += this.length), | |
this.copy(null, 0, e, r) | |
); | |
}; | |
ee.prototype.copy = function (e, r, i, n) { | |
if ( | |
((typeof i != "number" || i < 0) && (i = 0), | |
(typeof n != "number" || n > this.length) && (n = this.length), | |
i >= this.length || n <= 0) | |
) | |
return e || ze.alloc(0); | |
let o = !!e, | |
s = this._offset(i), | |
a = n - i, | |
l = a, | |
c = (o && r) || 0, | |
h = s[1]; | |
if (i === 0 && n === this.length) { | |
if (!o) | |
return this._bufs.length === 1 | |
? this._bufs[0] | |
: ze.concat(this._bufs, this.length); | |
for (let d = 0; d < this._bufs.length; d++) | |
this._bufs[d].copy(e, c), (c += this._bufs[d].length); | |
return e; | |
} | |
if (l <= this._bufs[s[0]].length - h) | |
return o | |
? this._bufs[s[0]].copy(e, r, h, h + l) | |
: this._bufs[s[0]].slice(h, h + l); | |
o || (e = ze.allocUnsafe(a)); | |
for (let d = s[0]; d < this._bufs.length; d++) { | |
let g = this._bufs[d].length - h; | |
if (l > g) this._bufs[d].copy(e, c, h), (c += g); | |
else { | |
this._bufs[d].copy(e, c, h, h + l), (c += g); | |
break; | |
} | |
(l -= g), h && (h = 0); | |
} | |
return e.length > c ? e.slice(0, c) : e; | |
}; | |
ee.prototype.shallowSlice = function (e, r) { | |
if ( | |
((e = e || 0), | |
(r = typeof r != "number" ? this.length : r), | |
e < 0 && (e += this.length), | |
r < 0 && (r += this.length), | |
e === r) | |
) | |
return this._new(); | |
let i = this._offset(e), | |
n = this._offset(r), | |
o = this._bufs.slice(i[0], n[0] + 1); | |
return ( | |
n[1] === 0 | |
? o.pop() | |
: (o[o.length - 1] = o[o.length - 1].slice(0, n[1])), | |
i[1] !== 0 && (o[0] = o[0].slice(i[1])), | |
this._new(o) | |
); | |
}; | |
ee.prototype.toString = function (e, r, i) { | |
return this.slice(r, i).toString(e); | |
}; | |
ee.prototype.consume = function (e) { | |
if (((e = Math.trunc(e)), Number.isNaN(e) || e <= 0)) return this; | |
for (; this._bufs.length; ) | |
if (e >= this._bufs[0].length) | |
(e -= this._bufs[0].length), | |
(this.length -= this._bufs[0].length), | |
this._bufs.shift(); | |
else { | |
(this._bufs[0] = this._bufs[0].slice(e)), (this.length -= e); | |
break; | |
} | |
return this; | |
}; | |
ee.prototype.duplicate = function () { | |
let e = this._new(); | |
for (let r = 0; r < this._bufs.length; r++) e.append(this._bufs[r]); | |
return e; | |
}; | |
ee.prototype.append = function (e) { | |
if (e == null) return this; | |
if (e.buffer) | |
this._appendBuffer(ze.from(e.buffer, e.byteOffset, e.byteLength)); | |
else if (Array.isArray(e)) | |
for (let r = 0; r < e.length; r++) this.append(e[r]); | |
else if (this._isBufferList(e)) | |
for (let r = 0; r < e._bufs.length; r++) this.append(e._bufs[r]); | |
else | |
typeof e == "number" && (e = e.toString()), | |
this._appendBuffer(ze.from(e)); | |
return this; | |
}; | |
ee.prototype._appendBuffer = function (e) { | |
this._bufs.push(e), (this.length += e.length); | |
}; | |
ee.prototype.indexOf = function (t, e, r) { | |
if ( | |
(r === void 0 && typeof e == "string" && ((r = e), (e = void 0)), | |
typeof t == "function" || Array.isArray(t)) | |
) | |
throw new TypeError( | |
'The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.', | |
); | |
if ( | |
(typeof t == "number" | |
? (t = ze.from([t])) | |
: typeof t == "string" | |
? (t = ze.from(t, r)) | |
: this._isBufferList(t) | |
? (t = t.slice()) | |
: Array.isArray(t.buffer) | |
? (t = ze.from(t.buffer, t.byteOffset, t.byteLength)) | |
: ze.isBuffer(t) || (t = ze.from(t)), | |
(e = Number(e || 0)), | |
isNaN(e) && (e = 0), | |
e < 0 && (e = this.length + e), | |
e < 0 && (e = 0), | |
t.length === 0) | |
) | |
return e > this.length ? this.length : e; | |
let i = this._offset(e), | |
n = i[0], | |
o = i[1]; | |
for (; n < this._bufs.length; n++) { | |
let s = this._bufs[n]; | |
for (; o < s.length; ) | |
if (s.length - o >= t.length) { | |
let l = s.indexOf(t, o); | |
if (l !== -1) return this._reverseOffset([n, l]); | |
o = s.length - t.length + 1; | |
} else { | |
let l = this._reverseOffset([n, o]); | |
if (this._match(l, t)) return l; | |
o++; | |
} | |
o = 0; | |
} | |
return -1; | |
}; | |
ee.prototype._match = function (t, e) { | |
if (this.length - t < e.length) return !1; | |
for (let r = 0; r < e.length; r++) | |
if (this.get(t + r) !== e[r]) return !1; | |
return !0; | |
}; | |
(function () { | |
let t = { | |
readDoubleBE: 8, | |
readDoubleLE: 8, | |
readFloatBE: 4, | |
readFloatLE: 4, | |
readBigInt64BE: 8, | |
readBigInt64LE: 8, | |
readBigUInt64BE: 8, | |
readBigUInt64LE: 8, | |
readInt32BE: 4, | |
readInt32LE: 4, | |
readUInt32BE: 4, | |
readUInt32LE: 4, | |
readInt16BE: 2, | |
readInt16LE: 2, | |
readUInt16BE: 2, | |
readUInt16LE: 2, | |
readInt8: 1, | |
readUInt8: 1, | |
readIntBE: null, | |
readIntLE: null, | |
readUIntBE: null, | |
readUIntLE: null, | |
}; | |
for (let e in t) | |
(function (r) { | |
t[r] === null | |
? (ee.prototype[r] = function (i, n) { | |
return this.slice(i, i + n)[r](0, n); | |
}) | |
: (ee.prototype[r] = function (i = 0) { | |
return this.slice(i, i + t[r])[r](0); | |
}); | |
})(e); | |
})(); | |
ee.prototype._isBufferList = function (e) { | |
return e instanceof ee || ee.isBufferList(e); | |
}; | |
ee.isBufferList = function (e) { | |
return e != null && e[ad]; | |
}; | |
ld.exports = ee; | |
}); | |
var fd = M((LR, Rn) => { | |
"use strict"; | |
_(); | |
v(); | |
m(); | |
var Wo = jt().Duplex, | |
bm = od(), | |
Ei = ud(); | |
function Se(t) { | |
if (!(this instanceof Se)) return new Se(t); | |
if (typeof t == "function") { | |
this._callback = t; | |
let e = function (i) { | |
this._callback && (this._callback(i), (this._callback = null)); | |
}.bind(this); | |
this.on("pipe", function (i) { | |
i.on("error", e); | |
}), | |
this.on("unpipe", function (i) { | |
i.removeListener("error", e); | |
}), | |
(t = null); | |
} | |
Ei._init.call(this, t), Wo.call(this); | |
} | |
bm(Se, Wo); | |
Object.assign(Se.prototype, Ei.prototype); | |
Se.prototype._new = function (e) { | |
return new Se(e); | |
}; | |
Se.prototype._write = function (e, r, i) { | |
this._appendBuffer(e), typeof i == "function" && i(); | |
}; | |
Se.prototype._read = function (e) { | |
if (!this.length) return this.push(null); | |
(e = Math.min(e, this.length)), | |
this.push(this.slice(0, e)), | |
this.consume(e); | |
}; | |
Se.prototype.end = function (e) { | |
Wo.prototype.end.call(this, e), | |
this._callback && | |
(this._callback(null, this.slice()), (this._callback = null)); | |
}; | |
Se.prototype._destroy = function (e, r) { | |
(this._bufs.length = 0), (this.length = 0), r(e); | |
}; | |
Se.prototype._isBufferList = function (e) { | |
return e instanceof Se || e instanceof Ei || Se.isBufferList(e); | |
}; | |
Se.isBufferList = Ei.isBufferList; | |
Rn.exports = Se; | |
Rn.exports.BufferListStream = Se; | |
Rn.exports.BufferList = Ei; | |
}); | |
var hd = M((WR, cd) => { | |
_(); | |
v(); | |
m(); | |
var $o = class { | |
constructor() { | |
(this.cmd = null), | |
(this.retain = !1), | |
(this.qos = 0), | |
(this.dup = !1), | |
(this.length = -1), | |
(this.topic = null), | |
(this.payload = null); | |
} | |
}; | |
cd.exports = $o; | |
}); | |
var Ho = M((QR, dd) => { | |
_(); | |
v(); | |
m(); | |
var L = dd.exports, | |
{ Buffer: ke } = (be(), X(me)); | |
L.types = { | |
0: "reserved", | |
1: "connect", | |
2: "connack", | |
3: "publish", | |
4: "puback", | |
5: "pubrec", | |
6: "pubrel", | |
7: "pubcomp", | |
8: "subscribe", | |
9: "suback", | |
10: "unsubscribe", | |
11: "unsuback", | |
12: "pingreq", | |
13: "pingresp", | |
14: "disconnect", | |
15: "auth", | |
}; | |
L.requiredHeaderFlags = { | |
1: 0, | |
2: 0, | |
4: 0, | |
5: 0, | |
6: 2, | |
7: 0, | |
8: 2, | |
9: 0, | |
10: 2, | |
11: 0, | |
12: 0, | |
13: 0, | |
14: 0, | |
15: 0, | |
}; | |
L.requiredHeaderFlagsErrors = {}; | |
for (let t in L.requiredHeaderFlags) { | |
let e = L.requiredHeaderFlags[t]; | |
L.requiredHeaderFlagsErrors[t] = | |
"Invalid header flag bits, must be 0x" + | |
e.toString(16) + | |
" for " + | |
L.types[t] + | |
" packet"; | |
} | |
L.codes = {}; | |
for (let t in L.types) { | |
let e = L.types[t]; | |
L.codes[e] = t; | |
} | |
L.CMD_SHIFT = 4; | |
L.CMD_MASK = 240; | |
L.DUP_MASK = 8; | |
L.QOS_MASK = 3; | |
L.QOS_SHIFT = 1; | |
L.RETAIN_MASK = 1; | |
L.VARBYTEINT_MASK = 127; | |
L.VARBYTEINT_FIN_MASK = 128; | |
L.VARBYTEINT_MAX = 268435455; | |
L.SESSIONPRESENT_MASK = 1; | |
L.SESSIONPRESENT_HEADER = ke.from([L.SESSIONPRESENT_MASK]); | |
L.CONNACK_HEADER = ke.from([L.codes.connack << L.CMD_SHIFT]); | |
L.USERNAME_MASK = 128; | |
L.PASSWORD_MASK = 64; | |
L.WILL_RETAIN_MASK = 32; | |
L.WILL_QOS_MASK = 24; | |
L.WILL_QOS_SHIFT = 3; | |
L.WILL_FLAG_MASK = 4; | |
L.CLEAN_SESSION_MASK = 2; | |
L.CONNECT_HEADER = ke.from([L.codes.connect << L.CMD_SHIFT]); | |
L.properties = { | |
sessionExpiryInterval: 17, | |
willDelayInterval: 24, | |
receiveMaximum: 33, | |
maximumPacketSize: 39, | |
topicAliasMaximum: 34, | |
requestResponseInformation: 25, | |
requestProblemInformation: 23, | |
userProperties: 38, | |
authenticationMethod: 21, | |
authenticationData: 22, | |
payloadFormatIndicator: 1, | |
messageExpiryInterval: 2, | |
contentType: 3, | |
responseTopic: 8, | |
correlationData: 9, | |
maximumQoS: 36, | |
retainAvailable: 37, | |
assignedClientIdentifier: 18, | |
reasonString: 31, | |
wildcardSubscriptionAvailable: 40, | |
subscriptionIdentifiersAvailable: 41, | |
sharedSubscriptionAvailable: 42, | |
serverKeepAlive: 19, | |
responseInformation: 26, | |
serverReference: 28, | |
topicAlias: 35, | |
subscriptionIdentifier: 11, | |
}; | |
L.propertiesCodes = {}; | |
for (let t in L.properties) { | |
let e = L.properties[t]; | |
L.propertiesCodes[e] = t; | |
} | |
L.propertiesTypes = { | |
sessionExpiryInterval: "int32", | |
willDelayInterval: "int32", | |
receiveMaximum: "int16", | |
maximumPacketSize: "int32", | |
topicAliasMaximum: "int16", | |
requestResponseInformation: "byte", | |
requestProblemInformation: "byte", | |
userProperties: "pair", | |
authenticationMethod: "string", | |
authenticationData: "binary", | |
payloadFormatIndicator: "byte", | |
messageExpiryInterval: "int32", | |
contentType: "string", | |
responseTopic: "string", | |
correlationData: "binary", | |
maximumQoS: "int8", | |
retainAvailable: "byte", | |
assignedClientIdentifier: "string", | |
reasonString: "string", | |
wildcardSubscriptionAvailable: "byte", | |
subscriptionIdentifiersAvailable: "byte", | |
sharedSubscriptionAvailable: "byte", | |
serverKeepAlive: "int16", | |
responseInformation: "string", | |
serverReference: "string", | |
topicAlias: "int16", | |
subscriptionIdentifier: "var", | |
}; | |
function Ft(t) { | |
return [0, 1, 2].map((e) => | |
[0, 1].map((r) => | |
[0, 1].map((i) => { | |
let n = ke.alloc(1); | |
return ( | |
n.writeUInt8( | |
(L.codes[t] << L.CMD_SHIFT) | | |
(r ? L.DUP_MASK : 0) | | |
(e << L.QOS_SHIFT) | | |
i, | |
0, | |
!0, | |
), | |
n | |
); | |
}), | |
), | |
); | |
} | |
L.PUBLISH_HEADER = Ft("publish"); | |
L.SUBSCRIBE_HEADER = Ft("subscribe"); | |
L.SUBSCRIBE_OPTIONS_QOS_MASK = 3; | |
L.SUBSCRIBE_OPTIONS_NL_MASK = 1; | |
L.SUBSCRIBE_OPTIONS_NL_SHIFT = 2; | |
L.SUBSCRIBE_OPTIONS_RAP_MASK = 1; | |
L.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3; | |
L.SUBSCRIBE_OPTIONS_RH_MASK = 3; | |
L.SUBSCRIBE_OPTIONS_RH_SHIFT = 4; | |
L.SUBSCRIBE_OPTIONS_RH = [0, 16, 32]; | |
L.SUBSCRIBE_OPTIONS_NL = 4; | |
L.SUBSCRIBE_OPTIONS_RAP = 8; | |
L.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2]; | |
L.UNSUBSCRIBE_HEADER = Ft("unsubscribe"); | |
L.ACKS = { | |
unsuback: Ft("unsuback"), | |
puback: Ft("puback"), | |
pubcomp: Ft("pubcomp"), | |
pubrel: Ft("pubrel"), | |
pubrec: Ft("pubrec"), | |
}; | |
L.SUBACK_HEADER = ke.from([L.codes.suback << L.CMD_SHIFT]); | |
L.VERSION3 = ke.from([3]); | |
L.VERSION4 = ke.from([4]); | |
L.VERSION5 = ke.from([5]); | |
L.VERSION131 = ke.from([131]); | |
L.VERSION132 = ke.from([132]); | |
L.QOS = [0, 1, 2].map((t) => ke.from([t])); | |
L.EMPTY = { | |
pingreq: ke.from([L.codes.pingreq << 4, 0]), | |
pingresp: ke.from([L.codes.pingresp << 4, 0]), | |
disconnect: ke.from([L.codes.disconnect << 4, 0]), | |
}; | |
L.MQTT5_PUBACK_PUBREC_CODES = { | |
0: "Success", | |
16: "No matching subscribers", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
144: "Topic Name invalid", | |
145: "Packet identifier in use", | |
151: "Quota exceeded", | |
153: "Payload format invalid", | |
}; | |
L.MQTT5_PUBREL_PUBCOMP_CODES = { | |
0: "Success", | |
146: "Packet Identifier not found", | |
}; | |
L.MQTT5_SUBACK_CODES = { | |
0: "Granted QoS 0", | |
1: "Granted QoS 1", | |
2: "Granted QoS 2", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
143: "Topic Filter invalid", | |
145: "Packet Identifier in use", | |
151: "Quota exceeded", | |
158: "Shared Subscriptions not supported", | |
161: "Subscription Identifiers not supported", | |
162: "Wildcard Subscriptions not supported", | |
}; | |
L.MQTT5_UNSUBACK_CODES = { | |
0: "Success", | |
17: "No subscription existed", | |
128: "Unspecified error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
143: "Topic Filter invalid", | |
145: "Packet Identifier in use", | |
}; | |
L.MQTT5_DISCONNECT_CODES = { | |
0: "Normal disconnection", | |
4: "Disconnect with Will Message", | |
128: "Unspecified error", | |
129: "Malformed Packet", | |
130: "Protocol Error", | |
131: "Implementation specific error", | |
135: "Not authorized", | |
137: "Server busy", | |
139: "Server shutting down", | |
141: "Keep Alive timeout", | |
142: "Session taken over", | |
143: "Topic Filter invalid", | |
144: "Topic Name invalid", | |
147: "Receive Maximum exceeded", | |
148: "Topic Alias invalid", | |
149: "Packet too large", | |
150: "Message rate too high", | |
151: "Quota exceeded", | |
152: "Administrative action", | |
153: "Payload format invalid", | |
154: "Retain not supported", | |
155: "QoS not supported", | |
156: "Use another server", | |
157: "Server moved", | |
158: "Shared Subscriptions not supported", | |
159: "Connection rate exceeded", | |
160: "Maximum connect time", | |
161: "Subscription Identifiers not supported", | |
162: "Wildcard Subscriptions not supported", | |
}; | |
L.MQTT5_AUTH_CODES = { | |
0: "Success", | |
24: "Continue authentication", | |
25: "Re-authenticate", | |
}; | |
}); | |
var gd = M((rC, pd) => { | |
_(); | |
v(); | |
m(); | |
var Kr = 1e3, | |
Gr = Kr * 60, | |
Qr = Gr * 60, | |
br = Qr * 24, | |
wm = br * 7, | |
_m = br * 365.25; | |
pd.exports = function (t, e) { | |
e = e || {}; | |
var r = typeof t; | |
if (r === "string" && t.length > 0) return mm(t); | |
if (r === "number" && isFinite(t)) return e.long ? Em(t) : vm(t); | |
throw new Error( | |
"val is not a non-empty string or a valid number. val=" + | |
JSON.stringify(t), | |
); | |
}; | |
function mm(t) { | |
if (((t = String(t)), !(t.length > 100))) { | |
var e = | |
/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( | |
t, | |
); | |
if (e) { | |
var r = parseFloat(e[1]), | |
i = (e[2] || "ms").toLowerCase(); | |
switch (i) { | |
case "years": | |
case "year": | |
case "yrs": | |
case "yr": | |
case "y": | |
return r * _m; | |
case "weeks": | |
case "week": | |
case "w": | |
return r * wm; | |
case "days": | |
case "day": | |
case "d": | |
return r * br; | |
case "hours": | |
case "hour": | |
case "hrs": | |
case "hr": | |
case "h": | |
return r * Qr; | |
case "minutes": | |
case "minute": | |
case "mins": | |
case "min": | |
case "m": | |
return r * Gr; | |
case "seconds": | |
case "second": | |
case "secs": | |
case "sec": | |
case "s": | |
return r * Kr; | |
case "milliseconds": | |
case "millisecond": | |
case "msecs": | |
case "msec": | |
case "ms": | |
return r; | |
default: | |
return; | |
} | |
} | |
} | |
} | |
function vm(t) { | |
var e = Math.abs(t); | |
return e >= br | |
? Math.round(t / br) + "d" | |
: e >= Qr | |
? Math.round(t / Qr) + "h" | |
: e >= Gr | |
? Math.round(t / Gr) + "m" | |
: e >= Kr | |
? Math.round(t / Kr) + "s" | |
: t + "ms"; | |
} | |
function Em(t) { | |
var e = Math.abs(t); | |
return e >= br | |
? Cn(t, e, br, "day") | |
: e >= Qr | |
? Cn(t, e, Qr, "hour") | |
: e >= Gr | |
? Cn(t, e, Gr, "minute") | |
: e >= Kr | |
? Cn(t, e, Kr, "second") | |
: t + " ms"; | |
} | |
function Cn(t, e, r, i) { | |
var n = e >= r * 1.5; | |
return Math.round(t / r) + " " + i + (n ? "s" : ""); | |
} | |
}); | |
var bd = M((uC, yd) => { | |
_(); | |
v(); | |
m(); | |
function Sm(t) { | |
(r.debug = r), | |
(r.default = r), | |
(r.coerce = l), | |
(r.disable = o), | |
(r.enable = n), | |
(r.enabled = s), | |
(r.humanize = gd()), | |
(r.destroy = c), | |
Object.keys(t).forEach((h) => { | |
r[h] = t[h]; | |
}), | |
(r.names = []), | |
(r.skips = []), | |
(r.formatters = {}); | |
function e(h) { | |
let d = 0; | |
for (let g = 0; g < h.length; g++) | |
(d = (d << 5) - d + h.charCodeAt(g)), (d |= 0); | |
return r.colors[Math.abs(d) % r.colors.length]; | |
} | |
r.selectColor = e; | |
function r(h) { | |
let d, | |
g = null, | |
y, | |
w; | |
function S(...E) { | |
if (!S.enabled) return; | |
let I = S, | |
C = Number(new Date()), | |
R = C - (d || C); | |
(I.diff = R), | |
(I.prev = d), | |
(I.curr = C), | |
(d = C), | |
(E[0] = r.coerce(E[0])), | |
typeof E[0] != "string" && E.unshift("%O"); | |
let U = 0; | |
(E[0] = E[0].replace(/%([a-zA-Z%])/g, (W, K) => { | |
if (W === "%%") return "%"; | |
U++; | |
let z = r.formatters[K]; | |
if (typeof z == "function") { | |
let Q = E[U]; | |
(W = z.call(I, Q)), E.splice(U, 1), U--; | |
} | |
return W; | |
})), | |
r.formatArgs.call(I, E), | |
(I.log || r.log).apply(I, E); | |
} | |
return ( | |
(S.namespace = h), | |
(S.useColors = r.useColors()), | |
(S.color = r.selectColor(h)), | |
(S.extend = i), | |
(S.destroy = r.destroy), | |
Object.defineProperty(S, "enabled", { | |
enumerable: !0, | |
configurable: !1, | |
get: () => | |
g !== null | |
? g | |
: (y !== r.namespaces && | |
((y = r.namespaces), (w = r.enabled(h))), | |
w), | |
set: (E) => { | |
g = E; | |
}, | |
}), | |
typeof r.init == "function" && r.init(S), | |
S | |
); | |
} | |
function i(h, d) { | |
let g = r(this.namespace + (typeof d > "u" ? ":" : d) + h); | |
return (g.log = this.log), g; | |
} | |
function n(h) { | |
r.save(h), (r.namespaces = h), (r.names = []), (r.skips = []); | |
let d, | |
g = (typeof h == "string" ? h : "").split(/[\s,]+/), | |
y = g.length; | |
for (d = 0; d < y; d++) | |
g[d] && | |
((h = g[d].replace(/\*/g, ".*?")), | |
h[0] === "-" | |
? r.skips.push(new RegExp("^" + h.slice(1) + "$")) | |
: r.names.push(new RegExp("^" + h + "$"))); | |
} | |
function o() { | |
let h = [...r.names.map(a), ...r.skips.map(a).map((d) => "-" + d)].join( | |
",", | |
); | |
return r.enable(""), h; | |
} | |
function s(h) { | |
if (h[h.length - 1] === "*") return !0; | |
let d, g; | |
for (d = 0, g = r.skips.length; d < g; d++) | |
if (r.skips[d].test(h)) return !1; | |
for (d = 0, g = r.names.length; d < g; d++) | |
if (r.names[d].test(h)) return !0; | |
return !1; | |
} | |
function a(h) { | |
return h | |
.toString() | |
.substring(2, h.toString().length - 2) | |
.replace(/\.\*\?$/, "*"); | |
} | |
function l(h) { | |
return h instanceof Error ? h.stack || h.message : h; | |
} | |
function c() { | |
console.warn( | |
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.", | |
); | |
} | |
return r.enable(r.load()), r; | |
} | |
yd.exports = Sm; | |
}); | |
var ot = M((xe, Bn) => { | |
_(); | |
v(); | |
m(); | |
xe.formatArgs = Im; | |
xe.save = Tm; | |
xe.load = Rm; | |
xe.useColors = Am; | |
xe.storage = Cm(); | |
xe.destroy = (() => { | |
let t = !1; | |
return () => { | |
t || | |
((t = !0), | |
console.warn( | |
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.", | |
)); | |
}; | |
})(); | |
xe.colors = [ | |
"#0000CC", | |
"#0000FF", | |
"#0033CC", | |
"#0033FF", | |
"#0066CC", | |
"#0066FF", | |
"#0099CC", | |
"#0099FF", | |
"#00CC00", | |
"#00CC33", | |
"#00CC66", | |
"#00CC99", | |
"#00CCCC", | |
"#00CCFF", | |
"#3300CC", | |
"#3300FF", | |
"#3333CC", | |
"#3333FF", | |
"#3366CC", | |
"#3366FF", | |
"#3399CC", | |
"#3399FF", | |
"#33CC00", | |
"#33CC33", | |
"#33CC66", | |
"#33CC99", | |
"#33CCCC", | |
"#33CCFF", | |
"#6600CC", | |
"#6600FF", | |
"#6633CC", | |
"#6633FF", | |
"#66CC00", | |
"#66CC33", | |
"#9900CC", | |
"#9900FF", | |
"#9933CC", | |
"#9933FF", | |
"#99CC00", | |
"#99CC33", | |
"#CC0000", | |
"#CC0033", | |
"#CC0066", | |
"#CC0099", | |
"#CC00CC", | |
"#CC00FF", | |
"#CC3300", | |
"#CC3333", | |
"#CC3366", | |
"#CC3399", | |
"#CC33CC", | |
"#CC33FF", | |
"#CC6600", | |
"#CC6633", | |
"#CC9900", | |
"#CC9933", | |
"#CCCC00", | |
"#CCCC33", | |
"#FF0000", | |
"#FF0033", | |
"#FF0066", | |
"#FF0099", | |
"#FF00CC", | |
"#FF00FF", | |
"#FF3300", | |
"#FF3333", | |
"#FF3366", | |
"#FF3399", | |
"#FF33CC", | |
"#FF33FF", | |
"#FF6600", | |
"#FF6633", | |
"#FF9900", | |
"#FF9933", | |
"#FFCC00", | |
"#FFCC33", | |
]; | |
function Am() { | |
return typeof window < "u" && | |
window.process && | |
(window.process.type === "renderer" || window.process.__nwjs) | |
? !0 | |
: typeof navigator < "u" && | |
navigator.userAgent && | |
navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/) | |
? !1 | |
: (typeof document < "u" && | |
document.documentElement && | |
document.documentElement.style && | |
document.documentElement.style.WebkitAppearance) || | |
(typeof window < "u" && | |
window.console && | |
(window.console.firebug || | |
(window.console.exception && window.console.table))) || | |
(typeof navigator < "u" && | |
navigator.userAgent && | |
navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && | |
parseInt(RegExp.$1, 10) >= 31) || | |
(typeof navigator < "u" && | |
navigator.userAgent && | |
navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); | |
} | |
function Im(t) { | |
if ( | |
((t[0] = | |
(this.useColors ? "%c" : "") + | |
this.namespace + | |
(this.useColors ? " %c" : " ") + | |
t[0] + | |
(this.useColors ? "%c " : " ") + | |
"+" + | |
Bn.exports.humanize(this.diff)), | |
!this.useColors) | |
) | |
return; | |
let e = "color: " + this.color; | |
t.splice(1, 0, e, "color: inherit"); | |
let r = 0, | |
i = 0; | |
t[0].replace(/%[a-zA-Z%]/g, (n) => { | |
n !== "%%" && (r++, n === "%c" && (i = r)); | |
}), | |
t.splice(i, 0, e); | |
} | |
xe.log = console.debug || console.log || (() => {}); | |
function Tm(t) { | |
try { | |
t ? xe.storage.setItem("debug", t) : xe.storage.removeItem("debug"); | |
} catch {} | |
} | |
function Rm() { | |
let t; | |
try { | |
t = xe.storage.getItem("debug"); | |
} catch {} | |
return !t && typeof B < "u" && "env" in B && (t = B.env.DEBUG), t; | |
} | |
function Cm() { | |
try { | |
return localStorage; | |
} catch {} | |
} | |
Bn.exports = bd()(xe); | |
var { formatters: Bm } = Bn.exports; | |
Bm.j = function (t) { | |
try { | |
return JSON.stringify(t); | |
} catch (e) { | |
return "[UnexpectedJSONParseError]: " + e.message; | |
} | |
}; | |
}); | |
var md = M((EC, _d) => { | |
_(); | |
v(); | |
m(); | |
var Pm = fd(), | |
{ EventEmitter: km } = (sr(), X(nr)), | |
wd = hd(), | |
V = Ho(), | |
D = ot()("mqtt-packet:parser"), | |
Vo = class t extends km { | |
constructor() { | |
super(), (this.parser = this.constructor.parser); | |
} | |
static parser(e) { | |
return this instanceof t | |
? ((this.settings = e || {}), | |
(this._states = [ | |
"_parseHeader", | |
"_parseLength", | |
"_parsePayload", | |
"_newPacket", | |
]), | |
this._resetState(), | |
this) | |
: new t().parser(e); | |
} | |
_resetState() { | |
D("_resetState: resetting packet, error, _list, and _stateCounter"), | |
(this.packet = new wd()), | |
(this.error = null), | |
(this._list = Pm()), | |
(this._stateCounter = 0); | |
} | |
parse(e) { | |
for ( | |
this.error && this._resetState(), | |
this._list.append(e), | |
D("parse: current state: %s", this._states[this._stateCounter]); | |
(this.packet.length !== -1 || this._list.length > 0) && | |
this[this._states[this._stateCounter]]() && | |
!this.error; | |
) | |
this._stateCounter++, | |
D( | |
"parse: state complete. _stateCounter is now: %d", | |
this._stateCounter, | |
), | |
D( | |
"parse: packet.length: %d, buffer list length: %d", | |
this.packet.length, | |
this._list.length, | |
), | |
this._stateCounter >= this._states.length && | |
(this._stateCounter = 0); | |
return ( | |
D( | |
"parse: exited while loop. packet: %d, buffer list length: %d", | |
this.packet.length, | |
this._list.length, | |
), | |
this._list.length | |
); | |
} | |
_parseHeader() { | |
let e = this._list.readUInt8(0), | |
r = e >> V.CMD_SHIFT; | |
this.packet.cmd = V.types[r]; | |
let i = e & 15, | |
n = V.requiredHeaderFlags[r]; | |
return n != null && i !== n | |
? this._emitError(new Error(V.requiredHeaderFlagsErrors[r])) | |
: ((this.packet.retain = (e & V.RETAIN_MASK) !== 0), | |
(this.packet.qos = (e >> V.QOS_SHIFT) & V.QOS_MASK), | |
this.packet.qos > 2 | |
? this._emitError( | |
new Error("Packet must not have both QoS bits set to 1"), | |
) | |
: ((this.packet.dup = (e & V.DUP_MASK) !== 0), | |
D("_parseHeader: packet: %o", this.packet), | |
this._list.consume(1), | |
!0)); | |
} | |
_parseLength() { | |
let e = this._parseVarByteNum(!0); | |
return ( | |
e && ((this.packet.length = e.value), this._list.consume(e.bytes)), | |
D("_parseLength %d", e.value), | |
!!e | |
); | |
} | |
_parsePayload() { | |
D("_parsePayload: payload %O", this._list); | |
let e = !1; | |
if ( | |
this.packet.length === 0 || | |
this._list.length >= this.packet.length | |
) { | |
switch (((this._pos = 0), this.packet.cmd)) { | |
case "connect": | |
this._parseConnect(); | |
break; | |
case "connack": | |
this._parseConnack(); | |
break; | |
case "publish": | |
this._parsePublish(); | |
break; | |
case "puback": | |
case "pubrec": | |
case "pubrel": | |
case "pubcomp": | |
this._parseConfirmation(); | |
break; | |
case "subscribe": | |
this._parseSubscribe(); | |
break; | |
case "suback": | |
this._parseSuback(); | |
break; | |
case "unsubscribe": | |
this._parseUnsubscribe(); | |
break; | |
case "unsuback": | |
this._parseUnsuback(); | |
break; | |
case "pingreq": | |
case "pingresp": | |
break; | |
case "disconnect": | |
this._parseDisconnect(); | |
break; | |
case "auth": | |
this._parseAuth(); | |
break; | |
default: | |
this._emitError(new Error("Not supported")); | |
} | |
e = !0; | |
} | |
return D("_parsePayload complete result: %s", e), e; | |
} | |
_parseConnect() { | |
D("_parseConnect"); | |
let e, | |
r, | |
i, | |
n, | |
o = {}, | |
s = this.packet, | |
a = this._parseString(); | |
if (a === null) | |
return this._emitError(new Error("Cannot parse protocolId")); | |
if (a !== "MQTT" && a !== "MQIsdp") | |
return this._emitError(new Error("Invalid protocolId")); | |
if (((s.protocolId = a), this._pos >= this._list.length)) | |
return this._emitError(new Error("Packet too short")); | |
if ( | |
((s.protocolVersion = this._list.readUInt8(this._pos)), | |
s.protocolVersion >= 128 && | |
((s.bridgeMode = !0), | |
(s.protocolVersion = s.protocolVersion - 128)), | |
s.protocolVersion !== 3 && | |
s.protocolVersion !== 4 && | |
s.protocolVersion !== 5) | |
) | |
return this._emitError(new Error("Invalid protocol version")); | |
if ((this._pos++, this._pos >= this._list.length)) | |
return this._emitError(new Error("Packet too short")); | |
if (this._list.readUInt8(this._pos) & 1) | |
return this._emitError( | |
new Error("Connect flag bit 0 must be 0, but got 1"), | |
); | |
(o.username = this._list.readUInt8(this._pos) & V.USERNAME_MASK), | |
(o.password = this._list.readUInt8(this._pos) & V.PASSWORD_MASK), | |
(o.will = this._list.readUInt8(this._pos) & V.WILL_FLAG_MASK); | |
let l = !!(this._list.readUInt8(this._pos) & V.WILL_RETAIN_MASK), | |
c = | |
(this._list.readUInt8(this._pos) & V.WILL_QOS_MASK) >> | |
V.WILL_QOS_SHIFT; | |
if (o.will) (s.will = {}), (s.will.retain = l), (s.will.qos = c); | |
else { | |
if (l) | |
return this._emitError( | |
new Error( | |
"Will Retain Flag must be set to zero when Will Flag is set to 0", | |
), | |
); | |
if (c) | |
return this._emitError( | |
new Error( | |
"Will QoS must be set to zero when Will Flag is set to 0", | |
), | |
); | |
} | |
if ( | |
((s.clean = | |
(this._list.readUInt8(this._pos) & V.CLEAN_SESSION_MASK) !== 0), | |
this._pos++, | |
(s.keepalive = this._parseNum()), | |
s.keepalive === -1) | |
) | |
return this._emitError(new Error("Packet too short")); | |
if (s.protocolVersion === 5) { | |
let d = this._parseProperties(); | |
Object.getOwnPropertyNames(d).length && (s.properties = d); | |
} | |
let h = this._parseString(); | |
if (h === null) return this._emitError(new Error("Packet too short")); | |
if ( | |
((s.clientId = h), | |
D("_parseConnect: packet.clientId: %s", s.clientId), | |
o.will) | |
) { | |
if (s.protocolVersion === 5) { | |
let d = this._parseProperties(); | |
Object.getOwnPropertyNames(d).length && (s.will.properties = d); | |
} | |
if (((e = this._parseString()), e === null)) | |
return this._emitError(new Error("Cannot parse will topic")); | |
if ( | |
((s.will.topic = e), | |
D("_parseConnect: packet.will.topic: %s", s.will.topic), | |
(r = this._parseBuffer()), | |
r === null) | |
) | |
return this._emitError(new Error("Cannot parse will payload")); | |
(s.will.payload = r), | |
D("_parseConnect: packet.will.paylaod: %s", s.will.payload); | |
} | |
if (o.username) { | |
if (((n = this._parseString()), n === null)) | |
return this._emitError(new Error("Cannot parse username")); | |
(s.username = n), | |
D("_parseConnect: packet.username: %s", s.username); | |
} | |
if (o.password) { | |
if (((i = this._parseBuffer()), i === null)) | |
return this._emitError(new Error("Cannot parse password")); | |
s.password = i; | |
} | |
return (this.settings = s), D("_parseConnect: complete"), s; | |
} | |
_parseConnack() { | |
D("_parseConnack"); | |
let e = this.packet; | |
if (this._list.length < 1) return null; | |
let r = this._list.readUInt8(this._pos++); | |
if (r > 1) | |
return this._emitError( | |
new Error("Invalid connack flags, bits 7-1 must be set to 0"), | |
); | |
if ( | |
((e.sessionPresent = !!(r & V.SESSIONPRESENT_MASK)), | |
this.settings.protocolVersion === 5) | |
) | |
this._list.length >= 2 | |
? (e.reasonCode = this._list.readUInt8(this._pos++)) | |
: (e.reasonCode = 0); | |
else { | |
if (this._list.length < 2) return null; | |
e.returnCode = this._list.readUInt8(this._pos++); | |
} | |
if (e.returnCode === -1 || e.reasonCode === -1) | |
return this._emitError(new Error("Cannot parse return code")); | |
if (this.settings.protocolVersion === 5) { | |
let i = this._parseProperties(); | |
Object.getOwnPropertyNames(i).length && (e.properties = i); | |
} | |
D("_parseConnack: complete"); | |
} | |
_parsePublish() { | |
D("_parsePublish"); | |
let e = this.packet; | |
if (((e.topic = this._parseString()), e.topic === null)) | |
return this._emitError(new Error("Cannot parse topic")); | |
if (!(e.qos > 0 && !this._parseMessageId())) { | |
if (this.settings.protocolVersion === 5) { | |
let r = this._parseProperties(); | |
Object.getOwnPropertyNames(r).length && (e.properties = r); | |
} | |
(e.payload = this._list.slice(this._pos, e.length)), | |
D("_parsePublish: payload from buffer list: %o", e.payload); | |
} | |
} | |
_parseSubscribe() { | |
D("_parseSubscribe"); | |
let e = this.packet, | |
r, | |
i, | |
n, | |
o, | |
s, | |
a, | |
l; | |
if (((e.subscriptions = []), !!this._parseMessageId())) { | |
if (this.settings.protocolVersion === 5) { | |
let c = this._parseProperties(); | |
Object.getOwnPropertyNames(c).length && (e.properties = c); | |
} | |
if (e.length <= 0) | |
return this._emitError( | |
new Error("Malformed subscribe, no payload specified"), | |
); | |
for (; this._pos < e.length; ) { | |
if (((r = this._parseString()), r === null)) | |
return this._emitError(new Error("Cannot parse topic")); | |
if (this._pos >= e.length) | |
return this._emitError( | |
new Error("Malformed Subscribe Payload"), | |
); | |
if ( | |
((i = this._parseByte()), this.settings.protocolVersion === 5) | |
) { | |
if (i & 192) | |
return this._emitError( | |
new Error( | |
"Invalid subscribe topic flag bits, bits 7-6 must be 0", | |
), | |
); | |
} else if (i & 252) | |
return this._emitError( | |
new Error( | |
"Invalid subscribe topic flag bits, bits 7-2 must be 0", | |
), | |
); | |
if (((n = i & V.SUBSCRIBE_OPTIONS_QOS_MASK), n > 2)) | |
return this._emitError( | |
new Error("Invalid subscribe QoS, must be <= 2"), | |
); | |
if ( | |
((a = | |
((i >> V.SUBSCRIBE_OPTIONS_NL_SHIFT) & | |
V.SUBSCRIBE_OPTIONS_NL_MASK) !== | |
0), | |
(s = | |
((i >> V.SUBSCRIBE_OPTIONS_RAP_SHIFT) & | |
V.SUBSCRIBE_OPTIONS_RAP_MASK) !== | |
0), | |
(o = | |
(i >> V.SUBSCRIBE_OPTIONS_RH_SHIFT) & | |
V.SUBSCRIBE_OPTIONS_RH_MASK), | |
o > 2) | |
) | |
return this._emitError( | |
new Error("Invalid retain handling, must be <= 2"), | |
); | |
(l = { topic: r, qos: n }), | |
this.settings.protocolVersion === 5 | |
? ((l.nl = a), (l.rap = s), (l.rh = o)) | |
: this.settings.bridgeMode && | |
((l.rh = 0), (l.rap = !0), (l.nl = !0)), | |
D("_parseSubscribe: push subscription `%s` to subscription", l), | |
e.subscriptions.push(l); | |
} | |
} | |
} | |
_parseSuback() { | |
D("_parseSuback"); | |
let e = this.packet; | |
if (((this.packet.granted = []), !!this._parseMessageId())) { | |
if (this.settings.protocolVersion === 5) { | |
let r = this._parseProperties(); | |
Object.getOwnPropertyNames(r).length && (e.properties = r); | |
} | |
if (e.length <= 0) | |
return this._emitError( | |
new Error("Malformed suback, no payload specified"), | |
); | |
for (; this._pos < this.packet.length; ) { | |
let r = this._list.readUInt8(this._pos++); | |
if (this.settings.protocolVersion === 5) { | |
if (!V.MQTT5_SUBACK_CODES[r]) | |
return this._emitError(new Error("Invalid suback code")); | |
} else if (r > 2 && r !== 128) | |
return this._emitError( | |
new Error("Invalid suback QoS, must be 0, 1, 2 or 128"), | |
); | |
this.packet.granted.push(r); | |
} | |
} | |
} | |
_parseUnsubscribe() { | |
D("_parseUnsubscribe"); | |
let e = this.packet; | |
if (((e.unsubscriptions = []), !!this._parseMessageId())) { | |
if (this.settings.protocolVersion === 5) { | |
let r = this._parseProperties(); | |
Object.getOwnPropertyNames(r).length && (e.properties = r); | |
} | |
if (e.length <= 0) | |
return this._emitError( | |
new Error("Malformed unsubscribe, no payload specified"), | |
); | |
for (; this._pos < e.length; ) { | |
let r = this._parseString(); | |
if (r === null) | |
return this._emitError(new Error("Cannot parse topic")); | |
D("_parseUnsubscribe: push topic `%s` to unsubscriptions", r), | |
e.unsubscriptions.push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment