taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
1,165 lines • 969 kB
JavaScript
import { d as commonjsGlobal, p as process$1, e as Buffer } from "./index-DvVXAaWp.js";
import { c as commonjsRequire } from "./_commonjs-dynamic-modules-BpilXLfW.js";
var core$1 = { exports: {} }, cryptoBrowserify = {}, browser$b = { exports: {} }, safeBuffer$2 = { exports: {} }, dist = {}, hasRequiredDist;
function requireDist() {
return hasRequiredDist || (hasRequiredDist = 1, function(_) {
Object.defineProperties(_, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
var B = {}, I = {};
I.byteLength = d, I.toByteArray = g, I.fromByteArray = S;
for (var c = [], q = [], a = typeof Uint8Array < "u" ? Uint8Array : Array, w = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", y = 0, p = w.length; y < p; ++y)
c[y] = w[y], q[w.charCodeAt(y)] = y;
q[45] = 62, q[95] = 63;
function m(E) {
var D = E.length;
if (D % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var $ = E.indexOf("=");
$ === -1 && ($ = D);
var j = $ === D ? 0 : 4 - $ % 4;
return [$, j];
}
function d(E) {
var D = m(E), $ = D[0], j = D[1];
return ($ + j) * 3 / 4 - j;
}
function b(E, D, $) {
return (D + $) * 3 / 4 - $;
}
function g(E) {
var D, $ = m(E), j = $[0], G = $[1], J = new a(b(E, j, G)), ee = 0, Z = G > 0 ? j - 4 : j, ne;
for (ne = 0; ne < Z; ne += 4)
D = q[E.charCodeAt(ne)] << 18 | q[E.charCodeAt(ne + 1)] << 12 | q[E.charCodeAt(ne + 2)] << 6 | q[E.charCodeAt(ne + 3)], J[ee++] = D >> 16 & 255, J[ee++] = D >> 8 & 255, J[ee++] = D & 255;
return G === 2 && (D = q[E.charCodeAt(ne)] << 2 | q[E.charCodeAt(ne + 1)] >> 4, J[ee++] = D & 255), G === 1 && (D = q[E.charCodeAt(ne)] << 10 | q[E.charCodeAt(ne + 1)] << 4 | q[E.charCodeAt(ne + 2)] >> 2, J[ee++] = D >> 8 & 255, J[ee++] = D & 255), J;
}
function M(E) {
return c[E >> 18 & 63] + c[E >> 12 & 63] + c[E >> 6 & 63] + c[E & 63];
}
function x(E, D, $) {
for (var j, G = [], J = D; J < $; J += 3)
j = (E[J] << 16 & 16711680) + (E[J + 1] << 8 & 65280) + (E[J + 2] & 255), G.push(M(j));
return G.join("");
}
function S(E) {
for (var D, $ = E.length, j = $ % 3, G = [], J = 16383, ee = 0, Z = $ - j; ee < Z; ee += J)
G.push(x(E, ee, ee + J > Z ? Z : ee + J));
return j === 1 ? (D = E[$ - 1], G.push(
c[D >> 2] + c[D << 4 & 63] + "=="
)) : j === 2 && (D = (E[$ - 2] << 8) + E[$ - 1], G.push(
c[D >> 10] + c[D >> 4 & 63] + c[D << 2 & 63] + "="
)), G.join("");
}
var P = {};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
P.read = function(E, D, $, j, G) {
var J, ee, Z = G * 8 - j - 1, ne = (1 << Z) - 1, l = ne >> 1, e = -7, r = $ ? G - 1 : 0, i = $ ? -1 : 1, n = E[D + r];
for (r += i, J = n & (1 << -e) - 1, n >>= -e, e += Z; e > 0; J = J * 256 + E[D + r], r += i, e -= 8)
;
for (ee = J & (1 << -e) - 1, J >>= -e, e += j; e > 0; ee = ee * 256 + E[D + r], r += i, e -= 8)
;
if (J === 0)
J = 1 - l;
else {
if (J === ne)
return ee ? NaN : (n ? -1 : 1) * (1 / 0);
ee = ee + Math.pow(2, j), J = J - l;
}
return (n ? -1 : 1) * ee * Math.pow(2, J - j);
}, P.write = function(E, D, $, j, G, J) {
var ee, Z, ne, l = J * 8 - G - 1, e = (1 << l) - 1, r = e >> 1, i = G === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, n = j ? 0 : J - 1, o = j ? 1 : -1, h = D < 0 || D === 0 && 1 / D < 0 ? 1 : 0;
for (D = Math.abs(D), isNaN(D) || D === 1 / 0 ? (Z = isNaN(D) ? 1 : 0, ee = e) : (ee = Math.floor(Math.log(D) / Math.LN2), D * (ne = Math.pow(2, -ee)) < 1 && (ee--, ne *= 2), ee + r >= 1 ? D += i / ne : D += i * Math.pow(2, 1 - r), D * ne >= 2 && (ee++, ne /= 2), ee + r >= e ? (Z = 0, ee = e) : ee + r >= 1 ? (Z = (D * ne - 1) * Math.pow(2, G), ee = ee + r) : (Z = D * Math.pow(2, r - 1) * Math.pow(2, G), ee = 0)); G >= 8; E[$ + n] = Z & 255, n += o, Z /= 256, G -= 8)
;
for (ee = ee << G | Z, l += G; l > 0; E[$ + n] = ee & 255, n += o, ee /= 256, l -= 8)
;
E[$ + n - o] |= h * 128;
};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
(function(E) {
const D = I, $ = P, j = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
E.Buffer = e, E.SlowBuffer = R, E.INSPECT_MAX_BYTES = 50;
const G = 2147483647;
E.kMaxLength = G;
const { Uint8Array: J, ArrayBuffer: ee, SharedArrayBuffer: Z } = globalThis;
e.TYPED_ARRAY_SUPPORT = ne(), !e.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 ne() {
try {
const N = new J(1), A = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(A, J.prototype), Object.setPrototypeOf(N, A), N.foo() === 42;
} catch {
return !1;
}
}
Object.defineProperty(e.prototype, "parent", {
enumerable: !0,
get: function() {
if (e.isBuffer(this))
return this.buffer;
}
}), Object.defineProperty(e.prototype, "offset", {
enumerable: !0,
get: function() {
if (e.isBuffer(this))
return this.byteOffset;
}
});
function l(N) {
if (N > G)
throw new RangeError('The value "' + N + '" is invalid for option "size"');
const A = new J(N);
return Object.setPrototypeOf(A, e.prototype), A;
}
function e(N, A, C) {
if (typeof N == "number") {
if (typeof A == "string")
throw new TypeError(
'The "string" argument must be of type string. Received type number'
);
return o(N);
}
return r(N, A, C);
}
e.poolSize = 8192;
function r(N, A, C) {
if (typeof N == "string")
return h(N, A);
if (ee.isView(N))
return f(N);
if (N == null)
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof N
);
if (_e(N, ee) || N && _e(N.buffer, ee) || typeof Z < "u" && (_e(N, Z) || N && _e(N.buffer, Z)))
return t(N, A, C);
if (typeof N == "number")
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
);
const z = N.valueOf && N.valueOf();
if (z != null && z !== N)
return e.from(z, A, C);
const X = s(N);
if (X) return X;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof N[Symbol.toPrimitive] == "function")
return e.from(N[Symbol.toPrimitive]("string"), A, C);
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof N
);
}
e.from = function(N, A, C) {
return r(N, A, C);
}, Object.setPrototypeOf(e.prototype, J.prototype), Object.setPrototypeOf(e, J);
function i(N) {
if (typeof N != "number")
throw new TypeError('"size" argument must be of type number');
if (N < 0)
throw new RangeError('The value "' + N + '" is invalid for option "size"');
}
function n(N, A, C) {
return i(N), N <= 0 ? l(N) : A !== void 0 ? typeof C == "string" ? l(N).fill(A, C) : l(N).fill(A) : l(N);
}
e.alloc = function(N, A, C) {
return n(N, A, C);
};
function o(N) {
return i(N), l(N < 0 ? 0 : v(N) | 0);
}
e.allocUnsafe = function(N) {
return o(N);
}, e.allocUnsafeSlow = function(N) {
return o(N);
};
function h(N, A) {
if ((typeof A != "string" || A === "") && (A = "utf8"), !e.isEncoding(A))
throw new TypeError("Unknown encoding: " + A);
const C = O(N, A) | 0;
let z = l(C);
const X = z.write(N, A);
return X !== C && (z = z.slice(0, X)), z;
}
function u(N) {
const A = N.length < 0 ? 0 : v(N.length) | 0, C = l(A);
for (let z = 0; z < A; z += 1)
C[z] = N[z] & 255;
return C;
}
function f(N) {
if (_e(N, J)) {
const A = new J(N);
return t(A.buffer, A.byteOffset, A.byteLength);
}
return u(N);
}
function t(N, A, C) {
if (A < 0 || N.byteLength < A)
throw new RangeError('"offset" is outside of buffer bounds');
if (N.byteLength < A + (C || 0))
throw new RangeError('"length" is outside of buffer bounds');
let z;
return A === void 0 && C === void 0 ? z = new J(N) : C === void 0 ? z = new J(N, A) : z = new J(N, A, C), Object.setPrototypeOf(z, e.prototype), z;
}
function s(N) {
if (e.isBuffer(N)) {
const A = v(N.length) | 0, C = l(A);
return C.length === 0 || N.copy(C, 0, 0, A), C;
}
if (N.length !== void 0)
return typeof N.length != "number" || je(N.length) ? l(0) : u(N);
if (N.type === "Buffer" && Array.isArray(N.data))
return u(N.data);
}
function v(N) {
if (N >= G)
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + G.toString(16) + " bytes");
return N | 0;
}
function R(N) {
return +N != N && (N = 0), e.alloc(+N);
}
e.isBuffer = function(A) {
return A != null && A._isBuffer === !0 && A !== e.prototype;
}, e.compare = function(A, C) {
if (_e(A, J) && (A = e.from(A, A.offset, A.byteLength)), _e(C, J) && (C = e.from(C, C.offset, C.byteLength)), !e.isBuffer(A) || !e.isBuffer(C))
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
);
if (A === C) return 0;
let z = A.length, X = C.length;
for (let fe = 0, Q = Math.min(z, X); fe < Q; ++fe)
if (A[fe] !== C[fe]) {
z = A[fe], X = C[fe];
break;
}
return z < X ? -1 : X < z ? 1 : 0;
}, e.isEncoding = function(A) {
switch (String(A).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;
}
}, e.concat = function(A, C) {
if (!Array.isArray(A))
throw new TypeError('"list" argument must be an Array of Buffers');
if (A.length === 0)
return e.alloc(0);
let z;
if (C === void 0)
for (C = 0, z = 0; z < A.length; ++z)
C += A[z].length;
const X = e.allocUnsafe(C);
let fe = 0;
for (z = 0; z < A.length; ++z) {
let Q = A[z];
if (_e(Q, J))
fe + Q.length > X.length ? (e.isBuffer(Q) || (Q = e.from(Q)), Q.copy(X, fe)) : J.prototype.set.call(
X,
Q,
fe
);
else if (e.isBuffer(Q))
Q.copy(X, fe);
else
throw new TypeError('"list" argument must be an Array of Buffers');
fe += Q.length;
}
return X;
};
function O(N, A) {
if (e.isBuffer(N))
return N.length;
if (ee.isView(N) || _e(N, ee))
return N.byteLength;
if (typeof N != "string")
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof N
);
const C = N.length, z = arguments.length > 2 && arguments[2] === !0;
if (!z && C === 0) return 0;
let X = !1;
for (; ; )
switch (A) {
case "ascii":
case "latin1":
case "binary":
return C;
case "utf8":
case "utf-8":
return Ue(N).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return C * 2;
case "hex":
return C >>> 1;
case "base64":
return ze(N).length;
default:
if (X)
return z ? -1 : Ue(N).length;
A = ("" + A).toLowerCase(), X = !0;
}
}
e.byteLength = O;
function K(N, A, C) {
let z = !1;
if ((A === void 0 || A < 0) && (A = 0), A > this.length || ((C === void 0 || C > this.length) && (C = this.length), C <= 0) || (C >>>= 0, A >>>= 0, C <= A))
return "";
for (N || (N = "utf8"); ; )
switch (N) {
case "hex":
return $e(this, A, C);
case "utf8":
case "utf-8":
return ie(this, A, C);
case "ascii":
return se(this, A, C);
case "latin1":
case "binary":
return te(this, A, C);
case "base64":
return Se(this, A, C);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return ae(this, A, C);
default:
if (z) throw new TypeError("Unknown encoding: " + N);
N = (N + "").toLowerCase(), z = !0;
}
}
e.prototype._isBuffer = !0;
function U(N, A, C) {
const z = N[A];
N[A] = N[C], N[C] = z;
}
e.prototype.swap16 = function() {
const A = this.length;
if (A % 2 !== 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let C = 0; C < A; C += 2)
U(this, C, C + 1);
return this;
}, e.prototype.swap32 = function() {
const A = this.length;
if (A % 4 !== 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let C = 0; C < A; C += 4)
U(this, C, C + 3), U(this, C + 1, C + 2);
return this;
}, e.prototype.swap64 = function() {
const A = this.length;
if (A % 8 !== 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let C = 0; C < A; C += 8)
U(this, C, C + 7), U(this, C + 1, C + 6), U(this, C + 2, C + 5), U(this, C + 3, C + 4);
return this;
}, e.prototype.toString = function() {
const A = this.length;
return A === 0 ? "" : arguments.length === 0 ? ie(this, 0, A) : K.apply(this, arguments);
}, e.prototype.toLocaleString = e.prototype.toString, e.prototype.equals = function(A) {
if (!e.isBuffer(A)) throw new TypeError("Argument must be a Buffer");
return this === A ? !0 : e.compare(this, A) === 0;
}, e.prototype.inspect = function() {
let A = "";
const C = E.INSPECT_MAX_BYTES;
return A = this.toString("hex", 0, C).replace(/(.{2})/g, "$1 ").trim(), this.length > C && (A += " ... "), "<Buffer " + A + ">";
}, j && (e.prototype[j] = e.prototype.inspect), e.prototype.compare = function(A, C, z, X, fe) {
if (_e(A, J) && (A = e.from(A, A.offset, A.byteLength)), !e.isBuffer(A))
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof A
);
if (C === void 0 && (C = 0), z === void 0 && (z = A ? A.length : 0), X === void 0 && (X = 0), fe === void 0 && (fe = this.length), C < 0 || z > A.length || X < 0 || fe > this.length)
throw new RangeError("out of range index");
if (X >= fe && C >= z)
return 0;
if (X >= fe)
return -1;
if (C >= z)
return 1;
if (C >>>= 0, z >>>= 0, X >>>= 0, fe >>>= 0, this === A) return 0;
let Q = fe - X, le = z - C;
const Ce = Math.min(Q, le), ue = this.slice(X, fe), pe = A.slice(C, z);
for (let Te = 0; Te < Ce; ++Te)
if (ue[Te] !== pe[Te]) {
Q = ue[Te], le = pe[Te];
break;
}
return Q < le ? -1 : le < Q ? 1 : 0;
};
function T(N, A, C, z, X) {
if (N.length === 0) return -1;
if (typeof C == "string" ? (z = C, C = 0) : C > 2147483647 ? C = 2147483647 : C < -2147483648 && (C = -2147483648), C = +C, je(C) && (C = X ? 0 : N.length - 1), C < 0 && (C = N.length + C), C >= N.length) {
if (X) return -1;
C = N.length - 1;
} else if (C < 0)
if (X) C = 0;
else return -1;
if (typeof A == "string" && (A = e.from(A, z)), e.isBuffer(A))
return A.length === 0 ? -1 : F(N, A, C, z, X);
if (typeof A == "number")
return A = A & 255, typeof J.prototype.indexOf == "function" ? X ? J.prototype.indexOf.call(N, A, C) : J.prototype.lastIndexOf.call(N, A, C) : F(N, [A], C, z, X);
throw new TypeError("val must be string, number or Buffer");
}
function F(N, A, C, z, X) {
let fe = 1, Q = N.length, le = A.length;
if (z !== void 0 && (z = String(z).toLowerCase(), z === "ucs2" || z === "ucs-2" || z === "utf16le" || z === "utf-16le")) {
if (N.length < 2 || A.length < 2)
return -1;
fe = 2, Q /= 2, le /= 2, C /= 2;
}
function Ce(pe, Te) {
return fe === 1 ? pe[Te] : pe.readUInt16BE(Te * fe);
}
let ue;
if (X) {
let pe = -1;
for (ue = C; ue < Q; ue++)
if (Ce(N, ue) === Ce(A, pe === -1 ? 0 : ue - pe)) {
if (pe === -1 && (pe = ue), ue - pe + 1 === le) return pe * fe;
} else
pe !== -1 && (ue -= ue - pe), pe = -1;
} else
for (C + le > Q && (C = Q - le), ue = C; ue >= 0; ue--) {
let pe = !0;
for (let Te = 0; Te < le; Te++)
if (Ce(N, ue + Te) !== Ce(A, Te)) {
pe = !1;
break;
}
if (pe) return ue;
}
return -1;
}
e.prototype.includes = function(A, C, z) {
return this.indexOf(A, C, z) !== -1;
}, e.prototype.indexOf = function(A, C, z) {
return T(this, A, C, z, !0);
}, e.prototype.lastIndexOf = function(A, C, z) {
return T(this, A, C, z, !1);
};
function H(N, A, C, z) {
C = Number(C) || 0;
const X = N.length - C;
z ? (z = Number(z), z > X && (z = X)) : z = X;
const fe = A.length;
z > fe / 2 && (z = fe / 2);
let Q;
for (Q = 0; Q < z; ++Q) {
const le = parseInt(A.substr(Q * 2, 2), 16);
if (je(le)) return Q;
N[C + Q] = le;
}
return Q;
}
function V(N, A, C, z) {
return ce(Ue(A, N.length - C), N, C, z);
}
function W(N, A, C, z) {
return ce(be(A), N, C, z);
}
function L(N, A, C, z) {
return ce(ze(A), N, C, z);
}
function Y(N, A, C, z) {
return ce(Ee(A, N.length - C), N, C, z);
}
e.prototype.write = function(A, C, z, X) {
if (C === void 0)
X = "utf8", z = this.length, C = 0;
else if (z === void 0 && typeof C == "string")
X = C, z = this.length, C = 0;
else if (isFinite(C))
C = C >>> 0, isFinite(z) ? (z = z >>> 0, X === void 0 && (X = "utf8")) : (X = z, z = void 0);
else
throw new Error(
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
);
const fe = this.length - C;
if ((z === void 0 || z > fe) && (z = fe), A.length > 0 && (z < 0 || C < 0) || C > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
X || (X = "utf8");
let Q = !1;
for (; ; )
switch (X) {
case "hex":
return H(this, A, C, z);
case "utf8":
case "utf-8":
return V(this, A, C, z);
case "ascii":
case "latin1":
case "binary":
return W(this, A, C, z);
case "base64":
return L(this, A, C, z);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return Y(this, A, C, z);
default:
if (Q) throw new TypeError("Unknown encoding: " + X);
X = ("" + X).toLowerCase(), Q = !0;
}
}, e.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
function Se(N, A, C) {
return A === 0 && C === N.length ? D.fromByteArray(N) : D.fromByteArray(N.slice(A, C));
}
function ie(N, A, C) {
C = Math.min(N.length, C);
const z = [];
let X = A;
for (; X < C; ) {
const fe = N[X];
let Q = null, le = fe > 239 ? 4 : fe > 223 ? 3 : fe > 191 ? 2 : 1;
if (X + le <= C) {
let Ce, ue, pe, Te;
switch (le) {
case 1:
fe < 128 && (Q = fe);
break;
case 2:
Ce = N[X + 1], (Ce & 192) === 128 && (Te = (fe & 31) << 6 | Ce & 63, Te > 127 && (Q = Te));
break;
case 3:
Ce = N[X + 1], ue = N[X + 2], (Ce & 192) === 128 && (ue & 192) === 128 && (Te = (fe & 15) << 12 | (Ce & 63) << 6 | ue & 63, Te > 2047 && (Te < 55296 || Te > 57343) && (Q = Te));
break;
case 4:
Ce = N[X + 1], ue = N[X + 2], pe = N[X + 3], (Ce & 192) === 128 && (ue & 192) === 128 && (pe & 192) === 128 && (Te = (fe & 15) << 18 | (Ce & 63) << 12 | (ue & 63) << 6 | pe & 63, Te > 65535 && Te < 1114112 && (Q = Te));
}
}
Q === null ? (Q = 65533, le = 1) : Q > 65535 && (Q -= 65536, z.push(Q >>> 10 & 1023 | 55296), Q = 56320 | Q & 1023), z.push(Q), X += le;
}
return ke(z);
}
const re = 4096;
function ke(N) {
const A = N.length;
if (A <= re)
return String.fromCharCode.apply(String, N);
let C = "", z = 0;
for (; z < A; )
C += String.fromCharCode.apply(
String,
N.slice(z, z += re)
);
return C;
}
function se(N, A, C) {
let z = "";
C = Math.min(N.length, C);
for (let X = A; X < C; ++X)
z += String.fromCharCode(N[X] & 127);
return z;
}
function te(N, A, C) {
let z = "";
C = Math.min(N.length, C);
for (let X = A; X < C; ++X)
z += String.fromCharCode(N[X]);
return z;
}
function $e(N, A, C) {
const z = N.length;
(!A || A < 0) && (A = 0), (!C || C < 0 || C > z) && (C = z);
let X = "";
for (let fe = A; fe < C; ++fe)
X += ge[N[fe]];
return X;
}
function ae(N, A, C) {
const z = N.slice(A, C);
let X = "";
for (let fe = 0; fe < z.length - 1; fe += 2)
X += String.fromCharCode(z[fe] + z[fe + 1] * 256);
return X;
}
e.prototype.slice = function(A, C) {
const z = this.length;
A = ~~A, C = C === void 0 ? z : ~~C, A < 0 ? (A += z, A < 0 && (A = 0)) : A > z && (A = z), C < 0 ? (C += z, C < 0 && (C = 0)) : C > z && (C = z), C < A && (C = A);
const X = this.subarray(A, C);
return Object.setPrototypeOf(X, e.prototype), X;
};
function he(N, A, C) {
if (N % 1 !== 0 || N < 0) throw new RangeError("offset is not uint");
if (N + A > C) throw new RangeError("Trying to access beyond buffer length");
}
e.prototype.readUintLE = e.prototype.readUIntLE = function(A, C, z) {
A = A >>> 0, C = C >>> 0, z || he(A, C, this.length);
let X = this[A], fe = 1, Q = 0;
for (; ++Q < C && (fe *= 256); )
X += this[A + Q] * fe;
return X;
}, e.prototype.readUintBE = e.prototype.readUIntBE = function(A, C, z) {
A = A >>> 0, C = C >>> 0, z || he(A, C, this.length);
let X = this[A + --C], fe = 1;
for (; C > 0 && (fe *= 256); )
X += this[A + --C] * fe;
return X;
}, e.prototype.readUint8 = e.prototype.readUInt8 = function(A, C) {
return A = A >>> 0, C || he(A, 1, this.length), this[A];
}, e.prototype.readUint16LE = e.prototype.readUInt16LE = function(A, C) {
return A = A >>> 0, C || he(A, 2, this.length), this[A] | this[A + 1] << 8;
}, e.prototype.readUint16BE = e.prototype.readUInt16BE = function(A, C) {
return A = A >>> 0, C || he(A, 2, this.length), this[A] << 8 | this[A + 1];
}, e.prototype.readUint32LE = e.prototype.readUInt32LE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), (this[A] | this[A + 1] << 8 | this[A + 2] << 16) + this[A + 3] * 16777216;
}, e.prototype.readUint32BE = e.prototype.readUInt32BE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), this[A] * 16777216 + (this[A + 1] << 16 | this[A + 2] << 8 | this[A + 3]);
}, e.prototype.readBigUInt64LE = qe(function(A) {
A = A >>> 0, Be(A, "offset");
const C = this[A], z = this[A + 7];
(C === void 0 || z === void 0) && Ne(A, this.length - 8);
const X = C + this[++A] * 2 ** 8 + this[++A] * 2 ** 16 + this[++A] * 2 ** 24, fe = this[++A] + this[++A] * 2 ** 8 + this[++A] * 2 ** 16 + z * 2 ** 24;
return BigInt(X) + (BigInt(fe) << BigInt(32));
}), e.prototype.readBigUInt64BE = qe(function(A) {
A = A >>> 0, Be(A, "offset");
const C = this[A], z = this[A + 7];
(C === void 0 || z === void 0) && Ne(A, this.length - 8);
const X = C * 2 ** 24 + this[++A] * 2 ** 16 + this[++A] * 2 ** 8 + this[++A], fe = this[++A] * 2 ** 24 + this[++A] * 2 ** 16 + this[++A] * 2 ** 8 + z;
return (BigInt(X) << BigInt(32)) + BigInt(fe);
}), e.prototype.readIntLE = function(A, C, z) {
A = A >>> 0, C = C >>> 0, z || he(A, C, this.length);
let X = this[A], fe = 1, Q = 0;
for (; ++Q < C && (fe *= 256); )
X += this[A + Q] * fe;
return fe *= 128, X >= fe && (X -= Math.pow(2, 8 * C)), X;
}, e.prototype.readIntBE = function(A, C, z) {
A = A >>> 0, C = C >>> 0, z || he(A, C, this.length);
let X = C, fe = 1, Q = this[A + --X];
for (; X > 0 && (fe *= 256); )
Q += this[A + --X] * fe;
return fe *= 128, Q >= fe && (Q -= Math.pow(2, 8 * C)), Q;
}, e.prototype.readInt8 = function(A, C) {
return A = A >>> 0, C || he(A, 1, this.length), this[A] & 128 ? (255 - this[A] + 1) * -1 : this[A];
}, e.prototype.readInt16LE = function(A, C) {
A = A >>> 0, C || he(A, 2, this.length);
const z = this[A] | this[A + 1] << 8;
return z & 32768 ? z | 4294901760 : z;
}, e.prototype.readInt16BE = function(A, C) {
A = A >>> 0, C || he(A, 2, this.length);
const z = this[A + 1] | this[A] << 8;
return z & 32768 ? z | 4294901760 : z;
}, e.prototype.readInt32LE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), this[A] | this[A + 1] << 8 | this[A + 2] << 16 | this[A + 3] << 24;
}, e.prototype.readInt32BE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), this[A] << 24 | this[A + 1] << 16 | this[A + 2] << 8 | this[A + 3];
}, e.prototype.readBigInt64LE = qe(function(A) {
A = A >>> 0, Be(A, "offset");
const C = this[A], z = this[A + 7];
(C === void 0 || z === void 0) && Ne(A, this.length - 8);
const X = this[A + 4] + this[A + 5] * 2 ** 8 + this[A + 6] * 2 ** 16 + (z << 24);
return (BigInt(X) << BigInt(32)) + BigInt(C + this[++A] * 2 ** 8 + this[++A] * 2 ** 16 + this[++A] * 2 ** 24);
}), e.prototype.readBigInt64BE = qe(function(A) {
A = A >>> 0, Be(A, "offset");
const C = this[A], z = this[A + 7];
(C === void 0 || z === void 0) && Ne(A, this.length - 8);
const X = (C << 24) + // Overflow
this[++A] * 2 ** 16 + this[++A] * 2 ** 8 + this[++A];
return (BigInt(X) << BigInt(32)) + BigInt(this[++A] * 2 ** 24 + this[++A] * 2 ** 16 + this[++A] * 2 ** 8 + z);
}), e.prototype.readFloatLE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), $.read(this, A, !0, 23, 4);
}, e.prototype.readFloatBE = function(A, C) {
return A = A >>> 0, C || he(A, 4, this.length), $.read(this, A, !1, 23, 4);
}, e.prototype.readDoubleLE = function(A, C) {
return A = A >>> 0, C || he(A, 8, this.length), $.read(this, A, !0, 52, 8);
}, e.prototype.readDoubleBE = function(A, C) {
return A = A >>> 0, C || he(A, 8, this.length), $.read(this, A, !1, 52, 8);
};
function Pe(N, A, C, z, X, fe) {
if (!e.isBuffer(N)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (A > X || A < fe) throw new RangeError('"value" argument is out of bounds');
if (C + z > N.length) throw new RangeError("Index out of range");
}
e.prototype.writeUintLE = e.prototype.writeUIntLE = function(A, C, z, X) {
if (A = +A, C = C >>> 0, z = z >>> 0, !X) {
const le = Math.pow(2, 8 * z) - 1;
Pe(this, A, C, z, le, 0);
}
let fe = 1, Q = 0;
for (this[C] = A & 255; ++Q < z && (fe *= 256); )
this[C + Q] = A / fe & 255;
return C + z;
}, e.prototype.writeUintBE = e.prototype.writeUIntBE = function(A, C, z, X) {
if (A = +A, C = C >>> 0, z = z >>> 0, !X) {
const le = Math.pow(2, 8 * z) - 1;
Pe(this, A, C, z, le, 0);
}
let fe = z - 1, Q = 1;
for (this[C + fe] = A & 255; --fe >= 0 && (Q *= 256); )
this[C + fe] = A / Q & 255;
return C + z;
}, e.prototype.writeUint8 = e.prototype.writeUInt8 = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 1, 255, 0), this[C] = A & 255, C + 1;
}, e.prototype.writeUint16LE = e.prototype.writeUInt16LE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 2, 65535, 0), this[C] = A & 255, this[C + 1] = A >>> 8, C + 2;
}, e.prototype.writeUint16BE = e.prototype.writeUInt16BE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 2, 65535, 0), this[C] = A >>> 8, this[C + 1] = A & 255, C + 2;
}, e.prototype.writeUint32LE = e.prototype.writeUInt32LE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 4, 4294967295, 0), this[C + 3] = A >>> 24, this[C + 2] = A >>> 16, this[C + 1] = A >>> 8, this[C] = A & 255, C + 4;
}, e.prototype.writeUint32BE = e.prototype.writeUInt32BE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 4, 4294967295, 0), this[C] = A >>> 24, this[C + 1] = A >>> 16, this[C + 2] = A >>> 8, this[C + 3] = A & 255, C + 4;
};
function oe(N, A, C, z, X) {
me(A, z, X, N, C, 7);
let fe = Number(A & BigInt(4294967295));
N[C++] = fe, fe = fe >> 8, N[C++] = fe, fe = fe >> 8, N[C++] = fe, fe = fe >> 8, N[C++] = fe;
let Q = Number(A >> BigInt(32) & BigInt(4294967295));
return N[C++] = Q, Q = Q >> 8, N[C++] = Q, Q = Q >> 8, N[C++] = Q, Q = Q >> 8, N[C++] = Q, C;
}
function we(N, A, C, z, X) {
me(A, z, X, N, C, 7);
let fe = Number(A & BigInt(4294967295));
N[C + 7] = fe, fe = fe >> 8, N[C + 6] = fe, fe = fe >> 8, N[C + 5] = fe, fe = fe >> 8, N[C + 4] = fe;
let Q = Number(A >> BigInt(32) & BigInt(4294967295));
return N[C + 3] = Q, Q = Q >> 8, N[C + 2] = Q, Q = Q >> 8, N[C + 1] = Q, Q = Q >> 8, N[C] = Q, C + 8;
}
e.prototype.writeBigUInt64LE = qe(function(A, C = 0) {
return oe(this, A, C, BigInt(0), BigInt("0xffffffffffffffff"));
}), e.prototype.writeBigUInt64BE = qe(function(A, C = 0) {
return we(this, A, C, BigInt(0), BigInt("0xffffffffffffffff"));
}), e.prototype.writeIntLE = function(A, C, z, X) {
if (A = +A, C = C >>> 0, !X) {
const Ce = Math.pow(2, 8 * z - 1);
Pe(this, A, C, z, Ce - 1, -Ce);
}
let fe = 0, Q = 1, le = 0;
for (this[C] = A & 255; ++fe < z && (Q *= 256); )
A < 0 && le === 0 && this[C + fe - 1] !== 0 && (le = 1), this[C + fe] = (A / Q >> 0) - le & 255;
return C + z;
}, e.prototype.writeIntBE = function(A, C, z, X) {
if (A = +A, C = C >>> 0, !X) {
const Ce = Math.pow(2, 8 * z - 1);
Pe(this, A, C, z, Ce - 1, -Ce);
}
let fe = z - 1, Q = 1, le = 0;
for (this[C + fe] = A & 255; --fe >= 0 && (Q *= 256); )
A < 0 && le === 0 && this[C + fe + 1] !== 0 && (le = 1), this[C + fe] = (A / Q >> 0) - le & 255;
return C + z;
}, e.prototype.writeInt8 = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 1, 127, -128), A < 0 && (A = 255 + A + 1), this[C] = A & 255, C + 1;
}, e.prototype.writeInt16LE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 2, 32767, -32768), this[C] = A & 255, this[C + 1] = A >>> 8, C + 2;
}, e.prototype.writeInt16BE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 2, 32767, -32768), this[C] = A >>> 8, this[C + 1] = A & 255, C + 2;
}, e.prototype.writeInt32LE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 4, 2147483647, -2147483648), this[C] = A & 255, this[C + 1] = A >>> 8, this[C + 2] = A >>> 16, this[C + 3] = A >>> 24, C + 4;
}, e.prototype.writeInt32BE = function(A, C, z) {
return A = +A, C = C >>> 0, z || Pe(this, A, C, 4, 2147483647, -2147483648), A < 0 && (A = 4294967295 + A + 1), this[C] = A >>> 24, this[C + 1] = A >>> 16, this[C + 2] = A >>> 8, this[C + 3] = A & 255, C + 4;
}, e.prototype.writeBigInt64LE = qe(function(A, C = 0) {
return oe(this, A, C, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), e.prototype.writeBigInt64BE = qe(function(A, C = 0) {
return we(this, A, C, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
});
function De(N, A, C, z, X, fe) {
if (C + z > N.length) throw new RangeError("Index out of range");
if (C < 0) throw new RangeError("Index out of range");
}
function de(N, A, C, z, X) {
return A = +A, C = C >>> 0, X || De(N, A, C, 4), $.write(N, A, C, z, 23, 4), C + 4;
}
e.prototype.writeFloatLE = function(A, C, z) {
return de(this, A, C, !0, z);
}, e.prototype.writeFloatBE = function(A, C, z) {
return de(this, A, C, !1, z);
};
function xe(N, A, C, z, X) {
return A = +A, C = C >>> 0, X || De(N, A, C, 8), $.write(N, A, C, z, 52, 8), C + 8;
}
e.prototype.writeDoubleLE = function(A, C, z) {
return xe(this, A, C, !0, z);
}, e.prototype.writeDoubleBE = function(A, C, z) {
return xe(this, A, C, !1, z);
}, e.prototype.copy = function(A, C, z, X) {
if (!e.isBuffer(A)) throw new TypeError("argument should be a Buffer");
if (z || (z = 0), !X && X !== 0 && (X = this.length), C >= A.length && (C = A.length), C || (C = 0), X > 0 && X < z && (X = z), X === z || A.length === 0 || this.length === 0) return 0;
if (C < 0)
throw new RangeError("targetStart out of bounds");
if (z < 0 || z >= this.length) throw new RangeError("Index out of range");
if (X < 0) throw new RangeError("sourceEnd out of bounds");
X > this.length && (X = this.length), A.length - C < X - z && (X = A.length - C + z);
const fe = X - z;
return this === A && typeof J.prototype.copyWithin == "function" ? this.copyWithin(C, z, X) : J.prototype.set.call(
A,
this.subarray(z, X),
C
), fe;
}, e.prototype.fill = function(A, C, z, X) {
if (typeof A == "string") {
if (typeof C == "string" ? (X = C, C = 0, z = this.length) : typeof z == "string" && (X = z, z = this.length), X !== void 0 && typeof X != "string")
throw new TypeError("encoding must be a string");
if (typeof X == "string" && !e.isEncoding(X))
throw new TypeError("Unknown encoding: " + X);
if (A.length === 1) {
const Q = A.charCodeAt(0);
(X === "utf8" && Q < 128 || X === "latin1") && (A = Q);
}
} else typeof A == "number" ? A = A & 255 : typeof A == "boolean" && (A = Number(A));
if (C < 0 || this.length < C || this.length < z)
throw new RangeError("Out of range index");
if (z <= C)
return this;
C = C >>> 0, z = z === void 0 ? this.length : z >>> 0, A || (A = 0);
let fe;
if (typeof A == "number")
for (fe = C; fe < z; ++fe)
this[fe] = A;
else {
const Q = e.isBuffer(A) ? A : e.from(A, X), le = Q.length;
if (le === 0)
throw new TypeError('The value "' + A + '" is invalid for argument "value"');
for (fe = 0; fe < z - C; ++fe)
this[fe + C] = Q[fe % le];
}
return this;
};
const Oe = {};
function ve(N, A, C) {
Oe[N] = class extends C {
constructor() {
super(), Object.defineProperty(this, "message", {
value: A.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${N}]`, this.stack, delete this.name;
}
get code() {
return N;
}
set code(X) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: X,
writable: !0
});
}
toString() {
return `${this.name} [${N}]: ${this.message}`;
}
};
}
ve(
"ERR_BUFFER_OUT_OF_BOUNDS",
function(N) {
return N ? `${N} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
},
RangeError
), ve(
"ERR_INVALID_ARG_TYPE",
function(N, A) {
return `The "${N}" argument must be of type number. Received type ${typeof A}`;
},
TypeError
), ve(
"ERR_OUT_OF_RANGE",
function(N, A, C) {
let z = `The value of "${N}" is out of range.`, X = C;
return Number.isInteger(C) && Math.abs(C) > 2 ** 32 ? X = Re(String(C)) : typeof C == "bigint" && (X = String(C), (C > BigInt(2) ** BigInt(32) || C < -(BigInt(2) ** BigInt(32))) && (X = Re(X)), X += "n"), z += ` It must be ${A}. Received ${X}`, z;
},
RangeError
);
function Re(N) {
let A = "", C = N.length;
const z = N[0] === "-" ? 1 : 0;
for (; C >= z + 4; C -= 3)
A = `_${N.slice(C - 3, C)}${A}`;
return `${N.slice(0, C)}${A}`;
}
function He(N, A, C) {
Be(A, "offset"), (N[A] === void 0 || N[A + C] === void 0) && Ne(A, N.length - (C + 1));
}
function me(N, A, C, z, X, fe) {
if (N > C || N < A) {
const Q = typeof A == "bigint" ? "n" : "";
let le;
throw A === 0 || A === BigInt(0) ? le = `>= 0${Q} and < 2${Q} ** ${(fe + 1) * 8}${Q}` : le = `>= -(2${Q} ** ${(fe + 1) * 8 - 1}${Q}) and < 2 ** ${(fe + 1) * 8 - 1}${Q}`, new Oe.ERR_OUT_OF_RANGE("value", le, N);
}
He(z, X, fe);
}
function Be(N, A) {
if (typeof N != "number")
throw new Oe.ERR_INVALID_ARG_TYPE(A, "number", N);
}
function Ne(N, A, C) {
throw Math.floor(N) !== N ? (Be(N, C), new Oe.ERR_OUT_OF_RANGE("offset", "an integer", N)) : A < 0 ? new Oe.ERR_BUFFER_OUT_OF_BOUNDS() : new Oe.ERR_OUT_OF_RANGE(
"offset",
`>= 0 and <= ${A}`,
N
);
}
const ye = /[^+/0-9A-Za-z-_]/g;
function Ae(N) {
if (N = N.split("=")[0], N = N.trim().replace(ye, ""), N.length < 2) return "";
for (; N.length % 4 !== 0; )
N = N + "=";
return N;
}
function Ue(N, A) {
A = A || 1 / 0;
let C;
const z = N.length;
let X = null;
const fe = [];
for (let Q = 0; Q < z; ++Q) {
if (C = N.charCodeAt(Q), C > 55295 && C < 57344) {
if (!X) {
if (C > 56319) {
(A -= 3) > -1 && fe.push(239, 191, 189);
continue;
} else if (Q + 1 === z) {
(A -= 3) > -1 && fe.push(239, 191, 189);
continue;
}
X = C;
continue;
}
if (C < 56320) {
(A -= 3) > -1 && fe.push(239, 191, 189), X = C;
continue;
}
C = (X - 55296 << 10 | C - 56320) + 65536;
} else X && (A -= 3) > -1 && fe.push(239, 191, 189);
if (X = null, C < 128) {
if ((A -= 1) < 0) break;
fe.push(C);
} else if (C < 2048) {
if ((A -= 2) < 0) break;
fe.push(
C >> 6 | 192,
C & 63 | 128
);
} else if (C < 65536) {
if ((A -= 3) < 0) break;
fe.push(
C >> 12 | 224,
C >> 6 & 63 | 128,
C & 63 | 128
);
} else if (C < 1114112) {
if ((A -= 4) < 0) break;
fe.push(
C >> 18 | 240,
C >> 12 & 63 | 128,
C >> 6 & 63 | 128,
C & 63 | 128
);
} else
throw new Error("Invalid code point");
}
return fe;
}
function be(N) {
const A = [];
for (let C = 0; C < N.length; ++C)
A.push(N.charCodeAt(C) & 255);
return A;
}
function Ee(N, A) {
let C, z, X;
const fe = [];
for (let Q = 0; Q < N.length && !((A -= 2) < 0); ++Q)
C = N.charCodeAt(Q), z = C >> 8, X = C % 256, fe.push(X), fe.push(z);
return fe;
}
function ze(N) {
return D.toByteArray(Ae(N));
}
function ce(N, A, C, z) {
let X;
for (X = 0; X < z && !(X + C >= A.length || X >= N.length); ++X)
A[X + C] = N[X];
return X;
}
function _e(N, A) {
return N instanceof A || N != null && N.constructor != null && N.constructor.name != null && N.constructor.name === A.name;
}
function je(N) {
return N !== N;
}
const ge = function() {
const N = "0123456789abcdef", A = new Array(256);
for (let C = 0; C < 16; ++C) {
const z = C * 16;
for (let X = 0; X < 16; ++X)
A[z + X] = N[C] + N[X];
}
return A;
}();
function qe(N) {
return typeof BigInt > "u" ? Ke : N;
}
function Ke() {
throw new Error("BigInt not supported");
}
})(B);
const k = B.Buffer;
_.Blob = B.Blob, _.BlobOptions = B.BlobOptions, _.Buffer = B.Buffer, _.File = B.File, _.FileOptions = B.FileOptions, _.INSPECT_MAX_BYTES = B.INSPECT_MAX_BYTES, _.SlowBuffer = B.SlowBuffer, _.TranscodeEncoding = B.TranscodeEncoding, _.atob = B.atob, _.btoa = B.btoa, _.constants = B.constants, _.default = k, _.isAscii = B.isAscii, _.isUtf8 = B.isUtf8, _.kMaxLength = B.kMaxLength, _.kStringMaxLength = B.kStringMaxLength, _.resolveObjectURL = B.resolveObjectURL, _.transcode = B.transcode;
}(dist)), dist;
}
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var hasRequiredSafeBuffer$2;
function requireSafeBuffer$2() {
return hasRequiredSafeBuffer$2 || (hasRequiredSafeBuffer$2 = 1, function(_, B) {
var I = requireDist(), c = I.Buffer;
function q(w, y) {
for (var p in w)
y[p] = w[p];
}
c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? _.exports = I : (q(I, B), B.Buffer = a);
function a(w, y, p) {
return c(w, y, p);
}
a.prototype = Object.create(c.prototype), q(c, a), a.from = function(w, y, p) {
if (typeof w == "number")
throw new TypeError("Argument must not be a number");
return c(w, y, p);
}, a.alloc = function(w, y, p) {
if (typeof w != "number")
throw new TypeError("Argument must be a number");
var m = c(w);
return y !== void 0 ? typeof p == "string" ? m.fill(y, p) : m.fill(y) : m.fill(0), m;
}, a.allocUnsafe = function(w) {
if (typeof w != "number")
throw new TypeError("Argument must be a number");
return c(w);
}, a.allocUnsafeSlow = function(w) {
if (typeof w != "number")
throw new TypeError("Argument must be a number");
return I.SlowBuffer(w);
};
}(safeBuffer$2, safeBuffer$2.exports)), safeBuffer$2.exports;
}
var hasRequiredBrowser$b;
function requireBrowser$b() {
if (hasRequiredBrowser$b) return browser$b.exports;
hasRequiredBrowser$b = 1;
var _ = 65536, B = 4294967295;
function I() {
throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`);
}
var c = requireSafeBuffer$2().Buffer, q = commonjsGlobal.crypto || commonjsGlobal.msCrypto;
q && q.getRandomValues ? browser$b.exports = a : browser$b.exports = I;
function a(w, y) {
if (w > B) throw new RangeError("requested too many random bytes");
var p = c.allocUnsafe(w);
if (w > 0)
if (w > _)
for (var m = 0; m < w; m += _)
q.getRandomValues(p.slice(m, m + _));
else
q.getRandomValues(p);
return typeof y == "function" ? process$1.nextTick(function() {
y(null, p);
}) : p;
}
return browser$b.exports;
}
var inherits_browser = { exports: {} }, hasRequiredInherits_browser;
function requireInherits_browser() {
return hasRequiredInherits_browser || (hasRequiredInherits_browser = 1, typeof Object.create == "function" ? inherits_browser.exports = function(B, I) {
I && (B.super_ = I, B.prototype = Object.create(I.prototype, {
constructor: {
value: B,
enumerable: !1,
writable: !0,
configurable: !0
}
}));
} : inherits_browser.exports = function(B, I) {
if (I) {
B.super_ = I;
var c = function() {
};
c.prototype = I.prototype, B.prototype = new c(), B.prototype.constructor = B;
}
}), inherits_browser.exports;
}
var events = { exports: {} }, hasRequiredEvents;
function requireEvents() {
if (hasRequiredEvents) return events.exports;
hasRequiredEvents = 1;
var _ = typeof Reflect == "object" ? Reflect : null, B = _ && typeof _.apply == "function" ? _.apply : function(j, G, J) {
return Function.prototype.apply.call(j, G, J);
}, I;
_ && typeof _.ownKeys == "function" ? I = _.ownKeys : Object.getOwnPropertySymbols ? I = function(j) {
return Object.getOwnPropertyNames(j).concat(Object.getOwnPropertySymbols(j));
} : I = function(j) {
return Object.getOwnPropertyNames(j);
};
function c($) {
console && console.warn && console.warn($);
}
var q = Number.isNaN || function(j) {
return j !== j;
};
function a() {
a.init.call(this);
}
events.exports = a, events.exports.once = k, a.EventEmitter = a, a.prototype._events = void 0, a.prototype._eventsCount = 0, a.prototype._maxListeners = void 0;
var w = 10;
function y($) {
if (typeof $ != "function")
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof $);
}
Object.defineProperty(a, "defaultMaxListeners", {
enumerable: !0,
get: function() {
return w;
},
set: function($) {
if (typeof $ != "number" || $ < 0 || q($))
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + $ + ".");
w = $;
}
}), a.init = function() {
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
}, a.prototype.setMaxListeners = function(j) {
if (typeof j != "number" || j < 0 || q(j))
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + j + ".");
return this._maxListeners = j, this;
};
function p($) {
return $._maxListeners === void 0 ? a.defaultMaxListeners : $._maxListeners;
}
a.prototype.getMaxListeners = function() {
return p(this);
}, a.prototype.emit = function(j) {
for (var G = [], J = 1; J < arguments.length; J++) G.push(arguments[J]);
var ee = j === "error", Z = this._events;
if (Z !== void 0)
ee = ee && Z.error === void 0;
else if (!ee)
return !1;
if (ee) {
var ne;
if (G.length > 0 && (ne = G[0]), ne instanceof Error)
throw ne;
var l = new Error("Unhandled error." + (ne ? " (" + ne.message + ")" : ""));
throw l.co