taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
1,287 lines • 2.79 MB
JavaScript
var r8 = Object.defineProperty;
var n8 = (t, e, r) => e in t ? r8(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var M = (t, e, r) => n8(t, typeof e != "symbol" ? e + "" : e, r);
import { jsxs as re, jsx as B, Fragment as dt } from "react/jsx-runtime";
import * as nt from "react";
import R, { useLayoutEffect as gm, useEffect as me, cloneElement as Ci, createElement as Ut, createContext as ur, useState as ue, useRef as Me, useMemo as Te, useImperativeHandle as jS, useCallback as Se, Component as mo, useContext as cr, forwardRef as i8, Fragment as br, isValidElement as zS, useId as bo, useSyncExternalStore as s8, useReducer as o8, createRef as a8, PureComponent as Da, Children as WS, Suspense as l8 } from "react";
import u8, { createPortal as c8 } from "react-dom";
import de, { checkPropTypes as HS } from "prop-types";
var nl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Vi(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function VS(t) {
if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
var e = t.default;
if (typeof e == "function") {
var r = function n() {
return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
};
r.prototype = e.prototype;
} else r = {};
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
var i = Object.getOwnPropertyDescriptor(t, n);
Object.defineProperty(r, n, i.get ? i : {
enumerable: !0,
get: function() {
return t[n];
}
});
}), r;
}
var Tf = {}, Cf = {}, Po = {}, x1;
function f8() {
if (x1) return Po;
x1 = 1, Po.byteLength = a, Po.toByteArray = u, Po.fromByteArray = h;
for (var t = [], e = [], r = typeof Uint8Array < "u" ? 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(d) {
var p = d.length;
if (p % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var g = d.indexOf("=");
g === -1 && (g = p);
var m = g === p ? 0 : 4 - g % 4;
return [g, m];
}
function a(d) {
var p = o(d), g = p[0], m = p[1];
return (g + m) * 3 / 4 - m;
}
function l(d, p, g) {
return (p + g) * 3 / 4 - g;
}
function u(d) {
var p, g = o(d), m = g[0], y = g[1], w = new r(l(d, m, y)), _ = 0, x = y > 0 ? m - 4 : m, S;
for (S = 0; S < x; S += 4)
p = e[d.charCodeAt(S)] << 18 | e[d.charCodeAt(S + 1)] << 12 | e[d.charCodeAt(S + 2)] << 6 | e[d.charCodeAt(S + 3)], w[_++] = p >> 16 & 255, w[_++] = p >> 8 & 255, w[_++] = p & 255;
return y === 2 && (p = e[d.charCodeAt(S)] << 2 | e[d.charCodeAt(S + 1)] >> 4, w[_++] = p & 255), y === 1 && (p = e[d.charCodeAt(S)] << 10 | e[d.charCodeAt(S + 1)] << 4 | e[d.charCodeAt(S + 2)] >> 2, w[_++] = p >> 8 & 255, w[_++] = p & 255), w;
}
function c(d) {
return t[d >> 18 & 63] + t[d >> 12 & 63] + t[d >> 6 & 63] + t[d & 63];
}
function f(d, p, g) {
for (var m, y = [], w = p; w < g; w += 3)
m = (d[w] << 16 & 16711680) + (d[w + 1] << 8 & 65280) + (d[w + 2] & 255), y.push(c(m));
return y.join("");
}
function h(d) {
for (var p, g = d.length, m = g % 3, y = [], w = 16383, _ = 0, x = g - m; _ < x; _ += w)
y.push(f(d, _, _ + w > x ? x : _ + w));
return m === 1 ? (p = d[g - 1], y.push(
t[p >> 2] + t[p << 4 & 63] + "=="
)) : m === 2 && (p = (d[g - 2] << 8) + d[g - 1], y.push(
t[p >> 10] + t[p >> 4 & 63] + t[p << 2 & 63] + "="
)), y.join("");
}
return Po;
}
var il = {};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
var S1;
function h8() {
return S1 || (S1 = 1, il.read = function(t, e, r, n, i) {
var s, o, a = i * 8 - n - 1, l = (1 << a) - 1, u = l >> 1, c = -7, f = r ? i - 1 : 0, h = r ? -1 : 1, d = t[e + f];
for (f += h, s = d & (1 << -c) - 1, d >>= -c, c += a; c > 0; s = s * 256 + t[e + f], f += h, c -= 8)
;
for (o = s & (1 << -c) - 1, s >>= -c, c += n; c > 0; o = o * 256 + t[e + f], f += h, c -= 8)
;
if (s === 0)
s = 1 - u;
else {
if (s === l)
return o ? NaN : (d ? -1 : 1) * (1 / 0);
o = o + Math.pow(2, n), s = s - u;
}
return (d ? -1 : 1) * o * Math.pow(2, s - n);
}, il.write = function(t, e, r, n, i, s) {
var o, a, l, u = s * 8 - i - 1, c = (1 << u) - 1, f = c >> 1, h = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = n ? 0 : s - 1, p = n ? 1 : -1, g = 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 = c) : (o = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -o)) < 1 && (o--, l *= 2), o + f >= 1 ? e += h / l : e += h * Math.pow(2, 1 - f), e * l >= 2 && (o++, l /= 2), o + f >= c ? (a = 0, o = c) : o + f >= 1 ? (a = (e * l - 1) * Math.pow(2, i), o = o + f) : (a = e * Math.pow(2, f - 1) * Math.pow(2, i), o = 0)); i >= 8; t[r + d] = a & 255, d += p, a /= 256, i -= 8)
;
for (o = o << i | a, u += i; u > 0; t[r + d] = o & 255, d += p, o /= 256, u -= 8)
;
t[r + d - p] |= g * 128;
}), il;
}
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
var E1;
function d8() {
return E1 || (E1 = 1, function(t) {
const e = f8(), r = h8(), n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = a, t.SlowBuffer = w, t.INSPECT_MAX_BYTES = 50;
const i = 2147483647;
t.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !a.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 s() {
try {
const E = new Uint8Array(1), b = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(b, Uint8Array.prototype), Object.setPrototypeOf(E, b), E.foo() === 42;
} catch {
return !1;
}
}
Object.defineProperty(a.prototype, "parent", {
enumerable: !0,
get: function() {
if (a.isBuffer(this))
return this.buffer;
}
}), Object.defineProperty(a.prototype, "offset", {
enumerable: !0,
get: function() {
if (a.isBuffer(this))
return this.byteOffset;
}
});
function o(E) {
if (E > i)
throw new RangeError('The value "' + E + '" is invalid for option "size"');
const b = new Uint8Array(E);
return Object.setPrototypeOf(b, a.prototype), b;
}
function a(E, b, v) {
if (typeof E == "number") {
if (typeof b == "string")
throw new TypeError(
'The "string" argument must be of type string. Received type number'
);
return f(E);
}
return l(E, b, v);
}
a.poolSize = 8192;
function l(E, b, v) {
if (typeof E == "string")
return h(E, b);
if (ArrayBuffer.isView(E))
return p(E);
if (E == null)
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof E
);
if (Le(E, ArrayBuffer) || E && Le(E.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Le(E, SharedArrayBuffer) || E && Le(E.buffer, SharedArrayBuffer)))
return g(E, b, v);
if (typeof E == "number")
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
);
const O = E.valueOf && E.valueOf();
if (O != null && O !== E)
return a.from(O, b, v);
const j = m(E);
if (j) return j;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof E[Symbol.toPrimitive] == "function")
return a.from(E[Symbol.toPrimitive]("string"), b, v);
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof E
);
}
a.from = function(E, b, v) {
return l(E, b, v);
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
function u(E) {
if (typeof E != "number")
throw new TypeError('"size" argument must be of type number');
if (E < 0)
throw new RangeError('The value "' + E + '" is invalid for option "size"');
}
function c(E, b, v) {
return u(E), E <= 0 ? o(E) : b !== void 0 ? typeof v == "string" ? o(E).fill(b, v) : o(E).fill(b) : o(E);
}
a.alloc = function(E, b, v) {
return c(E, b, v);
};
function f(E) {
return u(E), o(E < 0 ? 0 : y(E) | 0);
}
a.allocUnsafe = function(E) {
return f(E);
}, a.allocUnsafeSlow = function(E) {
return f(E);
};
function h(E, b) {
if ((typeof b != "string" || b === "") && (b = "utf8"), !a.isEncoding(b))
throw new TypeError("Unknown encoding: " + b);
const v = _(E, b) | 0;
let O = o(v);
const j = O.write(E, b);
return j !== v && (O = O.slice(0, j)), O;
}
function d(E) {
const b = E.length < 0 ? 0 : y(E.length) | 0, v = o(b);
for (let O = 0; O < b; O += 1)
v[O] = E[O] & 255;
return v;
}
function p(E) {
if (Le(E, Uint8Array)) {
const b = new Uint8Array(E);
return g(b.buffer, b.byteOffset, b.byteLength);
}
return d(E);
}
function g(E, b, v) {
if (b < 0 || E.byteLength < b)
throw new RangeError('"offset" is outside of buffer bounds');
if (E.byteLength < b + (v || 0))
throw new RangeError('"length" is outside of buffer bounds');
let O;
return b === void 0 && v === void 0 ? O = new Uint8Array(E) : v === void 0 ? O = new Uint8Array(E, b) : O = new Uint8Array(E, b, v), Object.setPrototypeOf(O, a.prototype), O;
}
function m(E) {
if (a.isBuffer(E)) {
const b = y(E.length) | 0, v = o(b);
return v.length === 0 || E.copy(v, 0, 0, b), v;
}
if (E.length !== void 0)
return typeof E.length != "number" || Ze(E.length) ? o(0) : d(E);
if (E.type === "Buffer" && Array.isArray(E.data))
return d(E.data);
}
function y(E) {
if (E >= i)
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
return E | 0;
}
function w(E) {
return +E != E && (E = 0), a.alloc(+E);
}
a.isBuffer = function(b) {
return b != null && b._isBuffer === !0 && b !== a.prototype;
}, a.compare = function(b, v) {
if (Le(b, Uint8Array) && (b = a.from(b, b.offset, b.byteLength)), Le(v, Uint8Array) && (v = a.from(v, v.offset, v.byteLength)), !a.isBuffer(b) || !a.isBuffer(v))
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
);
if (b === v) return 0;
let O = b.length, j = v.length;
for (let te = 0, se = Math.min(O, j); te < se; ++te)
if (b[te] !== v[te]) {
O = b[te], j = v[te];
break;
}
return O < j ? -1 : j < O ? 1 : 0;
}, a.isEncoding = function(b) {
switch (String(b).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;
}
}, a.concat = function(b, v) {
if (!Array.isArray(b))
throw new TypeError('"list" argument must be an Array of Buffers');
if (b.length === 0)
return a.alloc(0);
let O;
if (v === void 0)
for (v = 0, O = 0; O < b.length; ++O)
v += b[O].length;
const j = a.allocUnsafe(v);
let te = 0;
for (O = 0; O < b.length; ++O) {
let se = b[O];
if (Le(se, Uint8Array))
te + se.length > j.length ? (a.isBuffer(se) || (se = a.from(se)), se.copy(j, te)) : Uint8Array.prototype.set.call(
j,
se,
te
);
else if (a.isBuffer(se))
se.copy(j, te);
else
throw new TypeError('"list" argument must be an Array of Buffers');
te += se.length;
}
return j;
};
function _(E, b) {
if (a.isBuffer(E))
return E.length;
if (ArrayBuffer.isView(E) || Le(E, ArrayBuffer))
return E.byteLength;
if (typeof E != "string")
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof E
);
const v = E.length, O = arguments.length > 2 && arguments[2] === !0;
if (!O && v === 0) return 0;
let j = !1;
for (; ; )
switch (b) {
case "ascii":
case "latin1":
case "binary":
return v;
case "utf8":
case "utf-8":
return Oe(E).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return v * 2;
case "hex":
return v >>> 1;
case "base64":
return lt(E).length;
default:
if (j)
return O ? -1 : Oe(E).length;
b = ("" + b).toLowerCase(), j = !0;
}
}
a.byteLength = _;
function x(E, b, v) {
let O = !1;
if ((b === void 0 || b < 0) && (b = 0), b > this.length || ((v === void 0 || v > this.length) && (v = this.length), v <= 0) || (v >>>= 0, b >>>= 0, v <= b))
return "";
for (E || (E = "utf8"); ; )
switch (E) {
case "hex":
return U(this, b, v);
case "utf8":
case "utf-8":
return $(this, b, v);
case "ascii":
return A(this, b, v);
case "latin1":
case "binary":
return C(this, b, v);
case "base64":
return G(this, b, v);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return z(this, b, v);
default:
if (O) throw new TypeError("Unknown encoding: " + E);
E = (E + "").toLowerCase(), O = !0;
}
}
a.prototype._isBuffer = !0;
function S(E, b, v) {
const O = E[b];
E[b] = E[v], E[v] = O;
}
a.prototype.swap16 = function() {
const b = this.length;
if (b % 2 !== 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let v = 0; v < b; v += 2)
S(this, v, v + 1);
return this;
}, a.prototype.swap32 = function() {
const b = this.length;
if (b % 4 !== 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let v = 0; v < b; v += 4)
S(this, v, v + 3), S(this, v + 1, v + 2);
return this;
}, a.prototype.swap64 = function() {
const b = this.length;
if (b % 8 !== 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let v = 0; v < b; v += 8)
S(this, v, v + 7), S(this, v + 1, v + 6), S(this, v + 2, v + 5), S(this, v + 3, v + 4);
return this;
}, a.prototype.toString = function() {
const b = this.length;
return b === 0 ? "" : arguments.length === 0 ? $(this, 0, b) : x.apply(this, arguments);
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(b) {
if (!a.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
return this === b ? !0 : a.compare(this, b) === 0;
}, a.prototype.inspect = function() {
let b = "";
const v = t.INSPECT_MAX_BYTES;
return b = this.toString("hex", 0, v).replace(/(.{2})/g, "$1 ").trim(), this.length > v && (b += " ... "), "<Buffer " + b + ">";
}, n && (a.prototype[n] = a.prototype.inspect), a.prototype.compare = function(b, v, O, j, te) {
if (Le(b, Uint8Array) && (b = a.from(b, b.offset, b.byteLength)), !a.isBuffer(b))
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof b
);
if (v === void 0 && (v = 0), O === void 0 && (O = b ? b.length : 0), j === void 0 && (j = 0), te === void 0 && (te = this.length), v < 0 || O > b.length || j < 0 || te > this.length)
throw new RangeError("out of range index");
if (j >= te && v >= O)
return 0;
if (j >= te)
return -1;
if (v >= O)
return 1;
if (v >>>= 0, O >>>= 0, j >>>= 0, te >>>= 0, this === b) return 0;
let se = te - j, ye = O - v;
const tt = Math.min(se, ye), Xe = this.slice(j, te), Ge = b.slice(v, O);
for (let je = 0; je < tt; ++je)
if (Xe[je] !== Ge[je]) {
se = Xe[je], ye = Ge[je];
break;
}
return se < ye ? -1 : ye < se ? 1 : 0;
};
function T(E, b, v, O, j) {
if (E.length === 0) return -1;
if (typeof v == "string" ? (O = v, v = 0) : v > 2147483647 ? v = 2147483647 : v < -2147483648 && (v = -2147483648), v = +v, Ze(v) && (v = j ? 0 : E.length - 1), v < 0 && (v = E.length + v), v >= E.length) {
if (j) return -1;
v = E.length - 1;
} else if (v < 0)
if (j) v = 0;
else return -1;
if (typeof b == "string" && (b = a.from(b, O)), a.isBuffer(b))
return b.length === 0 ? -1 : I(E, b, v, O, j);
if (typeof b == "number")
return b = b & 255, typeof Uint8Array.prototype.indexOf == "function" ? j ? Uint8Array.prototype.indexOf.call(E, b, v) : Uint8Array.prototype.lastIndexOf.call(E, b, v) : I(E, [b], v, O, j);
throw new TypeError("val must be string, number or Buffer");
}
function I(E, b, v, O, j) {
let te = 1, se = E.length, ye = b.length;
if (O !== void 0 && (O = String(O).toLowerCase(), O === "ucs2" || O === "ucs-2" || O === "utf16le" || O === "utf-16le")) {
if (E.length < 2 || b.length < 2)
return -1;
te = 2, se /= 2, ye /= 2, v /= 2;
}
function tt(Ge, je) {
return te === 1 ? Ge[je] : Ge.readUInt16BE(je * te);
}
let Xe;
if (j) {
let Ge = -1;
for (Xe = v; Xe < se; Xe++)
if (tt(E, Xe) === tt(b, Ge === -1 ? 0 : Xe - Ge)) {
if (Ge === -1 && (Ge = Xe), Xe - Ge + 1 === ye) return Ge * te;
} else
Ge !== -1 && (Xe -= Xe - Ge), Ge = -1;
} else
for (v + ye > se && (v = se - ye), Xe = v; Xe >= 0; Xe--) {
let Ge = !0;
for (let je = 0; je < ye; je++)
if (tt(E, Xe + je) !== tt(b, je)) {
Ge = !1;
break;
}
if (Ge) return Xe;
}
return -1;
}
a.prototype.includes = function(b, v, O) {
return this.indexOf(b, v, O) !== -1;
}, a.prototype.indexOf = function(b, v, O) {
return T(this, b, v, O, !0);
}, a.prototype.lastIndexOf = function(b, v, O) {
return T(this, b, v, O, !1);
};
function W(E, b, v, O) {
v = Number(v) || 0;
const j = E.length - v;
O ? (O = Number(O), O > j && (O = j)) : O = j;
const te = b.length;
O > te / 2 && (O = te / 2);
let se;
for (se = 0; se < O; ++se) {
const ye = parseInt(b.substr(se * 2, 2), 16);
if (Ze(ye)) return se;
E[v + se] = ye;
}
return se;
}
function L(E, b, v, O) {
return We(Oe(b, E.length - v), E, v, O);
}
function Z(E, b, v, O) {
return We(ne(b), E, v, O);
}
function D(E, b, v, O) {
return We(lt(b), E, v, O);
}
function Q(E, b, v, O) {
return We(ve(b, E.length - v), E, v, O);
}
a.prototype.write = function(b, v, O, j) {
if (v === void 0)
j = "utf8", O = this.length, v = 0;
else if (O === void 0 && typeof v == "string")
j = v, O = this.length, v = 0;
else if (isFinite(v))
v = v >>> 0, isFinite(O) ? (O = O >>> 0, j === void 0 && (j = "utf8")) : (j = O, O = void 0);
else
throw new Error(
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
);
const te = this.length - v;
if ((O === void 0 || O > te) && (O = te), b.length > 0 && (O < 0 || v < 0) || v > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
j || (j = "utf8");
let se = !1;
for (; ; )
switch (j) {
case "hex":
return W(this, b, v, O);
case "utf8":
case "utf-8":
return L(this, b, v, O);
case "ascii":
case "latin1":
case "binary":
return Z(this, b, v, O);
case "base64":
return D(this, b, v, O);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return Q(this, b, v, O);
default:
if (se) throw new TypeError("Unknown encoding: " + j);
j = ("" + j).toLowerCase(), se = !0;
}
}, a.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
function G(E, b, v) {
return b === 0 && v === E.length ? e.fromByteArray(E) : e.fromByteArray(E.slice(b, v));
}
function $(E, b, v) {
v = Math.min(E.length, v);
const O = [];
let j = b;
for (; j < v; ) {
const te = E[j];
let se = null, ye = te > 239 ? 4 : te > 223 ? 3 : te > 191 ? 2 : 1;
if (j + ye <= v) {
let tt, Xe, Ge, je;
switch (ye) {
case 1:
te < 128 && (se = te);
break;
case 2:
tt = E[j + 1], (tt & 192) === 128 && (je = (te & 31) << 6 | tt & 63, je > 127 && (se = je));
break;
case 3:
tt = E[j + 1], Xe = E[j + 2], (tt & 192) === 128 && (Xe & 192) === 128 && (je = (te & 15) << 12 | (tt & 63) << 6 | Xe & 63, je > 2047 && (je < 55296 || je > 57343) && (se = je));
break;
case 4:
tt = E[j + 1], Xe = E[j + 2], Ge = E[j + 3], (tt & 192) === 128 && (Xe & 192) === 128 && (Ge & 192) === 128 && (je = (te & 15) << 18 | (tt & 63) << 12 | (Xe & 63) << 6 | Ge & 63, je > 65535 && je < 1114112 && (se = je));
}
}
se === null ? (se = 65533, ye = 1) : se > 65535 && (se -= 65536, O.push(se >>> 10 & 1023 | 55296), se = 56320 | se & 1023), O.push(se), j += ye;
}
return k(O);
}
const ee = 4096;
function k(E) {
const b = E.length;
if (b <= ee)
return String.fromCharCode.apply(String, E);
let v = "", O = 0;
for (; O < b; )
v += String.fromCharCode.apply(
String,
E.slice(O, O += ee)
);
return v;
}
function A(E, b, v) {
let O = "";
v = Math.min(E.length, v);
for (let j = b; j < v; ++j)
O += String.fromCharCode(E[j] & 127);
return O;
}
function C(E, b, v) {
let O = "";
v = Math.min(E.length, v);
for (let j = b; j < v; ++j)
O += String.fromCharCode(E[j]);
return O;
}
function U(E, b, v) {
const O = E.length;
(!b || b < 0) && (b = 0), (!v || v < 0 || v > O) && (v = O);
let j = "";
for (let te = b; te < v; ++te)
j += Bt[E[te]];
return j;
}
function z(E, b, v) {
const O = E.slice(b, v);
let j = "";
for (let te = 0; te < O.length - 1; te += 2)
j += String.fromCharCode(O[te] + O[te + 1] * 256);
return j;
}
a.prototype.slice = function(b, v) {
const O = this.length;
b = ~~b, v = v === void 0 ? O : ~~v, b < 0 ? (b += O, b < 0 && (b = 0)) : b > O && (b = O), v < 0 ? (v += O, v < 0 && (v = 0)) : v > O && (v = O), v < b && (v = b);
const j = this.subarray(b, v);
return Object.setPrototypeOf(j, a.prototype), j;
};
function F(E, b, v) {
if (E % 1 !== 0 || E < 0) throw new RangeError("offset is not uint");
if (E + b > v) throw new RangeError("Trying to access beyond buffer length");
}
a.prototype.readUintLE = a.prototype.readUIntLE = function(b, v, O) {
b = b >>> 0, v = v >>> 0, O || F(b, v, this.length);
let j = this[b], te = 1, se = 0;
for (; ++se < v && (te *= 256); )
j += this[b + se] * te;
return j;
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(b, v, O) {
b = b >>> 0, v = v >>> 0, O || F(b, v, this.length);
let j = this[b + --v], te = 1;
for (; v > 0 && (te *= 256); )
j += this[b + --v] * te;
return j;
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(b, v) {
return b = b >>> 0, v || F(b, 1, this.length), this[b];
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(b, v) {
return b = b >>> 0, v || F(b, 2, this.length), this[b] | this[b + 1] << 8;
}, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(b, v) {
return b = b >>> 0, v || F(b, 2, this.length), this[b] << 8 | this[b + 1];
}, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), (this[b] | this[b + 1] << 8 | this[b + 2] << 16) + this[b + 3] * 16777216;
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), this[b] * 16777216 + (this[b + 1] << 16 | this[b + 2] << 8 | this[b + 3]);
}, a.prototype.readBigUInt64LE = mt(function(b) {
b = b >>> 0, et(b, "offset");
const v = this[b], O = this[b + 7];
(v === void 0 || O === void 0) && ht(b, this.length - 8);
const j = v + this[++b] * 2 ** 8 + this[++b] * 2 ** 16 + this[++b] * 2 ** 24, te = this[++b] + this[++b] * 2 ** 8 + this[++b] * 2 ** 16 + O * 2 ** 24;
return BigInt(j) + (BigInt(te) << BigInt(32));
}), a.prototype.readBigUInt64BE = mt(function(b) {
b = b >>> 0, et(b, "offset");
const v = this[b], O = this[b + 7];
(v === void 0 || O === void 0) && ht(b, this.length - 8);
const j = v * 2 ** 24 + this[++b] * 2 ** 16 + this[++b] * 2 ** 8 + this[++b], te = this[++b] * 2 ** 24 + this[++b] * 2 ** 16 + this[++b] * 2 ** 8 + O;
return (BigInt(j) << BigInt(32)) + BigInt(te);
}), a.prototype.readIntLE = function(b, v, O) {
b = b >>> 0, v = v >>> 0, O || F(b, v, this.length);
let j = this[b], te = 1, se = 0;
for (; ++se < v && (te *= 256); )
j += this[b + se] * te;
return te *= 128, j >= te && (j -= Math.pow(2, 8 * v)), j;
}, a.prototype.readIntBE = function(b, v, O) {
b = b >>> 0, v = v >>> 0, O || F(b, v, this.length);
let j = v, te = 1, se = this[b + --j];
for (; j > 0 && (te *= 256); )
se += this[b + --j] * te;
return te *= 128, se >= te && (se -= Math.pow(2, 8 * v)), se;
}, a.prototype.readInt8 = function(b, v) {
return b = b >>> 0, v || F(b, 1, this.length), this[b] & 128 ? (255 - this[b] + 1) * -1 : this[b];
}, a.prototype.readInt16LE = function(b, v) {
b = b >>> 0, v || F(b, 2, this.length);
const O = this[b] | this[b + 1] << 8;
return O & 32768 ? O | 4294901760 : O;
}, a.prototype.readInt16BE = function(b, v) {
b = b >>> 0, v || F(b, 2, this.length);
const O = this[b + 1] | this[b] << 8;
return O & 32768 ? O | 4294901760 : O;
}, a.prototype.readInt32LE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), this[b] | this[b + 1] << 8 | this[b + 2] << 16 | this[b + 3] << 24;
}, a.prototype.readInt32BE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), this[b] << 24 | this[b + 1] << 16 | this[b + 2] << 8 | this[b + 3];
}, a.prototype.readBigInt64LE = mt(function(b) {
b = b >>> 0, et(b, "offset");
const v = this[b], O = this[b + 7];
(v === void 0 || O === void 0) && ht(b, this.length - 8);
const j = this[b + 4] + this[b + 5] * 2 ** 8 + this[b + 6] * 2 ** 16 + (O << 24);
return (BigInt(j) << BigInt(32)) + BigInt(v + this[++b] * 2 ** 8 + this[++b] * 2 ** 16 + this[++b] * 2 ** 24);
}), a.prototype.readBigInt64BE = mt(function(b) {
b = b >>> 0, et(b, "offset");
const v = this[b], O = this[b + 7];
(v === void 0 || O === void 0) && ht(b, this.length - 8);
const j = (v << 24) + // Overflow
this[++b] * 2 ** 16 + this[++b] * 2 ** 8 + this[++b];
return (BigInt(j) << BigInt(32)) + BigInt(this[++b] * 2 ** 24 + this[++b] * 2 ** 16 + this[++b] * 2 ** 8 + O);
}), a.prototype.readFloatLE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), r.read(this, b, !0, 23, 4);
}, a.prototype.readFloatBE = function(b, v) {
return b = b >>> 0, v || F(b, 4, this.length), r.read(this, b, !1, 23, 4);
}, a.prototype.readDoubleLE = function(b, v) {
return b = b >>> 0, v || F(b, 8, this.length), r.read(this, b, !0, 52, 8);
}, a.prototype.readDoubleBE = function(b, v) {
return b = b >>> 0, v || F(b, 8, this.length), r.read(this, b, !1, 52, 8);
};
function J(E, b, v, O, j, te) {
if (!a.isBuffer(E)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (b > j || b < te) throw new RangeError('"value" argument is out of bounds');
if (v + O > E.length) throw new RangeError("Index out of range");
}
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(b, v, O, j) {
if (b = +b, v = v >>> 0, O = O >>> 0, !j) {
const ye = Math.pow(2, 8 * O) - 1;
J(this, b, v, O, ye, 0);
}
let te = 1, se = 0;
for (this[v] = b & 255; ++se < O && (te *= 256); )
this[v + se] = b / te & 255;
return v + O;
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(b, v, O, j) {
if (b = +b, v = v >>> 0, O = O >>> 0, !j) {
const ye = Math.pow(2, 8 * O) - 1;
J(this, b, v, O, ye, 0);
}
let te = O - 1, se = 1;
for (this[v + te] = b & 255; --te >= 0 && (se *= 256); )
this[v + te] = b / se & 255;
return v + O;
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 1, 255, 0), this[v] = b & 255, v + 1;
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 2, 65535, 0), this[v] = b & 255, this[v + 1] = b >>> 8, v + 2;
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 2, 65535, 0), this[v] = b >>> 8, this[v + 1] = b & 255, v + 2;
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 4, 4294967295, 0), this[v + 3] = b >>> 24, this[v + 2] = b >>> 16, this[v + 1] = b >>> 8, this[v] = b & 255, v + 4;
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 4, 4294967295, 0), this[v] = b >>> 24, this[v + 1] = b >>> 16, this[v + 2] = b >>> 8, this[v + 3] = b & 255, v + 4;
};
function q(E, b, v, O, j) {
at(b, O, j, E, v, 7);
let te = Number(b & BigInt(4294967295));
E[v++] = te, te = te >> 8, E[v++] = te, te = te >> 8, E[v++] = te, te = te >> 8, E[v++] = te;
let se = Number(b >> BigInt(32) & BigInt(4294967295));
return E[v++] = se, se = se >> 8, E[v++] = se, se = se >> 8, E[v++] = se, se = se >> 8, E[v++] = se, v;
}
function ae(E, b, v, O, j) {
at(b, O, j, E, v, 7);
let te = Number(b & BigInt(4294967295));
E[v + 7] = te, te = te >> 8, E[v + 6] = te, te = te >> 8, E[v + 5] = te, te = te >> 8, E[v + 4] = te;
let se = Number(b >> BigInt(32) & BigInt(4294967295));
return E[v + 3] = se, se = se >> 8, E[v + 2] = se, se = se >> 8, E[v + 1] = se, se = se >> 8, E[v] = se, v + 8;
}
a.prototype.writeBigUInt64LE = mt(function(b, v = 0) {
return q(this, b, v, BigInt(0), BigInt("0xffffffffffffffff"));
}), a.prototype.writeBigUInt64BE = mt(function(b, v = 0) {
return ae(this, b, v, BigInt(0), BigInt("0xffffffffffffffff"));
}), a.prototype.writeIntLE = function(b, v, O, j) {
if (b = +b, v = v >>> 0, !j) {
const tt = Math.pow(2, 8 * O - 1);
J(this, b, v, O, tt - 1, -tt);
}
let te = 0, se = 1, ye = 0;
for (this[v] = b & 255; ++te < O && (se *= 256); )
b < 0 && ye === 0 && this[v + te - 1] !== 0 && (ye = 1), this[v + te] = (b / se >> 0) - ye & 255;
return v + O;
}, a.prototype.writeIntBE = function(b, v, O, j) {
if (b = +b, v = v >>> 0, !j) {
const tt = Math.pow(2, 8 * O - 1);
J(this, b, v, O, tt - 1, -tt);
}
let te = O - 1, se = 1, ye = 0;
for (this[v + te] = b & 255; --te >= 0 && (se *= 256); )
b < 0 && ye === 0 && this[v + te + 1] !== 0 && (ye = 1), this[v + te] = (b / se >> 0) - ye & 255;
return v + O;
}, a.prototype.writeInt8 = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 1, 127, -128), b < 0 && (b = 255 + b + 1), this[v] = b & 255, v + 1;
}, a.prototype.writeInt16LE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 2, 32767, -32768), this[v] = b & 255, this[v + 1] = b >>> 8, v + 2;
}, a.prototype.writeInt16BE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 2, 32767, -32768), this[v] = b >>> 8, this[v + 1] = b & 255, v + 2;
}, a.prototype.writeInt32LE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 4, 2147483647, -2147483648), this[v] = b & 255, this[v + 1] = b >>> 8, this[v + 2] = b >>> 16, this[v + 3] = b >>> 24, v + 4;
}, a.prototype.writeInt32BE = function(b, v, O) {
return b = +b, v = v >>> 0, O || J(this, b, v, 4, 2147483647, -2147483648), b < 0 && (b = 4294967295 + b + 1), this[v] = b >>> 24, this[v + 1] = b >>> 16, this[v + 2] = b >>> 8, this[v + 3] = b & 255, v + 4;
}, a.prototype.writeBigInt64LE = mt(function(b, v = 0) {
return q(this, b, v, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), a.prototype.writeBigInt64BE = mt(function(b, v = 0) {
return ae(this, b, v, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
});
function oe(E, b, v, O, j, te) {
if (v + O > E.length) throw new RangeError("Index out of range");
if (v < 0) throw new RangeError("Index out of range");
}
function fe(E, b, v, O, j) {
return b = +b, v = v >>> 0, j || oe(E, b, v, 4), r.write(E, b, v, O, 23, 4), v + 4;
}
a.prototype.writeFloatLE = function(b, v, O) {
return fe(this, b, v, !0, O);
}, a.prototype.writeFloatBE = function(b, v, O) {
return fe(this, b, v, !1, O);
};
function xe(E, b, v, O, j) {
return b = +b, v = v >>> 0, j || oe(E, b, v, 8), r.write(E, b, v, O, 52, 8), v + 8;
}
a.prototype.writeDoubleLE = function(b, v, O) {
return xe(this, b, v, !0, O);
}, a.prototype.writeDoubleBE = function(b, v, O) {
return xe(this, b, v, !1, O);
}, a.prototype.copy = function(b, v, O, j) {
if (!a.isBuffer(b)) throw new TypeError("argument should be a Buffer");
if (O || (O = 0), !j && j !== 0 && (j = this.length), v >= b.length && (v = b.length), v || (v = 0), j > 0 && j < O && (j = O), j === O || b.length === 0 || this.length === 0) return 0;
if (v < 0)
throw new RangeError("targetStart out of bounds");
if (O < 0 || O >= this.length) throw new RangeError("Index out of range");
if (j < 0) throw new RangeError("sourceEnd out of bounds");
j > this.length && (j = this.length), b.length - v < j - O && (j = b.length - v + O);
const te = j - O;
return this === b && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(v, O, j) : Uint8Array.prototype.set.call(
b,
this.subarray(O, j),
v
), te;
}, a.prototype.fill = function(b, v, O, j) {
if (typeof b == "string") {
if (typeof v == "string" ? (j = v, v = 0, O = this.length) : typeof O == "string" && (j = O, O = this.length), j !== void 0 && typeof j != "string")
throw new TypeError("encoding must be a string");
if (typeof j == "string" && !a.isEncoding(j))
throw new TypeError("Unknown encoding: " + j);
if (b.length === 1) {
const se = b.charCodeAt(0);
(j === "utf8" && se < 128 || j === "latin1") && (b = se);
}
} else typeof b == "number" ? b = b & 255 : typeof b == "boolean" && (b = Number(b));
if (v < 0 || this.length < v || this.length < O)
throw new RangeError("Out of range index");
if (O <= v)
return this;
v = v >>> 0, O = O === void 0 ? this.length : O >>> 0, b || (b = 0);
let te;
if (typeof b == "number")
for (te = v; te < O; ++te)
this[te] = b;
else {
const se = a.isBuffer(b) ? b : a.from(b, j), ye = se.length;
if (ye === 0)
throw new TypeError('The value "' + b + '" is invalid for argument "value"');
for (te = 0; te < O - v; ++te)
this[te + v] = se[te % ye];
}
return this;
};
const ge = {};
function Ae(E, b, v) {
ge[E] = class extends v {
constructor() {
super(), Object.defineProperty(this, "message", {
value: b.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${E}]`, this.stack, delete this.name;
}
get code() {
return E;
}
set code(j) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: j,
writable: !0
});
}
toString() {
return `${this.name} [${E}]: ${this.message}`;
}
};
}
Ae(
"ERR_BUFFER_OUT_OF_BOUNDS",
function(E) {
return E ? `${E} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
},
RangeError
), Ae(
"ERR_INVALID_ARG_TYPE",
function(E, b) {
return `The "${E}" argument must be of type number. Received type ${typeof b}`;
},
TypeError
), Ae(
"ERR_OUT_OF_RANGE",
function(E, b, v) {
let O = `The value of "${E}" is out of range.`, j = v;
return Number.isInteger(v) && Math.abs(v) > 2 ** 32 ? j = Ee(String(v)) : typeof v == "bigint" && (j = String(v), (v > BigInt(2) ** BigInt(32) || v < -(BigInt(2) ** BigInt(32))) && (j = Ee(j)), j += "n"), O += ` It must be ${b}. Received ${j}`, O;
},
RangeError
);
function Ee(E) {
let b = "", v = E.length;
const O = E[0] === "-" ? 1 : 0;
for (; v >= O + 4; v -= 3)
b = `_${E.slice(v - 3, v)}${b}`;
return `${E.slice(0, v)}${b}`;
}
function Ve(E, b, v) {
et(b, "offset"), (E[b] === void 0 || E[b + v] === void 0) && ht(b, E.length - (v + 1));
}
function at(E, b, v, O, j, te) {
if (E > v || E < b) {
const se = typeof b == "bigint" ? "n" : "";
let ye;
throw b === 0 || b === BigInt(0) ? ye = `>= 0${se} and < 2${se} ** ${(te + 1) * 8}${se}` : ye = `>= -(2${se} ** ${(te + 1) * 8 - 1}${se}) and < 2 ** ${(te + 1) * 8 - 1}${se}`, new ge.ERR_OUT_OF_RANGE("value", ye, E);
}
Ve(O, j, te);
}
function et(E, b) {
if (typeof E != "number")
throw new ge.ERR_INVALID_ARG_TYPE(b, "number", E);
}
function ht(E, b, v) {
throw Math.floor(E) !== E ? (et(E, v), new ge.ERR_OUT_OF_RANGE("offset", "an integer", E)) : b < 0 ? new ge.ERR_BUFFER_OUT_OF_BOUNDS() : new ge.ERR_OUT_OF_RANGE(
"offset",
`>= 0 and <= ${b}`,
E
);
}
const ce = /[^+/0-9A-Za-z-_]/g;
function _e(E) {
if (E = E.split("=")[0], E = E.trim().replace(ce, ""), E.length < 2) return "";
for (; E.length % 4 !== 0; )
E = E + "=";
return E;
}
function Oe(E, b) {
b = b || 1 / 0;
let v;
const O = E.length;
let j = null;
const te = [];
for (let se = 0; se < O; ++se) {
if (v = E.charCodeAt(se), v > 55295 && v < 57344) {
if (!j) {
if (v > 56319) {
(b -= 3) > -1 && te.push(239, 191, 189);
continue;
} else if (se + 1 === O) {
(b -= 3) > -1 && te.push(239, 191, 189);
continue;
}
j = v;
continue;
}
if (v < 56320) {
(b -= 3) > -1 && te.push(239, 191, 189), j = v;
continue;
}
v = (j - 55296 << 10 | v - 56320) + 65536;
} else j && (b -= 3) > -1 && te.push(239, 191, 189);
if (j = null, v < 128) {
if ((b -= 1) < 0) break;
te.push(v);
} else if (v < 2048) {
if ((b -= 2) < 0) break;
te.push(
v >> 6 | 192,
v & 63 | 128
);
} else if (v < 65536) {
if ((b -= 3) < 0) break;
te.push(
v >> 12 | 224,
v >> 6 & 63 | 128,
v & 63 | 128
);
} else if (v < 1114112) {
if ((b -= 4) < 0) break;
te.push(
v >> 18 | 240,
v >> 12 & 63 | 128,
v >> 6 & 63 | 128,
v & 63 | 128
);
} else
throw new Error("Invalid code point");
}
return te;
}
function ne(E) {
const b = [];
for (let v = 0; v < E.length; ++v)
b.push(E.charCodeAt(v) & 255);
return b;
}
function ve(E, b) {
let v, O, j;
const te = [];
for (let se = 0; se < E.length && !((b -= 2) < 0); ++se)
v = E.charCodeAt(se), O = v >> 8, j = v % 256, te.push(j), te.push(O);
return te;
}
function lt(E) {
return e.toByteArray(_e(E));
}
function We(E, b, v, O) {
let j;
for (j = 0; j < O && !(j + v >= b.length || j >= E.length); ++j)
b[j + v] = E[j];
return j;
}
function Le(E, b) {
return E instanceof b || E != null && E.constructor != null && E.constructor.name != null && E.constructor.name === b.name;
}
function Ze(E) {
return E !== E;
}
const Bt = function() {
const E = "0123456789abcdef", b = new Array(256);
for (let v = 0; v < 16; ++v) {
const O = v * 16;
for (let j = 0; j < 16; ++j)
b[O + j] = E[v] + E[j];
}
return b;
}();
function mt(E) {
return typeof BigInt > "u" ? Vt : E;
}
function Vt() {
throw new Error("BigInt not supported");
}
}(Cf)), Cf;
}
var qe = { exports: {} }, vt = qe.exports = {}, Jr, Qr;
function z0() {
throw new Error("setTimeout has not been defined");
}
function W0() {
throw new Error("clearTimeout has not been defined");
}
(function() {
try {
typeof setTimeout == "function" ? Jr = setTimeout : Jr = z0;
} catch {
Jr = z0;
}
try {
typeof clearTimeout == "function" ? Qr = clearTimeout : Qr = W0;
} catch {
Qr = W0;
}
})();
function XS(t) {
if (Jr === setTimeout)
return setTimeout(t, 0);
if ((Jr === z0 || !Jr) && setTimeout)
return Jr = setTimeout, setTimeout(t, 0);
try {
return Jr(t, 0);
} catch {
try {
return Jr.call(null, t, 0);
} catch {
return Jr.call(this, t, 0);
}
}
}
function p8(t) {
if (Qr === clearTimeout)
return clearTimeout(t);
if ((Qr === W0 || !Qr) && clearTimeout)
return Qr = clearTimeout, clearTimeout(t);
try {
return Qr(t);
} catch {
try {
return Qr.call(null, t);
} catch {
return Qr.call(this, t);
}
}
}
var En = [], Ys = !1, Si, Ul = -1;
function g8() {
!Ys || !Si || (Ys = !1, Si.length ? En = Si.concat(En) : Ul = -1, En.length && KS());
}
function KS() {
if (!Ys) {
var t = XS(g8);
Ys = !0;
for (var e = En.length; e; ) {
for (Si = En, En = []; ++Ul < e; )
Si && Si[Ul].run();
Ul = -1, e = En.length;
}
Si = null, Ys = !1, p8(t);
}
}
vt.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];
En.push(new ZS(t, e)), En.length === 1 && !Ys && XS(KS);
};
function ZS(t, e) {
this.fun = t, this.array = e;
}
ZS.prototype.run = function() {
this.fun.apply(null, this.array);
};
vt.title = "browser";
vt.browser = !0;
vt.env = {};
vt.argv = [];
vt.version = "";
vt.versions = {};
function Cn() {
}
vt.on = Cn;
vt.addListener = Cn;
vt.once = Cn;
vt.off = Cn;
vt.removeListener = Cn;
vt.removeAllListeners = Cn;
vt.emit = Cn;
vt.prependListener = Cn;
vt.prependOnceListener = Cn;
vt.listeners = function(t) {
return [];
};
vt.binding = function(t) {
throw new Error("process.binding is not supported");
};
vt.cwd = function() {
return "/";
};
vt.chdir = function(t) {
throw new Error("process.chdir is not supported");
};
vt.umask = function() {
return 0;
};
function Xi() {
}
var GS = (
/** @type {boolean} */
qe.exports.browser
), YS = Xi, JS = (
/** @type {Function} */
qe.exports.binding
), QS = Xi, e6 = 1, t6 = {}, r6 = Xi, n6 = Xi, i6 = Xi, s6 = Xi, o6 = Xi, a6 = "browser", l6 = "browser", u6 = "browser", c6 = (
/** @type {string[]} */
[]
), m8 = {
nextTick: qe.exports.nextTick,
title: qe.exports.title,
browser: GS,
env: qe.exports.env,
argv: qe.exports.argv,
version: qe.exports.version,
versions: qe.exports.versions,
on: qe.exports.on,
addListener: qe.exports.addListener,
once: qe.exports.once,
off: qe.exports.off,
removeListener: qe.exports.removeListener,
removeAllListeners: qe.exports.removeAllListeners,
emit: qe.exports.emit,
emitWarning: YS,
prependListener: qe.exports.prependListener,
prependOnceListener: qe.exports.prependOnceListener,
listeners: qe.exports.listeners,
binding: JS,
cwd: qe.exports.cwd,
chdir: qe.exports.chdir,
umask: qe.exports.umask,
exit: QS,
pid: e6,
features: t6,
kill: r6,
dlopen: n6,
uptime: i6,
memoryUsage: s6,
uvCounters: o6,
platform: a6,
arch: l6,
execPath: u6,
execArgv: c6
}, b8 = qe.exports.addListener, y8 = qe.exports.argv, v8 = qe.exports.chdir, _8 = qe.exports.cwd, w8 = qe.exports.emit, x8 = qe.exports.env, S8 = qe.exports.listeners, E8 = qe.exports.nextTick, M8 = qe.exports.off, A8 = qe.exports.on, R8 = qe.exports.once, T8 = qe.exports.prependListener, C8 = qe.exports.prependOnceListener, k8 = qe.exports.removeAllListeners, P8 = qe.exports.removeListener, I8 = qe.exports.title, O8 = qe.exports.umask, B8 = qe.exports.version, N8 = qe.exports.versions;
const D8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
addListener: b8,
arch: l6,
argv: y8,
binding: JS,
browser: GS,
chdir: v8,
cwd: _8,
default: m8,
dlopen: n6,
emit: w8,
emitWarning: YS,
env: x8,
execArgv: c6,
execPath: u6,
exit: QS,
features: t6,
kill: r6,
listeners: S8,
memoryUsage: s6,
nextTick: E8,
off: M8,
on: A8,
once: R8,
pid: e6,
platform: a6,
prependListener: T8,
prependOnceListener: C8,
removeAllListeners: k8,
removeListener: P8,
title: I8,
umask: O8,
uptime: i6,
uvCounters: o6,
version: B8,
versions: N8
}, Symbol.toStringTag, { value: "Module" })), q8 = /* @__PURE__ */ VS(D8);
var M1;
function L8() {
return M1 || (M1 = 1, function(t) {
Object.defineProperty(t, Symbol.toStringTag, { value: "Module" });
const e = d8(), r = q8, n = (o) => o && o.__esModule ? o : { default: o }, i = n(r), s = globalThis || void 0 || self;
Object.defineProperty(t, "Buffer", { enumerable: !0, get: () => e.Buffer }), Object.defineProperty(t, "process", { enumerable: !0, get: () => i.default }), t.global = s;
}(Tf)), Tf;
}
var Re = L8();
function lu(t, e) {
if (!t)
throw new Error(e || "loader assertion failed.");
}
const mm = (
// @ts-ignore process does not exist on browser
!!(typeof Re.process != "object" || String(Re.process) !== "[object process]" || Re.process.browser)
), A1 = typeof Re.process < "u" && Re.process.version && /v([0-9]*)/.exec(Re.process.version);
A1 && parseFloat(A1[1]);
const sl = globalThis, cs = globalThis.process || {}, $8 = globalThis.navigator || {};
function f6(t) {
var n, i;
if (typeof window < "u" && ((n = window.process) == null ? void 0 : n.type) === "renderer" || typeof Re.process < "u" && ((i = Re.process.versions) != null && i.electron))
return !0;
const r = typeof navigator < "u" && navigator.userAgent;
return !!(r && r.indexOf("Electron") >= 0);
}
function Ki() {
var e;
return !// @ts-expect-error
(typeof Re.process == "object" && String(Re.process) === "[object process]" && !((e = Re.process) != null && e.browser)) || f6();
}
function F8(t) {
return Ki() ? f6() ? "Electron" : ($8.userAgent || "").indexOf("Edge") > -1 ? "Edge" : globalThis.chrome ? "Chrome" : globalThis.safari ? "Safari" : globalThis.mozInnerScreenX ? "Firefox" : "Unknown" : "Node";
}
const h6 = "4.1.0";
function U8(t) {
try {
const e = window[t], r = "__storage_test__";
retur