Files
427e7578-d7bf-49c8-aee9-2dd…/dist/public/assets/index-ChbWTil4.js
yannickschuchmann b936095286 Add implementation
2026-03-08 18:01:28 +00:00

2544 lines
107 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { r as de } from "./index-I8cR0Dsm.js";
var vr = {};
function _r(e) {
let t = "pending", r, n;
const o = e.then((s) => {
t = "success", r = s;
}, (s) => {
t = "error", n = s;
});
return { promise: e, read() {
switch (t) {
case "pending":
throw o;
case "error":
throw n;
case "success":
return r;
}
} };
}
const Cr = de.createContext(null);
function Ir() {
const e = de.useContext(Cr);
if (!e) throw new Error("Repo was not found on RepoContext.");
return e;
}
const Er = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
function At(e) {
return typeof e == "string" && Er.test(e);
}
function Hr(e) {
if (!At(e)) throw TypeError("Invalid UUID");
let t;
const r = new Uint8Array(16);
return r[0] = (t = parseInt(e.slice(0, 8), 16)) >>> 24, r[1] = t >>> 16 & 255, r[2] = t >>> 8 & 255, r[3] = t & 255, r[4] = (t = parseInt(e.slice(9, 13), 16)) >>> 8, r[5] = t & 255, r[6] = (t = parseInt(e.slice(14, 18), 16)) >>> 8, r[7] = t & 255, r[8] = (t = parseInt(e.slice(19, 23), 16)) >>> 8, r[9] = t & 255, r[10] = (t = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, r[11] = t / 4294967296 & 255, r[12] = t >>> 24 & 255, r[13] = t >>> 16 & 255, r[14] = t >>> 8 & 255, r[15] = t & 255, r;
}
function St(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var le = {}, W = {}, te = {}, $e = {}, Ce = {}, xt;
function Ur() {
return xt || (xt = 1, Object.defineProperty(Ce, "__esModule", { value: true }), Ce.crypto = void 0, Ce.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Ce;
}
var Ot;
function sr() {
return Ot || (Ot = 1, (function(e) {
Object.defineProperty(e, "__esModule", { value: true }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = r, e.anumber = n, e.abytes = o, e.ahash = s, e.aexists = i, e.aoutput = l, e.u8 = c, e.u32 = w, e.clean = h, e.createView = d, e.rotr = g, e.rotl = b, e.byteSwap = p, e.byteSwap32 = S, e.bytesToHex = R, e.hexToBytes = O, e.asyncLoop = D, e.utf8ToBytes = L, e.bytesToUtf8 = E, e.toBytes = U, e.kdfInputToBytes = M, e.concatBytes = z, e.checkOpts = a, e.createHasher = v, e.createOptHasher = I, e.createXOFer = _, e.randomBytes = T;
const t = Ur();
function r(u) {
return u instanceof Uint8Array || ArrayBuffer.isView(u) && u.constructor.name === "Uint8Array";
}
function n(u) {
if (!Number.isSafeInteger(u) || u < 0) throw new Error("positive integer expected, got " + u);
}
function o(u, ...H) {
if (!r(u)) throw new Error("Uint8Array expected");
if (H.length > 0 && !H.includes(u.length)) throw new Error("Uint8Array expected of length " + H + ", got length=" + u.length);
}
function s(u) {
if (typeof u != "function" || typeof u.create != "function") throw new Error("Hash should be wrapped by utils.createHasher");
n(u.outputLen), n(u.blockLen);
}
function i(u, H = true) {
if (u.destroyed) throw new Error("Hash instance has been destroyed");
if (H && u.finished) throw new Error("Hash#digest() has already been called");
}
function l(u, H) {
o(u);
const B = H.outputLen;
if (u.length < B) throw new Error("digestInto() expects output buffer of length at least " + B);
}
function c(u) {
return new Uint8Array(u.buffer, u.byteOffset, u.byteLength);
}
function w(u) {
return new Uint32Array(u.buffer, u.byteOffset, Math.floor(u.byteLength / 4));
}
function h(...u) {
for (let H = 0; H < u.length; H++) u[H].fill(0);
}
function d(u) {
return new DataView(u.buffer, u.byteOffset, u.byteLength);
}
function g(u, H) {
return u << 32 - H | u >>> H;
}
function b(u, H) {
return u << H | u >>> 32 - H >>> 0;
}
e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
function p(u) {
return u << 24 & 4278190080 | u << 8 & 16711680 | u >>> 8 & 65280 | u >>> 24 & 255;
}
e.swap8IfBE = e.isLE ? (u) => u : (u) => p(u), e.byteSwapIfBE = e.swap8IfBE;
function S(u) {
for (let H = 0; H < u.length; H++) u[H] = p(u[H]);
return u;
}
e.swap32IfBE = e.isLE ? (u) => u : S;
const C = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", F = Array.from({ length: 256 }, (u, H) => H.toString(16).padStart(2, "0"));
function R(u) {
if (o(u), C) return u.toHex();
let H = "";
for (let B = 0; B < u.length; B++) H += F[u[B]];
return H;
}
const m = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
function P(u) {
if (u >= m._0 && u <= m._9) return u - m._0;
if (u >= m.A && u <= m.F) return u - (m.A - 10);
if (u >= m.a && u <= m.f) return u - (m.a - 10);
}
function O(u) {
if (typeof u != "string") throw new Error("hex string expected, got " + typeof u);
if (C) return Uint8Array.fromHex(u);
const H = u.length, B = H / 2;
if (H % 2) throw new Error("hex string expected, got unpadded hex of length " + H);
const V = new Uint8Array(B);
for (let G = 0, ee = 0; G < B; G++, ee += 2) {
const Ae = P(u.charCodeAt(ee)), oe = P(u.charCodeAt(ee + 1));
if (Ae === void 0 || oe === void 0) {
const ce = u[ee] + u[ee + 1];
throw new Error('hex string expected, got non-hex character "' + ce + '" at index ' + ee);
}
V[G] = Ae * 16 + oe;
}
return V;
}
const k = async () => {
};
e.nextTick = k;
async function D(u, H, B) {
let V = Date.now();
for (let G = 0; G < u; G++) {
B(G);
const ee = Date.now() - V;
ee >= 0 && ee < H || (await (0, e.nextTick)(), V += ee);
}
}
function L(u) {
if (typeof u != "string") throw new Error("string expected");
return new Uint8Array(new TextEncoder().encode(u));
}
function E(u) {
return new TextDecoder().decode(u);
}
function U(u) {
return typeof u == "string" && (u = L(u)), o(u), u;
}
function M(u) {
return typeof u == "string" && (u = L(u)), o(u), u;
}
function z(...u) {
let H = 0;
for (let V = 0; V < u.length; V++) {
const G = u[V];
o(G), H += G.length;
}
const B = new Uint8Array(H);
for (let V = 0, G = 0; V < u.length; V++) {
const ee = u[V];
B.set(ee, G), G += ee.length;
}
return B;
}
function a(u, H) {
if (H !== void 0 && {}.toString.call(H) !== "[object Object]") throw new Error("options should be object or undefined");
return Object.assign(u, H);
}
class x {
}
e.Hash = x;
function v(u) {
const H = (V) => u().update(U(V)).digest(), B = u();
return H.outputLen = B.outputLen, H.blockLen = B.blockLen, H.create = () => u(), H;
}
function I(u) {
const H = (V, G) => u(G).update(U(V)).digest(), B = u({});
return H.outputLen = B.outputLen, H.blockLen = B.blockLen, H.create = (V) => u(V), H;
}
function _(u) {
const H = (V, G) => u(G).update(U(V)).digest(), B = u({});
return H.outputLen = B.outputLen, H.blockLen = B.blockLen, H.create = (V) => u(V), H;
}
e.wrapConstructor = v, e.wrapConstructorWithOpts = I, e.wrapXOFConstructorWithOpts = _;
function T(u = 32) {
if (t.crypto && typeof t.crypto.getRandomValues == "function") return t.crypto.getRandomValues(new Uint8Array(u));
if (t.crypto && typeof t.crypto.randomBytes == "function") return Uint8Array.from(t.crypto.randomBytes(u));
throw new Error("crypto.getRandomValues must be defined");
}
})($e)), $e;
}
var Bt;
function xr() {
if (Bt) return te;
Bt = 1, Object.defineProperty(te, "__esModule", { value: true }), te.SHA512_IV = te.SHA384_IV = te.SHA224_IV = te.SHA256_IV = te.HashMD = void 0, te.setBigUint64 = t, te.Chi = r, te.Maj = n;
const e = sr();
function t(s, i, l, c) {
if (typeof s.setBigUint64 == "function") return s.setBigUint64(i, l, c);
const w = BigInt(32), h = BigInt(4294967295), d = Number(l >> w & h), g = Number(l & h), b = c ? 4 : 0, p = c ? 0 : 4;
s.setUint32(i + b, d, c), s.setUint32(i + p, g, c);
}
function r(s, i, l) {
return s & i ^ ~s & l;
}
function n(s, i, l) {
return s & i ^ s & l ^ i & l;
}
class o extends e.Hash {
constructor(i, l, c, w) {
super(), this.finished = false, this.length = 0, this.pos = 0, this.destroyed = false, this.blockLen = i, this.outputLen = l, this.padOffset = c, this.isLE = w, this.buffer = new Uint8Array(i), this.view = (0, e.createView)(this.buffer);
}
update(i) {
(0, e.aexists)(this), i = (0, e.toBytes)(i), (0, e.abytes)(i);
const { view: l, buffer: c, blockLen: w } = this, h = i.length;
for (let d = 0; d < h; ) {
const g = Math.min(w - this.pos, h - d);
if (g === w) {
const b = (0, e.createView)(i);
for (; w <= h - d; d += w) this.process(b, d);
continue;
}
c.set(i.subarray(d, d + g), this.pos), this.pos += g, d += g, this.pos === w && (this.process(l, 0), this.pos = 0);
}
return this.length += i.length, this.roundClean(), this;
}
digestInto(i) {
(0, e.aexists)(this), (0, e.aoutput)(i, this), this.finished = true;
const { buffer: l, view: c, blockLen: w, isLE: h } = this;
let { pos: d } = this;
l[d++] = 128, (0, e.clean)(this.buffer.subarray(d)), this.padOffset > w - d && (this.process(c, 0), d = 0);
for (let C = d; C < w; C++) l[C] = 0;
t(c, w - 8, BigInt(this.length * 8), h), this.process(c, 0);
const g = (0, e.createView)(i), b = this.outputLen;
if (b % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
const p = b / 4, S = this.get();
if (p > S.length) throw new Error("_sha2: outputLen bigger than state");
for (let C = 0; C < p; C++) g.setUint32(4 * C, S[C], h);
}
digest() {
const { buffer: i, outputLen: l } = this;
this.digestInto(i);
const c = i.slice(0, l);
return this.destroy(), c;
}
_cloneInto(i) {
i || (i = new this.constructor()), i.set(...this.get());
const { blockLen: l, buffer: c, length: w, finished: h, destroyed: d, pos: g } = this;
return i.destroyed = d, i.finished = h, i.length = w, i.pos = g, w % l && i.buffer.set(c), i;
}
clone() {
return this._cloneInto();
}
}
return te.HashMD = o, te.SHA256_IV = Uint32Array.from([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]), te.SHA224_IV = Uint32Array.from([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]), te.SHA384_IV = Uint32Array.from([3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]), te.SHA512_IV = Uint32Array.from([1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209]), te;
}
var N = {}, Ft;
function Or() {
if (Ft) return N;
Ft = 1, Object.defineProperty(N, "__esModule", { value: true }), N.toBig = N.shrSL = N.shrSH = N.rotrSL = N.rotrSH = N.rotrBL = N.rotrBH = N.rotr32L = N.rotr32H = N.rotlSL = N.rotlSH = N.rotlBL = N.rotlBH = N.add5L = N.add5H = N.add4L = N.add4H = N.add3L = N.add3H = void 0, N.add = F, N.fromBig = r, N.split = n;
const e = BigInt(2 ** 32 - 1), t = BigInt(32);
function r(E, U = false) {
return U ? { h: Number(E & e), l: Number(E >> t & e) } : { h: Number(E >> t & e) | 0, l: Number(E & e) | 0 };
}
function n(E, U = false) {
const M = E.length;
let z = new Uint32Array(M), a = new Uint32Array(M);
for (let x = 0; x < M; x++) {
const { h: v, l: I } = r(E[x], U);
[z[x], a[x]] = [v, I];
}
return [z, a];
}
const o = (E, U) => BigInt(E >>> 0) << t | BigInt(U >>> 0);
N.toBig = o;
const s = (E, U, M) => E >>> M;
N.shrSH = s;
const i = (E, U, M) => E << 32 - M | U >>> M;
N.shrSL = i;
const l = (E, U, M) => E >>> M | U << 32 - M;
N.rotrSH = l;
const c = (E, U, M) => E << 32 - M | U >>> M;
N.rotrSL = c;
const w = (E, U, M) => E << 64 - M | U >>> M - 32;
N.rotrBH = w;
const h = (E, U, M) => E >>> M - 32 | U << 64 - M;
N.rotrBL = h;
const d = (E, U) => U;
N.rotr32H = d;
const g = (E, U) => E;
N.rotr32L = g;
const b = (E, U, M) => E << M | U >>> 32 - M;
N.rotlSH = b;
const p = (E, U, M) => U << M | E >>> 32 - M;
N.rotlSL = p;
const S = (E, U, M) => U << M - 32 | E >>> 64 - M;
N.rotlBH = S;
const C = (E, U, M) => E << M - 32 | U >>> 64 - M;
N.rotlBL = C;
function F(E, U, M, z) {
const a = (U >>> 0) + (z >>> 0);
return { h: E + M + (a / 2 ** 32 | 0) | 0, l: a | 0 };
}
const R = (E, U, M) => (E >>> 0) + (U >>> 0) + (M >>> 0);
N.add3L = R;
const m = (E, U, M, z) => U + M + z + (E / 2 ** 32 | 0) | 0;
N.add3H = m;
const P = (E, U, M, z) => (E >>> 0) + (U >>> 0) + (M >>> 0) + (z >>> 0);
N.add4L = P;
const O = (E, U, M, z, a) => U + M + z + a + (E / 2 ** 32 | 0) | 0;
N.add4H = O;
const k = (E, U, M, z, a) => (E >>> 0) + (U >>> 0) + (M >>> 0) + (z >>> 0) + (a >>> 0);
N.add5L = k;
const D = (E, U, M, z, a, x) => U + M + z + a + x + (E / 2 ** 32 | 0) | 0;
N.add5H = D;
const L = { fromBig: r, split: n, toBig: o, shrSH: s, shrSL: i, rotrSH: l, rotrSL: c, rotrBH: w, rotrBL: h, rotr32H: d, rotr32L: g, rotlSH: b, rotlSL: p, rotlBH: S, rotlBL: C, add: F, add3L: R, add3H: m, add4L: P, add4H: O, add5H: D, add5L: k };
return N.default = L, N;
}
var kt;
function Br() {
if (kt) return W;
kt = 1, Object.defineProperty(W, "__esModule", { value: true }), W.sha512_224 = W.sha512_256 = W.sha384 = W.sha512 = W.sha224 = W.sha256 = W.SHA512_256 = W.SHA512_224 = W.SHA384 = W.SHA512 = W.SHA224 = W.SHA256 = void 0;
const e = xr(), t = Or(), r = sr(), n = Uint32Array.from([1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]), o = new Uint32Array(64);
class s extends e.HashMD {
constructor(m = 32) {
super(64, m, 8, false), this.A = e.SHA256_IV[0] | 0, this.B = e.SHA256_IV[1] | 0, this.C = e.SHA256_IV[2] | 0, this.D = e.SHA256_IV[3] | 0, this.E = e.SHA256_IV[4] | 0, this.F = e.SHA256_IV[5] | 0, this.G = e.SHA256_IV[6] | 0, this.H = e.SHA256_IV[7] | 0;
}
get() {
const { A: m, B: P, C: O, D: k, E: D, F: L, G: E, H: U } = this;
return [m, P, O, k, D, L, E, U];
}
set(m, P, O, k, D, L, E, U) {
this.A = m | 0, this.B = P | 0, this.C = O | 0, this.D = k | 0, this.E = D | 0, this.F = L | 0, this.G = E | 0, this.H = U | 0;
}
process(m, P) {
for (let a = 0; a < 16; a++, P += 4) o[a] = m.getUint32(P, false);
for (let a = 16; a < 64; a++) {
const x = o[a - 15], v = o[a - 2], I = (0, r.rotr)(x, 7) ^ (0, r.rotr)(x, 18) ^ x >>> 3, _ = (0, r.rotr)(v, 17) ^ (0, r.rotr)(v, 19) ^ v >>> 10;
o[a] = _ + o[a - 7] + I + o[a - 16] | 0;
}
let { A: O, B: k, C: D, D: L, E, F: U, G: M, H: z } = this;
for (let a = 0; a < 64; a++) {
const x = (0, r.rotr)(E, 6) ^ (0, r.rotr)(E, 11) ^ (0, r.rotr)(E, 25), v = z + x + (0, e.Chi)(E, U, M) + n[a] + o[a] | 0, _ = ((0, r.rotr)(O, 2) ^ (0, r.rotr)(O, 13) ^ (0, r.rotr)(O, 22)) + (0, e.Maj)(O, k, D) | 0;
z = M, M = U, U = E, E = L + v | 0, L = D, D = k, k = O, O = v + _ | 0;
}
O = O + this.A | 0, k = k + this.B | 0, D = D + this.C | 0, L = L + this.D | 0, E = E + this.E | 0, U = U + this.F | 0, M = M + this.G | 0, z = z + this.H | 0, this.set(O, k, D, L, E, U, M, z);
}
roundClean() {
(0, r.clean)(o);
}
destroy() {
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, r.clean)(this.buffer);
}
}
W.SHA256 = s;
class i extends s {
constructor() {
super(28), this.A = e.SHA224_IV[0] | 0, this.B = e.SHA224_IV[1] | 0, this.C = e.SHA224_IV[2] | 0, this.D = e.SHA224_IV[3] | 0, this.E = e.SHA224_IV[4] | 0, this.F = e.SHA224_IV[5] | 0, this.G = e.SHA224_IV[6] | 0, this.H = e.SHA224_IV[7] | 0;
}
}
W.SHA224 = i;
const l = t.split(["0x428a2f98d728ae22", "0x7137449123ef65cd", "0xb5c0fbcfec4d3b2f", "0xe9b5dba58189dbbc", "0x3956c25bf348b538", "0x59f111f1b605d019", "0x923f82a4af194f9b", "0xab1c5ed5da6d8118", "0xd807aa98a3030242", "0x12835b0145706fbe", "0x243185be4ee4b28c", "0x550c7dc3d5ffb4e2", "0x72be5d74f27b896f", "0x80deb1fe3b1696b1", "0x9bdc06a725c71235", "0xc19bf174cf692694", "0xe49b69c19ef14ad2", "0xefbe4786384f25e3", "0x0fc19dc68b8cd5b5", "0x240ca1cc77ac9c65", "0x2de92c6f592b0275", "0x4a7484aa6ea6e483", "0x5cb0a9dcbd41fbd4", "0x76f988da831153b5", "0x983e5152ee66dfab", "0xa831c66d2db43210", "0xb00327c898fb213f", "0xbf597fc7beef0ee4", "0xc6e00bf33da88fc2", "0xd5a79147930aa725", "0x06ca6351e003826f", "0x142929670a0e6e70", "0x27b70a8546d22ffc", "0x2e1b21385c26c926", "0x4d2c6dfc5ac42aed", "0x53380d139d95b3df", "0x650a73548baf63de", "0x766a0abb3c77b2a8", "0x81c2c92e47edaee6", "0x92722c851482353b", "0xa2bfe8a14cf10364", "0xa81a664bbc423001", "0xc24b8b70d0f89791", "0xc76c51a30654be30", "0xd192e819d6ef5218", "0xd69906245565a910", "0xf40e35855771202a", "0x106aa07032bbd1b8", "0x19a4c116b8d2d0c8", "0x1e376c085141ab53", "0x2748774cdf8eeb99", "0x34b0bcb5e19b48a8", "0x391c0cb3c5c95a63", "0x4ed8aa4ae3418acb", "0x5b9cca4f7763e373", "0x682e6ff3d6b2b8a3", "0x748f82ee5defb2fc", "0x78a5636f43172f60", "0x84c87814a1f0ab72", "0x8cc702081a6439ec", "0x90befffa23631e28", "0xa4506cebde82bde9", "0xbef9a3f7b2c67915", "0xc67178f2e372532b", "0xca273eceea26619c", "0xd186b8c721c0c207", "0xeada7dd6cde0eb1e", "0xf57d4f7fee6ed178", "0x06f067aa72176fba", "0x0a637dc5a2c898a6", "0x113f9804bef90dae", "0x1b710b35131c471b", "0x28db77f523047d84", "0x32caab7b40c72493", "0x3c9ebe0a15c9bebc", "0x431d67c49c100d4c", "0x4cc5d4becb3e42b6", "0x597f299cfc657e2a", "0x5fcb6fab3ad6faec", "0x6c44198c4a475817"].map((R) => BigInt(R))), c = l[0], w = l[1], h = new Uint32Array(80), d = new Uint32Array(80);
class g extends e.HashMD {
constructor(m = 64) {
super(128, m, 16, false), this.Ah = e.SHA512_IV[0] | 0, this.Al = e.SHA512_IV[1] | 0, this.Bh = e.SHA512_IV[2] | 0, this.Bl = e.SHA512_IV[3] | 0, this.Ch = e.SHA512_IV[4] | 0, this.Cl = e.SHA512_IV[5] | 0, this.Dh = e.SHA512_IV[6] | 0, this.Dl = e.SHA512_IV[7] | 0, this.Eh = e.SHA512_IV[8] | 0, this.El = e.SHA512_IV[9] | 0, this.Fh = e.SHA512_IV[10] | 0, this.Fl = e.SHA512_IV[11] | 0, this.Gh = e.SHA512_IV[12] | 0, this.Gl = e.SHA512_IV[13] | 0, this.Hh = e.SHA512_IV[14] | 0, this.Hl = e.SHA512_IV[15] | 0;
}
get() {
const { Ah: m, Al: P, Bh: O, Bl: k, Ch: D, Cl: L, Dh: E, Dl: U, Eh: M, El: z, Fh: a, Fl: x, Gh: v, Gl: I, Hh: _, Hl: T } = this;
return [m, P, O, k, D, L, E, U, M, z, a, x, v, I, _, T];
}
set(m, P, O, k, D, L, E, U, M, z, a, x, v, I, _, T) {
this.Ah = m | 0, this.Al = P | 0, this.Bh = O | 0, this.Bl = k | 0, this.Ch = D | 0, this.Cl = L | 0, this.Dh = E | 0, this.Dl = U | 0, this.Eh = M | 0, this.El = z | 0, this.Fh = a | 0, this.Fl = x | 0, this.Gh = v | 0, this.Gl = I | 0, this.Hh = _ | 0, this.Hl = T | 0;
}
process(m, P) {
for (let B = 0; B < 16; B++, P += 4) h[B] = m.getUint32(P), d[B] = m.getUint32(P += 4);
for (let B = 16; B < 80; B++) {
const V = h[B - 15] | 0, G = d[B - 15] | 0, ee = t.rotrSH(V, G, 1) ^ t.rotrSH(V, G, 8) ^ t.shrSH(V, G, 7), Ae = t.rotrSL(V, G, 1) ^ t.rotrSL(V, G, 8) ^ t.shrSL(V, G, 7), oe = h[B - 2] | 0, ce = d[B - 2] | 0, Me = t.rotrSH(oe, ce, 19) ^ t.rotrBH(oe, ce, 61) ^ t.shrSH(oe, ce, 6), Ye = t.rotrSL(oe, ce, 19) ^ t.rotrBL(oe, ce, 61) ^ t.shrSL(oe, ce, 6), Re = t.add4L(Ae, Ye, d[B - 7], d[B - 16]), Qe = t.add4H(Re, ee, Me, h[B - 7], h[B - 16]);
h[B] = Qe | 0, d[B] = Re | 0;
}
let { Ah: O, Al: k, Bh: D, Bl: L, Ch: E, Cl: U, Dh: M, Dl: z, Eh: a, El: x, Fh: v, Fl: I, Gh: _, Gl: T, Hh: u, Hl: H } = this;
for (let B = 0; B < 80; B++) {
const V = t.rotrSH(a, x, 14) ^ t.rotrSH(a, x, 18) ^ t.rotrBH(a, x, 41), G = t.rotrSL(a, x, 14) ^ t.rotrSL(a, x, 18) ^ t.rotrBL(a, x, 41), ee = a & v ^ ~a & _, Ae = x & I ^ ~x & T, oe = t.add5L(H, G, Ae, w[B], d[B]), ce = t.add5H(oe, u, V, ee, c[B], h[B]), Me = oe | 0, Ye = t.rotrSH(O, k, 28) ^ t.rotrBH(O, k, 34) ^ t.rotrBH(O, k, 39), Re = t.rotrSL(O, k, 28) ^ t.rotrBL(O, k, 34) ^ t.rotrBL(O, k, 39), Qe = O & D ^ O & E ^ D & E, Sr = k & L ^ k & U ^ L & U;
u = _ | 0, H = T | 0, _ = v | 0, T = I | 0, v = a | 0, I = x | 0, { h: a, l: x } = t.add(M | 0, z | 0, ce | 0, Me | 0), M = E | 0, z = U | 0, E = D | 0, U = L | 0, D = O | 0, L = k | 0;
const Ut = t.add3L(Me, Re, Sr);
O = t.add3H(Ut, ce, Ye, Qe), k = Ut | 0;
}
({ h: O, l: k } = t.add(this.Ah | 0, this.Al | 0, O | 0, k | 0)), { h: D, l: L } = t.add(this.Bh | 0, this.Bl | 0, D | 0, L | 0), { h: E, l: U } = t.add(this.Ch | 0, this.Cl | 0, E | 0, U | 0), { h: M, l: z } = t.add(this.Dh | 0, this.Dl | 0, M | 0, z | 0), { h: a, l: x } = t.add(this.Eh | 0, this.El | 0, a | 0, x | 0), { h: v, l: I } = t.add(this.Fh | 0, this.Fl | 0, v | 0, I | 0), { h: _, l: T } = t.add(this.Gh | 0, this.Gl | 0, _ | 0, T | 0), { h: u, l: H } = t.add(this.Hh | 0, this.Hl | 0, u | 0, H | 0), this.set(O, k, D, L, E, U, M, z, a, x, v, I, _, T, u, H);
}
roundClean() {
(0, r.clean)(h, d);
}
destroy() {
(0, r.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
W.SHA512 = g;
class b extends g {
constructor() {
super(48), this.Ah = e.SHA384_IV[0] | 0, this.Al = e.SHA384_IV[1] | 0, this.Bh = e.SHA384_IV[2] | 0, this.Bl = e.SHA384_IV[3] | 0, this.Ch = e.SHA384_IV[4] | 0, this.Cl = e.SHA384_IV[5] | 0, this.Dh = e.SHA384_IV[6] | 0, this.Dl = e.SHA384_IV[7] | 0, this.Eh = e.SHA384_IV[8] | 0, this.El = e.SHA384_IV[9] | 0, this.Fh = e.SHA384_IV[10] | 0, this.Fl = e.SHA384_IV[11] | 0, this.Gh = e.SHA384_IV[12] | 0, this.Gl = e.SHA384_IV[13] | 0, this.Hh = e.SHA384_IV[14] | 0, this.Hl = e.SHA384_IV[15] | 0;
}
}
W.SHA384 = b;
const p = Uint32Array.from([2352822216, 424955298, 1944164710, 2312950998, 502970286, 855612546, 1738396948, 1479516111, 258812777, 2077511080, 2011393907, 79989058, 1067287976, 1780299464, 286451373, 2446758561]), S = Uint32Array.from([573645204, 4230739756, 2673172387, 3360449730, 596883563, 1867755857, 2520282905, 1497426621, 2519219938, 2827943907, 3193839141, 1401305490, 721525244, 746961066, 246885852, 2177182882]);
class C extends g {
constructor() {
super(28), this.Ah = p[0] | 0, this.Al = p[1] | 0, this.Bh = p[2] | 0, this.Bl = p[3] | 0, this.Ch = p[4] | 0, this.Cl = p[5] | 0, this.Dh = p[6] | 0, this.Dl = p[7] | 0, this.Eh = p[8] | 0, this.El = p[9] | 0, this.Fh = p[10] | 0, this.Fl = p[11] | 0, this.Gh = p[12] | 0, this.Gl = p[13] | 0, this.Hh = p[14] | 0, this.Hl = p[15] | 0;
}
}
W.SHA512_224 = C;
class F extends g {
constructor() {
super(32), this.Ah = S[0] | 0, this.Al = S[1] | 0, this.Bh = S[2] | 0, this.Bl = S[3] | 0, this.Ch = S[4] | 0, this.Cl = S[5] | 0, this.Dh = S[6] | 0, this.Dl = S[7] | 0, this.Eh = S[8] | 0, this.El = S[9] | 0, this.Fh = S[10] | 0, this.Fl = S[11] | 0, this.Gh = S[12] | 0, this.Gl = S[13] | 0, this.Hh = S[14] | 0, this.Hl = S[15] | 0;
}
}
return W.SHA512_256 = F, W.sha256 = (0, r.createHasher)(() => new s()), W.sha224 = (0, r.createHasher)(() => new i()), W.sha512 = (0, r.createHasher)(() => new g()), W.sha384 = (0, r.createHasher)(() => new b()), W.sha512_256 = (0, r.createHasher)(() => new F()), W.sha512_224 = (0, r.createHasher)(() => new C()), W;
}
var Mt;
function Fr() {
if (Mt) return le;
Mt = 1, Object.defineProperty(le, "__esModule", { value: true }), le.sha224 = le.SHA224 = le.sha256 = le.SHA256 = void 0;
const e = Br();
return le.SHA256 = e.SHA256, le.sha256 = e.sha256, le.SHA224 = e.SHA224, le.sha224 = e.sha224, le;
}
var et, Rt;
function kr() {
if (Rt) return et;
Rt = 1;
function e(t) {
if (t.length >= 255) throw new TypeError("Alphabet too long");
for (var r = new Uint8Array(256), n = 0; n < r.length; n++) r[n] = 255;
for (var o = 0; o < t.length; o++) {
var s = t.charAt(o), i = s.charCodeAt(0);
if (r[i] !== 255) throw new TypeError(s + " is ambiguous");
r[i] = o;
}
var l = t.length, c = t.charAt(0), w = Math.log(l) / Math.log(256), h = Math.log(256) / Math.log(l);
function d(p) {
if (p instanceof Uint8Array || (ArrayBuffer.isView(p) ? p = new Uint8Array(p.buffer, p.byteOffset, p.byteLength) : Array.isArray(p) && (p = Uint8Array.from(p))), !(p instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
if (p.length === 0) return "";
for (var S = 0, C = 0, F = 0, R = p.length; F !== R && p[F] === 0; ) F++, S++;
for (var m = (R - F) * h + 1 >>> 0, P = new Uint8Array(m); F !== R; ) {
for (var O = p[F], k = 0, D = m - 1; (O !== 0 || k < C) && D !== -1; D--, k++) O += 256 * P[D] >>> 0, P[D] = O % l >>> 0, O = O / l >>> 0;
if (O !== 0) throw new Error("Non-zero carry");
C = k, F++;
}
for (var L = m - C; L !== m && P[L] === 0; ) L++;
for (var E = c.repeat(S); L < m; ++L) E += t.charAt(P[L]);
return E;
}
function g(p) {
if (typeof p != "string") throw new TypeError("Expected String");
if (p.length === 0) return new Uint8Array();
for (var S = 0, C = 0, F = 0; p[S] === c; ) C++, S++;
for (var R = (p.length - S) * w + 1 >>> 0, m = new Uint8Array(R); p[S]; ) {
var P = p.charCodeAt(S);
if (P > 255) return;
var O = r[P];
if (O === 255) return;
for (var k = 0, D = R - 1; (O !== 0 || k < F) && D !== -1; D--, k++) O += l * m[D] >>> 0, m[D] = O % 256 >>> 0, O = O / 256 >>> 0;
if (O !== 0) throw new Error("Non-zero carry");
F = k, S++;
}
for (var L = R - F; L !== R && m[L] === 0; ) L++;
for (var E = new Uint8Array(C + (R - L)), U = C; L !== R; ) E[U++] = m[L++];
return E;
}
function b(p) {
var S = g(p);
if (S) return S;
throw new Error("Non-base" + l + " character");
}
return { encode: d, decodeUnsafe: g, decode: b };
}
return et = e, et;
}
var tt, Lt;
function Mr() {
return Lt || (Lt = 1, tt = kr()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")), tt;
}
var rt, Vt;
function Rr() {
if (Vt) return rt;
Vt = 1;
var e = Mr();
return rt = function(t) {
function r(i) {
var l = Uint8Array.from(i), c = t(l), w = l.length + 4, h = new Uint8Array(w);
return h.set(l, 0), h.set(c.subarray(0, 4), l.length), e.encode(h, w);
}
function n(i) {
var l = i.slice(0, -4), c = i.slice(-4), w = t(l);
if (!(c[0] ^ w[0] | c[1] ^ w[1] | c[2] ^ w[2] | c[3] ^ w[3])) return l;
}
function o(i) {
var l = e.decodeUnsafe(i);
if (l) return n(l);
}
function s(i) {
var l = e.decode(i), c = n(l);
if (!c) throw new Error("Invalid checksum");
return c;
}
return { encode: r, decode: s, decodeUnsafe: o };
}, rt;
}
var nt, jt;
function Lr() {
if (jt) return nt;
jt = 1;
var { sha256: e } = Fr(), t = Rr();
function r(n) {
return e(e(n));
}
return nt = t(r), nt;
}
var Vr = Lr();
const Fe = St(Vr), jr = (e) => Array.from(e, (t) => t.toString(16).padStart(2, "0")).join(""), Ne = "automerge:", Tr = (e) => {
const [t, r, ...n] = e.split("#");
if (n.length > 0) throw new Error("Invalid URL: contains multiple heads sections");
const o = new RegExp(`^${Ne}(\\w+)$`), [, s] = t.match(o) || [], i = s, l = ar(i);
if (!l) throw new Error("Invalid document URL: " + e);
if (r === void 0) return { binaryDocumentId: l, documentId: i };
const c = r === "" ? [] : r.split("|"), w = c.map((h) => {
try {
return jr(Fe.decode(h));
} catch {
throw new Error(`Invalid head in URL: ${h}`);
}
});
return { binaryDocumentId: l, hexHeads: w, documentId: i, heads: c };
}, ir = (e) => {
if (e instanceof Uint8Array || typeof e == "string") return Ne + (e instanceof Uint8Array ? Tt(e) : e);
const { documentId: t, heads: r = void 0 } = e;
if (t === void 0) throw new Error("Invalid documentId: " + t);
const n = t instanceof Uint8Array ? Tt(t) : t;
let o = `${Ne}${n}`;
return r !== void 0 && (r.forEach((s) => {
try {
Fe.decode(s);
} catch {
throw new Error(`Invalid head: ${s}`);
}
}), o += "#" + r.join("|")), o;
}, Dr = (e) => Pr(e) ? e : or(e) ? ir({ documentId: e }) : Nr(e) ? zr(e) : void 0, Pr = (e) => {
if (typeof e != "string" || !e || !e.startsWith(Ne)) return false;
try {
const { documentId: t, heads: r } = Tr(e);
return !(!or(t) || r && !r.every((n) => {
try {
return Fe.decode(n), true;
} catch {
return false;
}
}));
} catch {
return false;
}
}, or = (e) => typeof e != "string" ? false : ar(e) !== void 0, Nr = (e) => typeof e == "string" && At(e), ar = (e) => Fe.decodeUnsafe(e), Tt = (e) => Fe.encode(e), zr = (e) => {
if (!At(e)) return;
const t = Hr(e);
return ir({ documentId: t });
}, Dt = /* @__PURE__ */ new Map();
function Kr(e, { suspense: t } = { suspense: false }) {
var _a;
const r = Ir(), n = de.useRef(), [o, s] = de.useState();
let i = e && o && o.url === Dr(e) ? o : void 0;
if (e && !i) {
const c = r.findWithProgress(e);
c.state === "ready" && (i = c.handle);
}
let l = e ? Dt.get(e) : void 0;
if (!l && e) {
(_a = n.current) == null ? void 0 : _a.abort(), n.current = new AbortController();
const c = r.find(e, { signal: n.current.signal });
l = _r(c), Dt.set(e, l);
}
return de.useEffect(() => {
i || t || !l || l.promise.then((c) => {
s(c);
}).catch(() => {
s(void 0);
});
}, [i, t, l]), i || !t || !l ? i : l.read();
}
function Mn(e, t = { suspense: false }) {
const r = Kr(e, t), [n, o] = de.useState(() => r == null ? void 0 : r.doc()), [s, i] = de.useState();
de.useEffect(() => {
o(r == null ? void 0 : r.doc());
}, [r]), de.useEffect(() => {
if (!r) return;
const c = () => o(r.doc()), w = () => {
i(new Error(`Document ${e} was deleted`));
};
return r.on("change", c), r.on("delete", w), () => {
r.removeListener("change", c), r.removeListener("delete", w);
};
}, [r, e]);
const l = de.useCallback((c, w) => {
r.change(c, w);
}, [r]);
if (s) throw s;
return n ? [n, l] : [void 0, () => {
}];
}
var st = { exports: {} }, Pt;
function qr() {
return Pt || (Pt = 1, (function(e) {
var t = Object.prototype.hasOwnProperty, r = "~";
function n() {
}
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = false));
function o(c, w, h) {
this.fn = c, this.context = w, this.once = h || false;
}
function s(c, w, h, d, g) {
if (typeof h != "function") throw new TypeError("The listener must be a function");
var b = new o(h, d || c, g), p = r ? r + w : w;
return c._events[p] ? c._events[p].fn ? c._events[p] = [c._events[p], b] : c._events[p].push(b) : (c._events[p] = b, c._eventsCount++), c;
}
function i(c, w) {
--c._eventsCount === 0 ? c._events = new n() : delete c._events[w];
}
function l() {
this._events = new n(), this._eventsCount = 0;
}
l.prototype.eventNames = function() {
var w = [], h, d;
if (this._eventsCount === 0) return w;
for (d in h = this._events) t.call(h, d) && w.push(r ? d.slice(1) : d);
return Object.getOwnPropertySymbols ? w.concat(Object.getOwnPropertySymbols(h)) : w;
}, l.prototype.listeners = function(w) {
var h = r ? r + w : w, d = this._events[h];
if (!d) return [];
if (d.fn) return [d.fn];
for (var g = 0, b = d.length, p = new Array(b); g < b; g++) p[g] = d[g].fn;
return p;
}, l.prototype.listenerCount = function(w) {
var h = r ? r + w : w, d = this._events[h];
return d ? d.fn ? 1 : d.length : 0;
}, l.prototype.emit = function(w, h, d, g, b, p) {
var S = r ? r + w : w;
if (!this._events[S]) return false;
var C = this._events[S], F = arguments.length, R, m;
if (C.fn) {
switch (C.once && this.removeListener(w, C.fn, void 0, true), F) {
case 1:
return C.fn.call(C.context), true;
case 2:
return C.fn.call(C.context, h), true;
case 3:
return C.fn.call(C.context, h, d), true;
case 4:
return C.fn.call(C.context, h, d, g), true;
case 5:
return C.fn.call(C.context, h, d, g, b), true;
case 6:
return C.fn.call(C.context, h, d, g, b, p), true;
}
for (m = 1, R = new Array(F - 1); m < F; m++) R[m - 1] = arguments[m];
C.fn.apply(C.context, R);
} else {
var P = C.length, O;
for (m = 0; m < P; m++) switch (C[m].once && this.removeListener(w, C[m].fn, void 0, true), F) {
case 1:
C[m].fn.call(C[m].context);
break;
case 2:
C[m].fn.call(C[m].context, h);
break;
case 3:
C[m].fn.call(C[m].context, h, d);
break;
case 4:
C[m].fn.call(C[m].context, h, d, g);
break;
default:
if (!R) for (O = 1, R = new Array(F - 1); O < F; O++) R[O - 1] = arguments[O];
C[m].fn.apply(C[m].context, R);
}
}
return true;
}, l.prototype.on = function(w, h, d) {
return s(this, w, h, d, false);
}, l.prototype.once = function(w, h, d) {
return s(this, w, h, d, true);
}, l.prototype.removeListener = function(w, h, d, g) {
var b = r ? r + w : w;
if (!this._events[b]) return this;
if (!h) return i(this, b), this;
var p = this._events[b];
if (p.fn) p.fn === h && (!g || p.once) && (!d || p.context === d) && i(this, b);
else {
for (var S = 0, C = [], F = p.length; S < F; S++) (p[S].fn !== h || g && !p[S].once || d && p[S].context !== d) && C.push(p[S]);
C.length ? this._events[b] = C.length === 1 ? C[0] : C : i(this, b);
}
return this;
}, l.prototype.removeAllListeners = function(w) {
var h;
return w ? (h = r ? r + w : w, this._events[h] && i(this, h)) : (this._events = new n(), this._eventsCount = 0), this;
}, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = r, l.EventEmitter = l, e.exports = l;
})(st)), st.exports;
}
var Gr = qr();
const Wr = St(Gr);
new Wr();
const Ge = /* @__PURE__ */ Symbol.for("_am_meta"), He = /* @__PURE__ */ Symbol.for("_am_trace"), Ue = /* @__PURE__ */ Symbol.for("_am_objectId"), vt = /* @__PURE__ */ Symbol.for("_am_isProxy"), fr = /* @__PURE__ */ Symbol.for("_am_clearCache"), Jr = /* @__PURE__ */ Symbol.for("_am_uint"), Xr = /* @__PURE__ */ Symbol.for("_am_int"), Zr = /* @__PURE__ */ Symbol.for("_am_f64"), cr = /* @__PURE__ */ Symbol.for("_am_counter"), lr = /* @__PURE__ */ Symbol.for("_am_immutableString");
class Yr {
constructor(t) {
this.value = t || 0, Reflect.defineProperty(this, cr, { value: true });
}
valueOf() {
return this.value;
}
toString() {
return this.valueOf().toString();
}
toJSON() {
return this.value;
}
increment(t) {
throw new Error("Counters should not be incremented outside of a change callback");
}
decrement(t) {
throw new Error("Counters should not be decremented outside of a change callback");
}
}
class Qr extends Yr {
constructor(t, r, n, o, s) {
super(t), this.context = r, this.path = n, this.objectId = o, this.key = s;
}
increment(t) {
return t = typeof t == "number" ? t : 1, this.context.increment(this.objectId, this.key, t), this.value += t, this.value;
}
decrement(t) {
return this.increment(typeof t == "number" ? -t : -1);
}
}
function $r(e, t, r, n, o) {
return new Qr(e, t, r, n, o);
}
var ur;
class en {
constructor(t) {
this[ur] = true, this.val = t;
}
toString() {
return this.val;
}
toJSON() {
return this.val;
}
}
ur = lr;
function ye(e) {
if (typeof e == "string" && /^[0-9]+$/.test(e) && (e = parseInt(e, 10)), typeof e != "number") return e;
if (e < 0 || isNaN(e) || e === 1 / 0 || e === -1 / 0) throw new RangeError("A list index must be positive, but you passed " + e);
return e;
}
function ne(e, t) {
const { context: r, objectId: n, path: o } = e, s = r.getWithType(n, t);
if (s === null) return;
const i = s[0], l = s[1];
switch (i) {
case void 0:
return;
case "map":
return Je(r, l, [...o, t]);
case "list":
return Xe(r, l, [...o, t]);
case "text":
return r.text(l);
case "str":
return new en(l);
case "uint":
return l;
case "int":
return l;
case "f64":
return l;
case "boolean":
return l;
case "null":
return null;
case "bytes":
return l;
case "timestamp":
return l;
case "counter":
return $r(l, r, o, n, t);
default:
throw RangeError(`datatype ${i} unimplemented`);
}
}
function ze(e, t, r) {
const n = typeof e;
switch (n) {
case "object":
if (e == null) return [null, "null"];
if (e[Jr]) return [e.value, "uint"];
if (e[Xr]) return [e.value, "int"];
if (e[Zr]) return [e.value, "f64"];
if (e[cr]) return [e.value, "counter"];
if (e instanceof Date) return [e.getTime(), "timestamp"];
if (nn(e)) return [e.toString(), "str"];
if (e instanceof Uint8Array) return [e, "bytes"];
if (e instanceof Array) return [e, "list"];
if (Object.prototype.toString.call(e) === "[object Object]") return [e, "map"];
throw We(e, r) ? new RangeError("Cannot create a reference to an existing document object") : new RangeError(`Cannot assign unknown object: ${e}`);
case "boolean":
return [e, "boolean"];
case "number":
return Number.isInteger(e) ? [e, "int"] : [e, "f64"];
case "string":
return [e, "text"];
case "undefined":
throw new RangeError([`Cannot assign undefined value at ${Nt(t)}, `, "because `undefined` is not a valid JSON data type. ", "You might consider setting the property's value to `null`, ", "or using `delete` to remove it altogether."].join(""));
default:
throw new RangeError([`Cannot assign ${n} value at ${Nt(t)}. `, "All JSON primitive datatypes (object, array, string, number, boolean, null) ", `are supported in an Automerge document; ${n} values are not. `].join(""));
}
}
function We(e, t) {
var r, n;
return e instanceof Date ? false : !!(e && ((n = (r = e[Ge]) === null || r === void 0 ? void 0 : r.handle) === null || n === void 0 ? void 0 : n.__wbg_ptr) === t.__wbg_ptr);
}
const tn = { get(e, t) {
const { context: r, objectId: n, cache: o } = e;
return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ue ? n : t === vt ? true : t === He ? e.trace : t === Ge ? { handle: r } : (o[t] || (o[t] = ne(e, t)), o[t]);
}, set(e, t, r) {
const { context: n, objectId: o, path: s } = e;
if (e.cache = {}, We(r, n)) throw new RangeError("Cannot create a reference to an existing document object");
if (t === He) return e.trace = r, true;
if (t === fr) return true;
const [i, l] = ze(r, [...s, t], n);
switch (l) {
case "list": {
const c = n.putObject(o, t, []), w = Xe(n, c, [...s, t]);
for (let h = 0; h < i.length; h++) w[h] = i[h];
break;
}
case "text": {
n.putObject(o, t, i);
break;
}
case "map": {
const c = n.putObject(o, t, {}), w = Je(n, c, [...s, t]);
for (const h in i) w[h] = i[h];
break;
}
default:
n.put(o, t, i, l);
}
return true;
}, deleteProperty(e, t) {
const { context: r, objectId: n } = e;
return e.cache = {}, r.delete(n, t), true;
}, has(e, t) {
return this.get(e, t) !== void 0;
}, getOwnPropertyDescriptor(e, t) {
const r = this.get(e, t);
if (typeof r < "u") return { configurable: true, enumerable: true, value: r };
}, ownKeys(e) {
const { context: t, objectId: r } = e, n = t.keys(r);
return [...new Set(n)];
} }, hr = { get(e, t) {
const { context: r, objectId: n } = e;
return t = ye(t), t === Symbol.hasInstance ? (o) => Array.isArray(o) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ue ? n : t === vt ? true : t === He ? e.trace : t === Ge ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? ne(e, t) : _t(e)[t];
}, set(e, t, r) {
const { context: n, objectId: o, path: s } = e;
if (t = ye(t), We(r, n)) throw new RangeError("Cannot create a reference to an existing document object");
if (t === fr) return true;
if (t === He) return e.trace = r, true;
if (typeof t == "string") throw new RangeError("list index must be a number");
const [i, l] = ze(r, [...s, t], n);
switch (l) {
case "list": {
let c;
t >= n.length(o) ? c = n.insertObject(o, t, []) : c = n.putObject(o, t, []), Xe(n, c, [...s, t]).splice(0, 0, ...i);
break;
}
case "text": {
t >= n.length(o) ? n.insertObject(o, t, i) : n.putObject(o, t, i);
break;
}
case "map": {
let c;
t >= n.length(o) ? c = n.insertObject(o, t, {}) : c = n.putObject(o, t, {});
const w = Je(n, c, [...s, t]);
for (const h in i) w[h] = i[h];
break;
}
default:
t >= n.length(o) ? n.insert(o, t, i, l) : n.put(o, t, i, l);
}
return true;
}, deleteProperty(e, t) {
const { context: r, objectId: n } = e;
t = ye(t);
const o = r.get(n, t);
if (o != null && o[0] == "counter") throw new TypeError("Unsupported operation: deleting a counter from a list");
return r.delete(n, t), true;
}, has(e, t) {
const { context: r, objectId: n } = e;
return t = ye(t), typeof t == "number" ? t < r.length(n) : t === "length";
}, getOwnPropertyDescriptor(e, t) {
const { context: r, objectId: n } = e;
return t === "length" ? { writable: true, value: r.length(n) } : t === Ue ? { configurable: false, enumerable: false, value: n } : (t = ye(t), { configurable: true, enumerable: true, value: ne(e, t) });
}, getPrototypeOf(e) {
return Object.getPrototypeOf(e);
}, ownKeys() {
const e = [];
return e.push("length"), e;
} };
Object.assign({}, hr, { get(e, t) {
const { context: r, objectId: n } = e;
return t = ye(t), t === Symbol.hasInstance ? (o) => Array.isArray(o) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ue ? n : t === vt ? true : t === He ? e.trace : t === Ge ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? ne(e, t) : rn(e)[t] || _t(e)[t];
}, getPrototypeOf() {
return Object.getPrototypeOf(new Text());
} });
function Je(e, t, r) {
const n = { context: e, objectId: t, path: r || [], cache: {} }, o = {};
return Object.assign(o, n), new Proxy(o, tn);
}
function Xe(e, t, r) {
const n = { context: e, objectId: t, path: r || [], cache: {} }, o = [];
return Object.assign(o, n), new Proxy(o, hr);
}
function _t(e) {
const { context: t, objectId: r, path: n } = e;
return { at(s) {
return ne(e, s);
}, deleteAt(s, i) {
return typeof i == "number" ? t.splice(r, s, i) : t.delete(r, s), this;
}, fill(s, i, l) {
const [c, w] = ze(s, [...n, i], t), h = t.length(r);
i = ye(i || 0), l = ye(l || h);
for (let d = i; d < Math.min(l, h); d++) w === "list" || w === "map" || w === "text" ? t.putObject(r, d, c) : t.put(r, d, c, w);
return this;
}, indexOf(s, i = 0) {
const l = t.length(r);
for (let c = i; c < l; c++) {
const w = t.getWithType(r, c);
if (!w) continue;
const [h, d] = w;
if (!["map", "list", "text"].includes(h)) {
if (d === s) return c;
continue;
}
if (h === "text" && typeof s == "string" && s === ne(e, c) || s[Ue] === d) return c;
}
return -1;
}, insertAt(s, ...i) {
return this.splice(s, 0, ...i), this;
}, pop() {
const s = t.length(r);
if (s == 0) return;
const i = ne(e, s - 1);
return t.delete(r, s - 1), i;
}, push(...s) {
const i = t.length(r);
return this.splice(i, 0, ...s), t.length(r);
}, shift() {
if (t.length(r) == 0) return;
const s = ne(e, 0);
return t.delete(r, 0), s;
}, splice(s, i, ...l) {
s = ye(s), typeof i != "number" && (i = t.length(r) - s), i = ye(i);
for (const h of l) if (We(h, t)) throw new RangeError("Cannot create a reference to an existing document object");
const c = [];
for (let h = 0; h < i; h++) {
const d = ne(e, s);
d !== void 0 && c.push(d), t.delete(r, s);
}
const w = l.map((h, d) => {
try {
return ze(h, [...n], t);
} catch (g) {
throw g instanceof RangeError ? new RangeError(`${g.message} (at index ${d} in the input)`) : g;
}
});
for (const [h, d] of w) {
switch (d) {
case "list": {
const g = t.insertObject(r, s, []);
Xe(t, g, [...n, s]).splice(0, 0, ...h);
break;
}
case "text": {
t.insertObject(r, s, h);
break;
}
case "map": {
const g = t.insertObject(r, s, {}), b = Je(t, g, [...n, s]);
for (const p in h) b[p] = h[p];
break;
}
default:
t.insert(r, s, h, d);
}
s += 1;
}
return c;
}, unshift(...s) {
return this.splice(0, 0, ...s), t.length(r);
}, entries() {
let s = 0;
return { next: () => {
const l = ne(e, s);
return l === void 0 ? { value: void 0, done: true } : { value: [s++, l], done: false };
}, [Symbol.iterator]() {
return this;
} };
}, keys() {
let s = 0;
const i = t.length(r);
return { next: () => s < i ? { value: s++, done: false } : { value: void 0, done: true }, [Symbol.iterator]() {
return this;
} };
}, values() {
let s = 0;
return { next: () => {
const l = ne(e, s++);
return l === void 0 ? { value: void 0, done: true } : { value: l, done: false };
}, [Symbol.iterator]() {
return this;
} };
}, toArray() {
const s = [];
let i;
do
i = ne(e, s.length), i !== void 0 && s.push(i);
while (i !== void 0);
return s;
}, map(s) {
return this.toArray().map(s);
}, toString() {
return this.toArray().toString();
}, toLocaleString() {
return this.toArray().toLocaleString();
}, forEach(s) {
return this.toArray().forEach(s);
}, concat(s) {
return this.toArray().concat(s);
}, every(s) {
return this.toArray().every(s);
}, filter(s) {
return this.toArray().filter(s);
}, find(s) {
let i = 0;
for (const l of this) {
if (s(l, i)) return l;
i += 1;
}
}, findIndex(s) {
let i = 0;
for (const l of this) {
if (s(l, i)) return i;
i += 1;
}
return -1;
}, includes(s) {
return this.find((i) => i === s) !== void 0;
}, join(s) {
return this.toArray().join(s);
}, reduce(s, i) {
return this.toArray().reduce(s, i);
}, reduceRight(s, i) {
return this.toArray().reduceRight(s, i);
}, lastIndexOf(s, i = 1 / 0) {
return this.toArray().lastIndexOf(s, i);
}, slice(s, i) {
return this.toArray().slice(s, i);
}, some(s) {
let i = 0;
for (const l of this) {
if (s(l, i)) return true;
i += 1;
}
return false;
}, [Symbol.iterator]: function* () {
let s = 0, i = ne(e, s);
for (; i !== void 0; ) yield i, s += 1, i = ne(e, s);
} };
}
function rn(e) {
const { context: t, objectId: r } = e;
return { set(o, s) {
return this[o] = s;
}, get(o) {
return this[o];
}, toString() {
return t.text(r).replace(//g, "");
}, toSpans() {
const o = [];
let s = "";
const i = t.length(r);
for (let l = 0; l < i; l++) {
const c = this[l];
typeof c == "string" ? s += c : (s.length > 0 && (o.push(s), s = ""), o.push(c));
}
return s.length > 0 && o.push(s), o;
}, toJSON() {
return this.toString();
}, indexOf(o, s = 0) {
return t.text(r).indexOf(o, s);
}, insertAt(o, ...s) {
s.every((i) => typeof i == "string") ? t.splice(r, o, 0, s.join("")) : _t(e).insertAt(o, ...s);
} };
}
function Nt(e) {
const t = e.map((r) => {
if (typeof r == "number") return r.toString();
if (typeof r == "string") return r.replace(/~/g, "~0").replace(/\//g, "~1");
});
return e.length === 0 ? "" : "/" + t.join("/");
}
function nn(e) {
return typeof e == "object" && e !== null && Object.prototype.hasOwnProperty.call(e, lr);
}
let dr;
const it = typeof TextEncoder < "u" ? new TextEncoder("utf-8") : { encode: () => {
throw Error("TextEncoder not available");
} };
it.encodeInto;
const sn = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
throw Error("TextDecoder not available");
} };
typeof TextDecoder < "u" && sn.decode();
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => dr.__wbg_automerge_free(e >>> 0, 1));
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => dr.__wbg_syncstate_free(e >>> 0, 1));
var Le = { exports: {} }, ot, zt;
function on() {
if (zt) return ot;
zt = 1;
var e = 1e3, t = e * 60, r = t * 60, n = r * 24, o = n * 7, s = n * 365.25;
ot = function(h, d) {
d = d || {};
var g = typeof h;
if (g === "string" && h.length > 0) return i(h);
if (g === "number" && isFinite(h)) return d.long ? c(h) : l(h);
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(h));
};
function i(h) {
if (h = String(h), !(h.length > 100)) {
var d = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);
if (d) {
var g = parseFloat(d[1]), b = (d[2] || "ms").toLowerCase();
switch (b) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return g * s;
case "weeks":
case "week":
case "w":
return g * o;
case "days":
case "day":
case "d":
return g * n;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return g * r;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return g * t;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return g * e;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return g;
default:
return;
}
}
}
}
function l(h) {
var d = Math.abs(h);
return d >= n ? Math.round(h / n) + "d" : d >= r ? Math.round(h / r) + "h" : d >= t ? Math.round(h / t) + "m" : d >= e ? Math.round(h / e) + "s" : h + "ms";
}
function c(h) {
var d = Math.abs(h);
return d >= n ? w(h, d, n, "day") : d >= r ? w(h, d, r, "hour") : d >= t ? w(h, d, t, "minute") : d >= e ? w(h, d, e, "second") : h + " ms";
}
function w(h, d, g, b) {
var p = d >= g * 1.5;
return Math.round(h / g) + " " + b + (p ? "s" : "");
}
return ot;
}
var at, Kt;
function an() {
if (Kt) return at;
Kt = 1;
function e(t) {
n.debug = n, n.default = n, n.coerce = w, n.disable = l, n.enable = s, n.enabled = c, n.humanize = on(), n.destroy = h, Object.keys(t).forEach((d) => {
n[d] = t[d];
}), n.names = [], n.skips = [], n.formatters = {};
function r(d) {
let g = 0;
for (let b = 0; b < d.length; b++) g = (g << 5) - g + d.charCodeAt(b), g |= 0;
return n.colors[Math.abs(g) % n.colors.length];
}
n.selectColor = r;
function n(d) {
let g, b = null, p, S;
function C(...F) {
if (!C.enabled) return;
const R = C, m = Number(/* @__PURE__ */ new Date()), P = m - (g || m);
R.diff = P, R.prev = g, R.curr = m, g = m, F[0] = n.coerce(F[0]), typeof F[0] != "string" && F.unshift("%O");
let O = 0;
F[0] = F[0].replace(/%([a-zA-Z%])/g, (D, L) => {
if (D === "%%") return "%";
O++;
const E = n.formatters[L];
if (typeof E == "function") {
const U = F[O];
D = E.call(R, U), F.splice(O, 1), O--;
}
return D;
}), n.formatArgs.call(R, F), (R.log || n.log).apply(R, F);
}
return C.namespace = d, C.useColors = n.useColors(), C.color = n.selectColor(d), C.extend = o, C.destroy = n.destroy, Object.defineProperty(C, "enabled", { enumerable: true, configurable: false, get: () => b !== null ? b : (p !== n.namespaces && (p = n.namespaces, S = n.enabled(d)), S), set: (F) => {
b = F;
} }), typeof n.init == "function" && n.init(C), C;
}
function o(d, g) {
const b = n(this.namespace + (typeof g > "u" ? ":" : g) + d);
return b.log = this.log, b;
}
function s(d) {
n.save(d), n.namespaces = d, n.names = [], n.skips = [];
const g = (typeof d == "string" ? d : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
for (const b of g) b[0] === "-" ? n.skips.push(b.slice(1)) : n.names.push(b);
}
function i(d, g) {
let b = 0, p = 0, S = -1, C = 0;
for (; b < d.length; ) if (p < g.length && (g[p] === d[b] || g[p] === "*")) g[p] === "*" ? (S = p, C = b, p++) : (b++, p++);
else if (S !== -1) p = S + 1, C++, b = C;
else return false;
for (; p < g.length && g[p] === "*"; ) p++;
return p === g.length;
}
function l() {
const d = [...n.names, ...n.skips.map((g) => "-" + g)].join(",");
return n.enable(""), d;
}
function c(d) {
for (const g of n.skips) if (i(d, g)) return false;
for (const g of n.names) if (i(d, g)) return true;
return false;
}
function w(d) {
return d instanceof Error ? d.stack || d.message : d;
}
function h() {
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 n.enable(n.load()), n;
}
return at = e, at;
}
var qt;
function fn() {
return qt || (qt = 1, (function(e, t) {
t.formatArgs = n, t.save = o, t.load = s, t.useColors = r, t.storage = i(), t.destroy = /* @__PURE__ */ (() => {
let c = false;
return () => {
c || (c = true, 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 r() {
if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return true;
if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
let c;
return 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 && (c = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(c[1], 10) >= 31 || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function n(c) {
if (c[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + c[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors) return;
const w = "color: " + this.color;
c.splice(1, 0, w, "color: inherit");
let h = 0, d = 0;
c[0].replace(/%[a-zA-Z%]/g, (g) => {
g !== "%%" && (h++, g === "%c" && (d = h));
}), c.splice(d, 0, w);
}
t.log = console.debug || console.log || (() => {
});
function o(c) {
try {
c ? t.storage.setItem("debug", c) : t.storage.removeItem("debug");
} catch {
}
}
function s() {
let c;
try {
c = t.storage.getItem("debug") || t.storage.getItem("DEBUG");
} catch {
}
return !c && typeof process < "u" && "env" in process && (c = vr.DEBUG), c;
}
function i() {
try {
return localStorage;
} catch {
}
}
e.exports = an()(t);
const { formatters: l } = e.exports;
l.j = function(c) {
try {
return JSON.stringify(c);
} catch (w) {
return "[UnexpectedJSONParseError]: " + w.message;
}
};
})(Le, Le.exports)), Le.exports;
}
var cn = fn();
const ln = St(cn);
let ht;
try {
ht = new TextDecoder();
} catch {
}
let j, we, A = 0;
const un = 105, hn = 57342, dn = 57343, Gt = 57337, Wt = 6, Se = {};
let Ie = 11281e4, pe = 1681e4, K = {}, X, Ke, qe = 0, xe = 0, Q, ae, Z = [], dt = [], se, re, Ee, Jt = { useRecords: false, mapsAsObjects: true }, Oe = false, yr = 2;
try {
new Function("");
} catch {
yr = 1 / 0;
}
class Be {
constructor(t) {
if (t && ((t.keyMap || t._keyMap) && !t.useRecords && (t.useRecords = false, t.mapsAsObjects = true), t.useRecords === false && t.mapsAsObjects === void 0 && (t.mapsAsObjects = true), t.getStructures && (t.getShared = t.getStructures), t.getShared && !t.structures && ((t.structures = []).uninitialized = true), t.keyMap)) {
this.mapKey = /* @__PURE__ */ new Map();
for (let [r, n] of Object.entries(t.keyMap)) this.mapKey.set(n, r);
}
Object.assign(this, t);
}
decodeKey(t) {
return this.keyMap && this.mapKey.get(t) || t;
}
encodeKey(t) {
return this.keyMap && this.keyMap.hasOwnProperty(t) ? this.keyMap[t] : t;
}
encodeKeys(t) {
if (!this._keyMap) return t;
let r = /* @__PURE__ */ new Map();
for (let [n, o] of Object.entries(t)) r.set(this._keyMap.hasOwnProperty(n) ? this._keyMap[n] : n, o);
return r;
}
decodeKeys(t) {
if (!this._keyMap || t.constructor.name != "Map") return t;
if (!this._mapKey) {
this._mapKey = /* @__PURE__ */ new Map();
for (let [n, o] of Object.entries(this._keyMap)) this._mapKey.set(o, n);
}
let r = {};
return t.forEach((n, o) => r[fe(this._mapKey.has(o) ? this._mapKey.get(o) : o)] = n), r;
}
mapDecode(t, r) {
let n = this.decode(t);
return this._keyMap && n.constructor.name === "Array" ? n.map((o) => this.decodeKeys(o)) : n;
}
decode(t, r) {
if (j) return wr(() => (gt(), this ? this.decode(t, r) : Be.prototype.decode.call(Jt, t, r)));
we = r > -1 ? r : t.length, A = 0, xe = 0, Ke = null, Q = null, j = t;
try {
re = t.dataView || (t.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength));
} catch (n) {
throw j = null, t instanceof Uint8Array ? n : new Error("Source must be a Uint8Array or Buffer but was a " + (t && typeof t == "object" ? t.constructor.name : typeof t));
}
if (this instanceof Be) {
if (K = this, se = this.sharedValues && (this.pack ? new Array(this.maxPrivatePackedValues || 16).concat(this.sharedValues) : this.sharedValues), this.structures) return X = this.structures, Ve();
(!X || X.length > 0) && (X = []);
} else K = Jt, (!X || X.length > 0) && (X = []), se = null;
return Ve();
}
decodeMultiple(t, r) {
let n, o = 0;
try {
let s = t.length;
Oe = true;
let i = this ? this.decode(t, s) : Et.decode(t, s);
if (r) {
if (r(i) === false) return;
for (; A < s; ) if (o = A, r(Ve()) === false) return;
} else {
for (n = [i]; A < s; ) o = A, n.push(Ve());
return n;
}
} catch (s) {
throw s.lastPosition = o, s.values = n, s;
} finally {
Oe = false, gt();
}
}
}
function Ve() {
try {
let e = q();
if (Q) {
if (A >= Q.postBundlePosition) {
let t = new Error("Unexpected bundle position");
throw t.incomplete = true, t;
}
A = Q.postBundlePosition, Q = null;
}
if (A == we) X = null, j = null, ae && (ae = null);
else if (A > we) {
let t = new Error("Unexpected end of CBOR data");
throw t.incomplete = true, t;
} else if (!Oe) throw new Error("Data read, but end of buffer not reached");
return e;
} catch (e) {
throw gt(), (e instanceof RangeError || e.message.startsWith("Unexpected end of buffer")) && (e.incomplete = true), e;
}
}
function q() {
let e = j[A++], t = e >> 5;
if (e = e & 31, e > 23) switch (e) {
case 24:
e = j[A++];
break;
case 25:
if (t == 7) return gn();
e = re.getUint16(A), A += 2;
break;
case 26:
if (t == 7) {
let r = re.getFloat32(A);
if (K.useFloat32 > 2) {
let n = It[(j[A] & 127) << 1 | j[A + 1] >> 7];
return A += 4, (n * r + (r > 0 ? 0.5 : -0.5) >> 0) / n;
}
return A += 4, r;
}
e = re.getUint32(A), A += 4;
break;
case 27:
if (t == 7) {
let r = re.getFloat64(A);
return A += 8, r;
}
if (t > 1) {
if (re.getUint32(A) > 0) throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");
e = re.getUint32(A + 4);
} else K.int64AsNumber ? (e = re.getUint32(A) * 4294967296, e += re.getUint32(A + 4)) : e = re.getBigUint64(A);
A += 8;
break;
case 31:
switch (t) {
case 2:
case 3:
throw new Error("Indefinite length not supported for byte or text strings");
case 4:
let r = [], n, o = 0;
for (; (n = q()) != Se; ) {
if (o >= Ie) throw new Error(`Array length exceeds ${Ie}`);
r[o++] = n;
}
return t == 4 ? r : t == 3 ? r.join("") : Buffer.concat(r);
case 5:
let s;
if (K.mapsAsObjects) {
let i = {}, l = 0;
if (K.keyMap) for (; (s = q()) != Se; ) {
if (l++ >= pe) throw new Error(`Property count exceeds ${pe}`);
i[fe(K.decodeKey(s))] = q();
}
else for (; (s = q()) != Se; ) {
if (l++ >= pe) throw new Error(`Property count exceeds ${pe}`);
i[fe(s)] = q();
}
return i;
} else {
Ee && (K.mapsAsObjects = true, Ee = false);
let i = /* @__PURE__ */ new Map();
if (K.keyMap) {
let l = 0;
for (; (s = q()) != Se; ) {
if (l++ >= pe) throw new Error(`Map size exceeds ${pe}`);
i.set(K.decodeKey(s), q());
}
} else {
let l = 0;
for (; (s = q()) != Se; ) {
if (l++ >= pe) throw new Error(`Map size exceeds ${pe}`);
i.set(s, q());
}
}
return i;
}
case 7:
return Se;
default:
throw new Error("Invalid major type for indefinite length " + t);
}
default:
throw new Error("Unknown token " + e);
}
switch (t) {
case 0:
return e;
case 1:
return ~e;
case 2:
return bn(e);
case 3:
if (xe >= A) return Ke.slice(A - qe, (A += e) - qe);
if (xe == 0 && we < 140 && e < 32) {
let o = e < 16 ? pr(e) : pn(e);
if (o != null) return o;
}
return yn(e);
case 4:
if (e >= Ie) throw new Error(`Array length exceeds ${Ie}`);
let r = new Array(e);
for (let o = 0; o < e; o++) r[o] = q();
return r;
case 5:
if (e >= pe) throw new Error(`Map size exceeds ${Ie}`);
if (K.mapsAsObjects) {
let o = {};
if (K.keyMap) for (let s = 0; s < e; s++) o[fe(K.decodeKey(q()))] = q();
else for (let s = 0; s < e; s++) o[fe(q())] = q();
return o;
} else {
Ee && (K.mapsAsObjects = true, Ee = false);
let o = /* @__PURE__ */ new Map();
if (K.keyMap) for (let s = 0; s < e; s++) o.set(K.decodeKey(q()), q());
else for (let s = 0; s < e; s++) o.set(q(), q());
return o;
}
case 6:
if (e >= Gt) {
let o = X[e & 8191];
if (o) return o.read || (o.read = yt(o)), o.read();
if (e < 65536) {
if (e == dn) {
let s = _e(), i = q(), l = q();
bt(i, l);
let c = {};
if (K.keyMap) for (let w = 2; w < s; w++) {
let h = K.decodeKey(l[w - 2]);
c[fe(h)] = q();
}
else for (let w = 2; w < s; w++) {
let h = l[w - 2];
c[fe(h)] = q();
}
return c;
} else if (e == hn) {
let s = _e(), i = q();
for (let l = 2; l < s; l++) bt(i++, q());
return q();
} else if (e == Gt) return _n();
if (K.getShared && (Ct(), o = X[e & 8191], o)) return o.read || (o.read = yt(o)), o.read();
}
}
let n = Z[e];
if (n) return n.handlesRead ? n(q) : n(q());
{
let o = q();
for (let s = 0; s < dt.length; s++) {
let i = dt[s](e, o);
if (i !== void 0) return i;
}
return new me(o, e);
}
case 7:
switch (e) {
case 20:
return false;
case 21:
return true;
case 22:
return null;
case 23:
return;
default:
let o = (se || ge())[e];
if (o !== void 0) return o;
throw new Error("Unknown token " + e);
}
default:
if (isNaN(e)) {
let o = new Error("Unexpected end of CBOR data");
throw o.incomplete = true, o;
}
throw new Error("Unknown CBOR token " + e);
}
}
const Xt = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
function yt(e) {
if (!e) throw new Error("Structure is required in record definition");
function t() {
let r = j[A++];
if (r = r & 31, r > 23) switch (r) {
case 24:
r = j[A++];
break;
case 25:
r = re.getUint16(A), A += 2;
break;
case 26:
r = re.getUint32(A), A += 4;
break;
default:
throw new Error("Expected array header, but got " + j[A - 1]);
}
let n = this.compiledReader;
for (; n; ) {
if (n.propertyCount === r) return n(q);
n = n.next;
}
if (this.slowReads++ >= yr) {
let s = this.length == r ? this : this.slice(0, r);
return n = K.keyMap ? new Function("r", "return {" + s.map((i) => K.decodeKey(i)).map((i) => Xt.test(i) ? fe(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}") : new Function("r", "return {" + s.map((i) => Xt.test(i) ? fe(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(q);
}
let o = {};
if (K.keyMap) for (let s = 0; s < r; s++) o[fe(K.decodeKey(this[s]))] = q();
else for (let s = 0; s < r; s++) o[fe(this[s])] = q();
return o;
}
return e.slowReads = 0, t;
}
function fe(e) {
if (typeof e == "string") return e === "__proto__" ? "__proto_" : e;
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return e.toString();
if (e == null) return e + "";
throw new Error("Invalid property name type " + typeof e);
}
let yn = pt;
function pt(e) {
let t;
if (e < 16 && (t = pr(e))) return t;
if (e > 64 && ht) return ht.decode(j.subarray(A, A += e));
const r = A + e, n = [];
for (t = ""; A < r; ) {
const o = j[A++];
if ((o & 128) === 0) n.push(o);
else if ((o & 224) === 192) {
const s = j[A++] & 63;
n.push((o & 31) << 6 | s);
} else if ((o & 240) === 224) {
const s = j[A++] & 63, i = j[A++] & 63;
n.push((o & 31) << 12 | s << 6 | i);
} else if ((o & 248) === 240) {
const s = j[A++] & 63, i = j[A++] & 63, l = j[A++] & 63;
let c = (o & 7) << 18 | s << 12 | i << 6 | l;
c > 65535 && (c -= 65536, n.push(c >>> 10 & 1023 | 55296), c = 56320 | c & 1023), n.push(c);
} else n.push(o);
n.length >= 4096 && (t += $.apply(String, n), n.length = 0);
}
return n.length > 0 && (t += $.apply(String, n)), t;
}
let $ = String.fromCharCode;
function pn(e) {
let t = A, r = new Array(e);
for (let n = 0; n < e; n++) {
const o = j[A++];
if ((o & 128) > 0) {
A = t;
return;
}
r[n] = o;
}
return $.apply(String, r);
}
function pr(e) {
if (e < 4) if (e < 2) {
if (e === 0) return "";
{
let t = j[A++];
if ((t & 128) > 1) {
A -= 1;
return;
}
return $(t);
}
} else {
let t = j[A++], r = j[A++];
if ((t & 128) > 0 || (r & 128) > 0) {
A -= 2;
return;
}
if (e < 3) return $(t, r);
let n = j[A++];
if ((n & 128) > 0) {
A -= 3;
return;
}
return $(t, r, n);
}
else {
let t = j[A++], r = j[A++], n = j[A++], o = j[A++];
if ((t & 128) > 0 || (r & 128) > 0 || (n & 128) > 0 || (o & 128) > 0) {
A -= 4;
return;
}
if (e < 6) {
if (e === 4) return $(t, r, n, o);
{
let s = j[A++];
if ((s & 128) > 0) {
A -= 5;
return;
}
return $(t, r, n, o, s);
}
} else if (e < 8) {
let s = j[A++], i = j[A++];
if ((s & 128) > 0 || (i & 128) > 0) {
A -= 6;
return;
}
if (e < 7) return $(t, r, n, o, s, i);
let l = j[A++];
if ((l & 128) > 0) {
A -= 7;
return;
}
return $(t, r, n, o, s, i, l);
} else {
let s = j[A++], i = j[A++], l = j[A++], c = j[A++];
if ((s & 128) > 0 || (i & 128) > 0 || (l & 128) > 0 || (c & 128) > 0) {
A -= 8;
return;
}
if (e < 10) {
if (e === 8) return $(t, r, n, o, s, i, l, c);
{
let w = j[A++];
if ((w & 128) > 0) {
A -= 9;
return;
}
return $(t, r, n, o, s, i, l, c, w);
}
} else if (e < 12) {
let w = j[A++], h = j[A++];
if ((w & 128) > 0 || (h & 128) > 0) {
A -= 10;
return;
}
if (e < 11) return $(t, r, n, o, s, i, l, c, w, h);
let d = j[A++];
if ((d & 128) > 0) {
A -= 11;
return;
}
return $(t, r, n, o, s, i, l, c, w, h, d);
} else {
let w = j[A++], h = j[A++], d = j[A++], g = j[A++];
if ((w & 128) > 0 || (h & 128) > 0 || (d & 128) > 0 || (g & 128) > 0) {
A -= 12;
return;
}
if (e < 14) {
if (e === 12) return $(t, r, n, o, s, i, l, c, w, h, d, g);
{
let b = j[A++];
if ((b & 128) > 0) {
A -= 13;
return;
}
return $(t, r, n, o, s, i, l, c, w, h, d, g, b);
}
} else {
let b = j[A++], p = j[A++];
if ((b & 128) > 0 || (p & 128) > 0) {
A -= 14;
return;
}
if (e < 15) return $(t, r, n, o, s, i, l, c, w, h, d, g, b, p);
let S = j[A++];
if ((S & 128) > 0) {
A -= 15;
return;
}
return $(t, r, n, o, s, i, l, c, w, h, d, g, b, p, S);
}
}
}
}
}
function bn(e) {
return K.copyBuffers ? Uint8Array.prototype.slice.call(j, A, A += e) : j.subarray(A, A += e);
}
let br = new Float32Array(1), je = new Uint8Array(br.buffer, 0, 4);
function gn() {
let e = j[A++], t = j[A++], r = (e & 127) >> 2;
if (r === 31) return t || e & 3 ? NaN : e & 128 ? -1 / 0 : 1 / 0;
if (r === 0) {
let n = ((e & 3) << 8 | t) / 16777216;
return e & 128 ? -n : n;
}
return je[3] = e & 128 | (r >> 1) + 56, je[2] = (e & 7) << 5 | t >> 3, je[1] = t << 5, je[0] = 0, br[0];
}
new Array(4096);
class me {
constructor(t, r) {
this.value = t, this.tag = r;
}
}
Z[0] = (e) => new Date(e);
Z[1] = (e) => new Date(Math.round(e * 1e3));
Z[2] = (e) => {
let t = BigInt(0);
for (let r = 0, n = e.byteLength; r < n; r++) t = BigInt(e[r]) + (t << BigInt(8));
return t;
};
Z[3] = (e) => BigInt(-1) - Z[2](e);
Z[4] = (e) => +(e[1] + "e" + e[0]);
Z[5] = (e) => e[1] * Math.exp(e[0] * Math.log(2));
const bt = (e, t) => {
e = e - 57344;
let r = X[e];
r && r.isShared && ((X.restoreStructures || (X.restoreStructures = []))[e] = r), X[e] = t, t.read = yt(t);
};
Z[un] = (e) => {
let t = e.length, r = e[1];
bt(e[0], r);
let n = {};
for (let o = 2; o < t; o++) {
let s = r[o - 2];
n[fe(s)] = e[o];
}
return n;
};
Z[14] = (e) => Q ? Q[0].slice(Q.position0, Q.position0 += e) : new me(e, 14);
Z[15] = (e) => Q ? Q[1].slice(Q.position1, Q.position1 += e) : new me(e, 15);
let wn = { Error, RegExp };
Z[27] = (e) => (wn[e[0]] || Error)(e[1], e[2]);
const gr = (e) => {
if (j[A++] != 132) {
let r = new Error("Packed values structure must be followed by a 4 element array");
throw j.length < A && (r.incomplete = true), r;
}
let t = e();
if (!t || !t.length) {
let r = new Error("Packed values structure must be followed by a 4 element array");
throw r.incomplete = true, r;
}
return se = se ? t.concat(se.slice(t.length)) : t, se.prefixes = e(), se.suffixes = e(), e();
};
gr.handlesRead = true;
Z[51] = gr;
Z[Wt] = (e) => {
if (!se) if (K.getShared) Ct();
else return new me(e, Wt);
if (typeof e == "number") return se[16 + (e >= 0 ? 2 * e : -2 * e - 1)];
let t = new Error("No support for non-integer packed references yet");
throw e === void 0 && (t.incomplete = true), t;
};
Z[28] = (e) => {
ae || (ae = /* @__PURE__ */ new Map(), ae.id = 0);
let t = ae.id++, r = A, n = j[A], o;
n >> 5 == 4 ? o = [] : o = {};
let s = { target: o };
ae.set(t, s);
let i = e();
return s.used ? (Object.getPrototypeOf(o) !== Object.getPrototypeOf(i) && (A = r, o = i, ae.set(t, { target: o }), i = e()), Object.assign(o, i)) : (s.target = i, i);
};
Z[28].handlesRead = true;
Z[29] = (e) => {
let t = ae.get(e);
return t.used = true, t.target;
};
Z[258] = (e) => new Set(e);
(Z[259] = (e) => (K.mapsAsObjects && (K.mapsAsObjects = false, Ee = true), e())).handlesRead = true;
function ve(e, t) {
return typeof e == "string" ? e + t : e instanceof Array ? e.concat(t) : Object.assign({}, e, t);
}
function ge() {
if (!se) if (K.getShared) Ct();
else throw new Error("No packed values available");
return se;
}
const mn = 1399353956;
dt.push((e, t) => {
if (e >= 225 && e <= 255) return ve(ge().prefixes[e - 224], t);
if (e >= 28704 && e <= 32767) return ve(ge().prefixes[e - 28672], t);
if (e >= 1879052288 && e <= 2147483647) return ve(ge().prefixes[e - 1879048192], t);
if (e >= 216 && e <= 223) return ve(t, ge().suffixes[e - 216]);
if (e >= 27647 && e <= 28671) return ve(t, ge().suffixes[e - 27639]);
if (e >= 1811940352 && e <= 1879048191) return ve(t, ge().suffixes[e - 1811939328]);
if (e == mn) return { packedValues: se, structures: X.slice(0), version: t };
if (e == 55799) return t;
});
const An = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, Zt = [Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, typeof BigUint64Array > "u" ? { name: "BigUint64Array" } : BigUint64Array, Int8Array, Int16Array, Int32Array, typeof BigInt64Array > "u" ? { name: "BigInt64Array" } : BigInt64Array, Float32Array, Float64Array], Sn = [64, 68, 69, 70, 71, 72, 77, 78, 79, 85, 86];
for (let e = 0; e < Zt.length; e++) vn(Zt[e], Sn[e]);
function vn(e, t) {
let r = "get" + e.name.slice(0, -5), n;
typeof e == "function" ? n = e.BYTES_PER_ELEMENT : e = null;
for (let o = 0; o < 2; o++) {
if (!o && n == 1) continue;
let s = n == 2 ? 1 : n == 4 ? 2 : n == 8 ? 3 : 0;
Z[o ? t : t - 4] = n == 1 || o == An ? (i) => {
if (!e) throw new Error("Could not find typed array for code " + t);
return !K.copyBuffers && (n === 1 || n === 2 && !(i.byteOffset & 1) || n === 4 && !(i.byteOffset & 3) || n === 8 && !(i.byteOffset & 7)) ? new e(i.buffer, i.byteOffset, i.byteLength >> s) : new e(Uint8Array.prototype.slice.call(i, 0).buffer);
} : (i) => {
if (!e) throw new Error("Could not find typed array for code " + t);
let l = new DataView(i.buffer, i.byteOffset, i.byteLength), c = i.length >> s, w = new e(c), h = l[r];
for (let d = 0; d < c; d++) w[d] = h.call(l, d << s, o);
return w;
};
}
}
function _n() {
let e = _e(), t = A + q();
for (let n = 2; n < e; n++) {
let o = _e();
A += o;
}
let r = A;
return A = t, Q = [pt(_e()), pt(_e())], Q.position0 = 0, Q.position1 = 0, Q.postBundlePosition = A, A = r, q();
}
function _e() {
let e = j[A++] & 31;
if (e > 23) switch (e) {
case 24:
e = j[A++];
break;
case 25:
e = re.getUint16(A), A += 2;
break;
case 26:
e = re.getUint32(A), A += 4;
break;
}
return e;
}
function Ct() {
if (K.getShared) {
let e = wr(() => (j = null, K.getShared())) || {}, t = e.structures || [];
K.sharedVersion = e.version, se = K.sharedValues = e.packedValues, X === true ? K.structures = X = t : X.splice.apply(X, [0, t.length].concat(t));
}
}
function wr(e) {
let t = we, r = A, n = qe, o = xe, s = Ke, i = ae, l = Q, c = new Uint8Array(j.slice(0, we)), w = X, h = K, d = Oe, g = e();
return we = t, A = r, qe = n, xe = o, Ke = s, ae = i, Q = l, j = c, Oe = d, X = w, K = h, re = new DataView(j.buffer, j.byteOffset, j.byteLength), g;
}
function gt() {
j = null, ae = null, X = null;
}
const It = new Array(147);
for (let e = 0; e < 256; e++) It[e] = +("1e" + Math.floor(45.15 - e * 0.30103));
let Et = new Be({ useRecords: false });
Et.decode;
Et.decodeMultiple;
let Te;
try {
Te = new TextEncoder();
} catch {
}
let wt, mr;
const Ze = typeof globalThis == "object" && globalThis.Buffer, ke = typeof Ze < "u", ft = ke ? Ze.allocUnsafeSlow : Uint8Array, Yt = ke ? Ze : Uint8Array, Qt = 256, $t = ke ? 4294967296 : 2144337920;
let ct, y, J, f = 0, be, Y = null;
const Cn = 61440, In = /[\u0080-\uFFFF]/, ie = /* @__PURE__ */ Symbol("record-id");
class En extends Be {
constructor(t) {
super(t), this.offset = 0;
let r, n, o, s, i;
t = t || {};
let l = Yt.prototype.utf8Write ? function(a, x, v) {
return y.utf8Write(a, x, v);
} : Te && Te.encodeInto ? function(a, x) {
return Te.encodeInto(a, y.subarray(x)).written;
} : false, c = this, w = t.structures || t.saveStructures, h = t.maxSharedStructures;
if (h == null && (h = w ? 128 : 0), h > 8190) throw new Error("Maximum maxSharedStructure is 8190");
let d = t.sequential;
d && (h = 0), this.structures || (this.structures = []), this.saveStructures && (this.saveShared = this.saveStructures);
let g, b, p = t.sharedValues, S;
if (p) {
S = /* @__PURE__ */ Object.create(null);
for (let a = 0, x = p.length; a < x; a++) S[p[a]] = a;
}
let C = [], F = 0, R = 0;
this.mapEncode = function(a, x) {
return this._keyMap && !this._mapped && a.constructor.name === "Array" && (a = a.map((v) => this.encodeKeys(v))), this.encode(a, x);
}, this.encode = function(a, x) {
if (y || (y = new ft(8192), J = new DataView(y.buffer, 0, 8192), f = 0), be = y.length - 10, be - f < 2048 ? (y = new ft(y.length), J = new DataView(y.buffer, 0, y.length), be = y.length - 10, f = 0) : x === rr && (f = f + 7 & 2147483640), r = f, c.useSelfDescribedHeader && (J.setUint32(f, 3654940416), f += 3), i = c.structuredClone ? /* @__PURE__ */ new Map() : null, c.bundleStrings && typeof a != "string" ? (Y = [], Y.size = 1 / 0) : Y = null, n = c.structures, n) {
if (n.uninitialized) {
let I = c.getShared() || {};
c.structures = n = I.structures || [], c.sharedVersion = I.version;
let _ = c.sharedValues = I.packedValues;
if (_) {
S = {};
for (let T = 0, u = _.length; T < u; T++) S[_[T]] = T;
}
}
let v = n.length;
if (v > h && !d && (v = h), !n.transitions) {
n.transitions = /* @__PURE__ */ Object.create(null);
for (let I = 0; I < v; I++) {
let _ = n[I];
if (!_) continue;
let T, u = n.transitions;
for (let H = 0, B = _.length; H < B; H++) {
u[ie] === void 0 && (u[ie] = I);
let V = _[H];
T = u[V], T || (T = u[V] = /* @__PURE__ */ Object.create(null)), u = T;
}
u[ie] = I | 1048576;
}
}
d || (n.nextId = v);
}
if (o && (o = false), s = n || [], b = S, t.pack) {
let v = /* @__PURE__ */ new Map();
if (v.values = [], v.encoder = c, v.maxValues = t.maxPrivatePackedValues || (S ? 16 : 1 / 0), v.objectMap = S || false, v.samplingPackedValues = g, De(a, v), v.values.length > 0) {
y[f++] = 216, y[f++] = 51, he(4);
let I = v.values;
m(I), he(0), he(0), b = Object.create(S || null);
for (let _ = 0, T = I.length; _ < T; _++) b[I[_]] = _;
}
}
ct = x & ut;
try {
if (ct) return;
if (m(a), Y && tr(r, m), c.offset = f, i && i.idsToInsert) {
f += i.idsToInsert.length * 2, f > be && O(f), c.offset = f;
let v = xn(y.subarray(r, f), i.idsToInsert);
return i = null, v;
}
return x & rr ? (y.start = r, y.end = f, y) : y.subarray(r, f);
} finally {
if (n) {
if (R < 10 && R++, n.length > h && (n.length = h), F > 1e4) n.transitions = null, R = 0, F = 0, C.length > 0 && (C = []);
else if (C.length > 0 && !d) {
for (let v = 0, I = C.length; v < I; v++) C[v][ie] = void 0;
C = [];
}
}
if (o && c.saveShared) {
c.structures.length > h && (c.structures = c.structures.slice(0, h));
let v = y.subarray(r, f);
return c.updateSharedData() === false ? c.encode(a) : v;
}
x & On && (f = r);
}
}, this.findCommonStringsToPack = () => (g = /* @__PURE__ */ new Map(), S || (S = /* @__PURE__ */ Object.create(null)), (a) => {
let x = a && a.threshold || 4, v = this.pack ? a.maxPrivatePackedValues || 16 : 0;
p || (p = this.sharedValues = []);
for (let [I, _] of g) _.count > x && (S[I] = v++, p.push(I), o = true);
for (; this.saveShared && this.updateSharedData() === false; ) ;
g = null;
});
const m = (a) => {
f > be && (y = O(f));
var x = typeof a, v;
if (x === "string") {
if (b) {
let u = b[a];
if (u >= 0) {
u < 16 ? y[f++] = u + 224 : (y[f++] = 198, u & 1 ? m(15 - u >> 1) : m(u - 16 >> 1));
return;
} else if (g && !t.pack) {
let H = g.get(a);
H ? H.count++ : g.set(a, { count: 1 });
}
}
let I = a.length;
if (Y && I >= 4 && I < 1024) {
if ((Y.size += I) > Cn) {
let H, B = (Y[0] ? Y[0].length * 3 + Y[1].length : 0) + 10;
f + B > be && (y = O(f + B)), y[f++] = 217, y[f++] = 223, y[f++] = 249, y[f++] = Y.position ? 132 : 130, y[f++] = 26, H = f - r, f += 4, Y.position && tr(r, m), Y = ["", ""], Y.size = 0, Y.position = H;
}
let u = In.test(a);
Y[u ? 0 : 1] += a, y[f++] = u ? 206 : 207, m(I);
return;
}
let _;
I < 32 ? _ = 1 : I < 256 ? _ = 2 : I < 65536 ? _ = 3 : _ = 5;
let T = I * 3;
if (f + T > be && (y = O(f + T)), I < 64 || !l) {
let u, H, B, V = f + _;
for (u = 0; u < I; u++) H = a.charCodeAt(u), H < 128 ? y[V++] = H : H < 2048 ? (y[V++] = H >> 6 | 192, y[V++] = H & 63 | 128) : (H & 64512) === 55296 && ((B = a.charCodeAt(u + 1)) & 64512) === 56320 ? (H = 65536 + ((H & 1023) << 10) + (B & 1023), u++, y[V++] = H >> 18 | 240, y[V++] = H >> 12 & 63 | 128, y[V++] = H >> 6 & 63 | 128, y[V++] = H & 63 | 128) : (y[V++] = H >> 12 | 224, y[V++] = H >> 6 & 63 | 128, y[V++] = H & 63 | 128);
v = V - f - _;
} else v = l(a, f + _, T);
v < 24 ? y[f++] = 96 | v : v < 256 ? (_ < 2 && y.copyWithin(f + 2, f + 1, f + 1 + v), y[f++] = 120, y[f++] = v) : v < 65536 ? (_ < 3 && y.copyWithin(f + 3, f + 2, f + 2 + v), y[f++] = 121, y[f++] = v >> 8, y[f++] = v & 255) : (_ < 5 && y.copyWithin(f + 5, f + 3, f + 3 + v), y[f++] = 122, J.setUint32(f, v), f += 4), f += v;
} else if (x === "number") if (!this.alwaysUseFloat && a >>> 0 === a) a < 24 ? y[f++] = a : a < 256 ? (y[f++] = 24, y[f++] = a) : a < 65536 ? (y[f++] = 25, y[f++] = a >> 8, y[f++] = a & 255) : (y[f++] = 26, J.setUint32(f, a), f += 4);
else if (!this.alwaysUseFloat && a >> 0 === a) a >= -24 ? y[f++] = 31 - a : a >= -256 ? (y[f++] = 56, y[f++] = ~a) : a >= -65536 ? (y[f++] = 57, J.setUint16(f, ~a), f += 2) : (y[f++] = 58, J.setUint32(f, ~a), f += 4);
else {
let I;
if ((I = this.useFloat32) > 0 && a < 4294967296 && a >= -2147483648) {
y[f++] = 250, J.setFloat32(f, a);
let _;
if (I < 4 || (_ = a * It[(y[f] & 127) << 1 | y[f + 1] >> 7]) >> 0 === _) {
f += 4;
return;
} else f--;
}
y[f++] = 251, J.setFloat64(f, a), f += 8;
}
else if (x === "object") if (!a) y[f++] = 246;
else {
if (i) {
let _ = i.get(a);
if (_) {
if (y[f++] = 216, y[f++] = 29, y[f++] = 25, !_.references) {
let T = i.idsToInsert || (i.idsToInsert = []);
_.references = [], T.push(_);
}
_.references.push(f - r), f += 2;
return;
} else i.set(a, { offset: f - r });
}
let I = a.constructor;
if (I === Object) P(a);
else if (I === Array) {
v = a.length, v < 24 ? y[f++] = 128 | v : he(v);
for (let _ = 0; _ < v; _++) m(a[_]);
} else if (I === Map) if ((this.mapsAsObjects ? this.useTag259ForMaps !== false : this.useTag259ForMaps) && (y[f++] = 217, y[f++] = 1, y[f++] = 3), v = a.size, v < 24 ? y[f++] = 160 | v : v < 256 ? (y[f++] = 184, y[f++] = v) : v < 65536 ? (y[f++] = 185, y[f++] = v >> 8, y[f++] = v & 255) : (y[f++] = 186, J.setUint32(f, v), f += 4), c.keyMap) for (let [_, T] of a) m(c.encodeKey(_)), m(T);
else for (let [_, T] of a) m(_), m(T);
else {
for (let _ = 0, T = wt.length; _ < T; _++) {
let u = mr[_];
if (a instanceof u) {
let H = wt[_], B = H.tag;
B == null && (B = H.getTag && H.getTag.call(this, a)), B < 24 ? y[f++] = 192 | B : B < 256 ? (y[f++] = 216, y[f++] = B) : B < 65536 ? (y[f++] = 217, y[f++] = B >> 8, y[f++] = B & 255) : B > -1 && (y[f++] = 218, J.setUint32(f, B), f += 4), H.encode.call(this, a, m, O);
return;
}
}
if (a[Symbol.iterator]) {
if (ct) {
let _ = new Error("Iterable should be serialized as iterator");
throw _.iteratorNotHandled = true, _;
}
y[f++] = 159;
for (let _ of a) m(_);
y[f++] = 255;
return;
}
if (a[Symbol.asyncIterator] || lt(a)) {
let _ = new Error("Iterable/blob should be serialized as iterator");
throw _.iteratorNotHandled = true, _;
}
if (this.useToJSON && a.toJSON) {
const _ = a.toJSON();
if (_ !== a) return m(_);
}
P(a);
}
}
else if (x === "boolean") y[f++] = a ? 245 : 244;
else if (x === "bigint") {
if (a < BigInt(1) << BigInt(64) && a >= 0) y[f++] = 27, J.setBigUint64(f, a);
else if (a > -(BigInt(1) << BigInt(64)) && a < 0) y[f++] = 59, J.setBigUint64(f, -a - BigInt(1));
else if (this.largeBigIntToFloat) y[f++] = 251, J.setFloat64(f, Number(a));
else {
a >= BigInt(0) ? y[f++] = 194 : (y[f++] = 195, a = BigInt(-1) - a);
let I = [];
for (; a; ) I.push(Number(a & BigInt(255))), a >>= BigInt(8);
mt(new Uint8Array(I.reverse()), O);
return;
}
f += 8;
} else if (x === "undefined") y[f++] = 247;
else throw new Error("Unknown type: " + x);
}, P = this.useRecords === false ? this.variableMapSize ? (a) => {
let x = Object.keys(a), v = Object.values(a), I = x.length;
if (I < 24 ? y[f++] = 160 | I : I < 256 ? (y[f++] = 184, y[f++] = I) : I < 65536 ? (y[f++] = 185, y[f++] = I >> 8, y[f++] = I & 255) : (y[f++] = 186, J.setUint32(f, I), f += 4), c.keyMap) for (let _ = 0; _ < I; _++) m(c.encodeKey(x[_])), m(v[_]);
else for (let _ = 0; _ < I; _++) m(x[_]), m(v[_]);
} : (a) => {
y[f++] = 185;
let x = f - r;
f += 2;
let v = 0;
if (c.keyMap) for (let I in a) (typeof a.hasOwnProperty != "function" || a.hasOwnProperty(I)) && (m(c.encodeKey(I)), m(a[I]), v++);
else for (let I in a) (typeof a.hasOwnProperty != "function" || a.hasOwnProperty(I)) && (m(I), m(a[I]), v++);
y[x++ + r] = v >> 8, y[x + r] = v & 255;
} : (a, x) => {
let v, I = s.transitions || (s.transitions = /* @__PURE__ */ Object.create(null)), _ = 0, T = 0, u, H;
if (this.keyMap) {
H = Object.keys(a).map((V) => this.encodeKey(V)), T = H.length;
for (let V = 0; V < T; V++) {
let G = H[V];
v = I[G], v || (v = I[G] = /* @__PURE__ */ Object.create(null), _++), I = v;
}
} else for (let V in a) (typeof a.hasOwnProperty != "function" || a.hasOwnProperty(V)) && (v = I[V], v || (I[ie] & 1048576 && (u = I[ie] & 65535), v = I[V] = /* @__PURE__ */ Object.create(null), _++), I = v, T++);
let B = I[ie];
if (B !== void 0) B &= 65535, y[f++] = 217, y[f++] = B >> 8 | 224, y[f++] = B & 255;
else if (H || (H = I.__keys__ || (I.__keys__ = Object.keys(a))), u === void 0 ? (B = s.nextId++, B || (B = 0, s.nextId = 1), B >= Qt && (s.nextId = (B = h) + 1)) : B = u, s[B] = H, B < h) {
y[f++] = 217, y[f++] = B >> 8 | 224, y[f++] = B & 255, I = s.transitions;
for (let V = 0; V < T; V++) (I[ie] === void 0 || I[ie] & 1048576) && (I[ie] = B), I = I[H[V]];
I[ie] = B | 1048576, o = true;
} else {
if (I[ie] = B, J.setUint32(f, 3655335680), f += 3, _ && (F += R * _), C.length >= Qt - h && (C.shift()[ie] = void 0), C.push(I), he(T + 2), m(57344 + B), m(H), x) return;
for (let V in a) (typeof a.hasOwnProperty != "function" || a.hasOwnProperty(V)) && m(a[V]);
return;
}
if (T < 24 ? y[f++] = 128 | T : he(T), !x) for (let V in a) (typeof a.hasOwnProperty != "function" || a.hasOwnProperty(V)) && m(a[V]);
}, O = (a) => {
let x;
if (a > 16777216) {
if (a - r > $t) throw new Error("Encoded buffer would be larger than maximum buffer size");
x = Math.min($t, Math.round(Math.max((a - r) * (a > 67108864 ? 1.25 : 2), 4194304) / 4096) * 4096);
} else x = (Math.max(a - r << 2, y.length - 1) >> 12) + 1 << 12;
let v = new ft(x);
return J = new DataView(v.buffer, 0, x), y.copy ? y.copy(v, 0, r, a) : v.set(y.slice(r, a)), f -= r, r = 0, be = v.length - 10, y = v;
};
let k = 100, D = 1e3;
this.encodeAsIterable = function(a, x) {
return M(a, x, L);
}, this.encodeAsAsyncIterable = function(a, x) {
return M(a, x, z);
};
function* L(a, x, v) {
let I = a.constructor;
if (I === Object) {
let _ = c.useRecords !== false;
_ ? P(a, true) : er(Object.keys(a).length, 160);
for (let T in a) {
let u = a[T];
_ || m(T), u && typeof u == "object" ? x[T] ? yield* L(u, x[T]) : yield* E(u, x, T) : m(u);
}
} else if (I === Array) {
let _ = a.length;
he(_);
for (let T = 0; T < _; T++) {
let u = a[T];
u && (typeof u == "object" || f - r > k) ? x.element ? yield* L(u, x.element) : yield* E(u, x, "element") : m(u);
}
} else if (a[Symbol.iterator] && !a.buffer) {
y[f++] = 159;
for (let _ of a) _ && (typeof _ == "object" || f - r > k) ? x.element ? yield* L(_, x.element) : yield* E(_, x, "element") : m(_);
y[f++] = 255;
} else lt(a) ? (er(a.size, 64), yield y.subarray(r, f), yield a, U()) : a[Symbol.asyncIterator] ? (y[f++] = 159, yield y.subarray(r, f), yield a, U(), y[f++] = 255) : m(a);
v && f > r ? yield y.subarray(r, f) : f - r > k && (yield y.subarray(r, f), U());
}
function* E(a, x, v) {
let I = f - r;
try {
m(a), f - r > k && (yield y.subarray(r, f), U());
} catch (_) {
if (_.iteratorNotHandled) x[v] = {}, f = r + I, yield* L.call(this, a, x[v]);
else throw _;
}
}
function U() {
k = D, c.encode(null, ut);
}
function M(a, x, v) {
return x && x.chunkThreshold ? k = D = x.chunkThreshold : k = 100, a && typeof a == "object" ? (c.encode(null, ut), v(a, c.iterateProperties || (c.iterateProperties = {}), true)) : [c.encode(a)];
}
async function* z(a, x) {
for (let v of L(a, x, true)) {
let I = v.constructor;
if (I === Yt || I === Uint8Array) yield v;
else if (lt(v)) {
let _ = v.stream().getReader(), T;
for (; !(T = await _.read()).done; ) yield T.value;
} else if (v[Symbol.asyncIterator]) for await (let _ of v) U(), _ ? yield* z(_, x.async || (x.async = {})) : yield c.encode(_);
else yield v;
}
}
}
useBuffer(t) {
y = t, J = new DataView(y.buffer, y.byteOffset, y.byteLength), f = 0;
}
clearSharedData() {
this.structures && (this.structures = []), this.sharedValues && (this.sharedValues = void 0);
}
updateSharedData() {
let t = this.sharedVersion || 0;
this.sharedVersion = t + 1;
let r = this.structures.slice(0), n = new Ar(r, this.sharedValues, this.sharedVersion), o = this.saveShared(n, (s) => (s && s.version || 0) == t);
return o === false ? (n = this.getShared() || {}, this.structures = n.structures || [], this.sharedValues = n.packedValues, this.sharedVersion = n.version, this.structures.nextId = this.structures.length) : r.forEach((s, i) => this.structures[i] = s), o;
}
}
function er(e, t) {
e < 24 ? y[f++] = t | e : e < 256 ? (y[f++] = t | 24, y[f++] = e) : e < 65536 ? (y[f++] = t | 25, y[f++] = e >> 8, y[f++] = e & 255) : (y[f++] = t | 26, J.setUint32(f, e), f += 4);
}
class Ar {
constructor(t, r, n) {
this.structures = t, this.packedValues = r, this.version = n;
}
}
function he(e) {
e < 24 ? y[f++] = 128 | e : e < 256 ? (y[f++] = 152, y[f++] = e) : e < 65536 ? (y[f++] = 153, y[f++] = e >> 8, y[f++] = e & 255) : (y[f++] = 154, J.setUint32(f, e), f += 4);
}
const Hn = typeof Blob > "u" ? function() {
} : Blob;
function lt(e) {
if (e instanceof Hn) return true;
let t = e[Symbol.toStringTag];
return t === "Blob" || t === "File";
}
function De(e, t) {
switch (typeof e) {
case "string":
if (e.length > 3) {
if (t.objectMap[e] > -1 || t.values.length >= t.maxValues) return;
let n = t.get(e);
if (n) ++n.count == 2 && t.values.push(e);
else if (t.set(e, { count: 1 }), t.samplingPackedValues) {
let o = t.samplingPackedValues.get(e);
o ? o.count++ : t.samplingPackedValues.set(e, { count: 1 });
}
}
break;
case "object":
if (e) if (e instanceof Array) for (let n = 0, o = e.length; n < o; n++) De(e[n], t);
else {
let n = !t.encoder.useRecords;
for (var r in e) e.hasOwnProperty(r) && (n && De(r, t), De(e[r], t));
}
break;
case "function":
console.log(e);
}
}
const Un = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
mr = [Date, Set, Error, RegExp, me, ArrayBuffer, Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, typeof BigUint64Array > "u" ? function() {
} : BigUint64Array, Int8Array, Int16Array, Int32Array, typeof BigInt64Array > "u" ? function() {
} : BigInt64Array, Float32Array, Float64Array, Ar];
wt = [{ tag: 1, encode(e, t) {
let r = e.getTime() / 1e3;
(this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[f++] = 26, J.setUint32(f, r), f += 4) : (y[f++] = 251, J.setFloat64(f, r), f += 8);
} }, { tag: 258, encode(e, t) {
let r = Array.from(e);
t(r);
} }, { tag: 27, encode(e, t) {
t([e.name, e.message]);
} }, { tag: 27, encode(e, t) {
t(["RegExp", e.source, e.flags]);
} }, { getTag(e) {
return e.tag;
}, encode(e, t) {
t(e.value);
} }, { encode(e, t, r) {
mt(e, r);
} }, { getTag(e) {
if (e.constructor === Uint8Array && (this.tagUint8Array || ke && this.tagUint8Array !== false)) return 64;
}, encode(e, t, r) {
mt(e, r);
} }, ue(68, 1), ue(69, 2), ue(70, 4), ue(71, 8), ue(72, 1), ue(77, 2), ue(78, 4), ue(79, 8), ue(85, 4), ue(86, 8), { encode(e, t) {
let r = e.packedValues || [], n = e.structures || [];
if (r.values.length > 0) {
y[f++] = 216, y[f++] = 51, he(4);
let o = r.values;
t(o), he(0), he(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
for (let s = 0, i = o.length; s < i; s++) packedObjectMap[o[s]] = s;
}
if (n) {
J.setUint32(f, 3655335424), f += 3;
let o = n.slice(0);
o.unshift(57344), o.push(new me(e.version, 1399353956)), t(o);
} else t(new me(e.version, 1399353956));
} }];
function ue(e, t) {
return !Un && t > 1 && (e -= 4), { tag: e, encode: function(n, o) {
let s = n.byteLength, i = n.byteOffset || 0, l = n.buffer || n;
o(ke ? Ze.from(l, i, s) : new Uint8Array(l, i, s));
} };
}
function mt(e, t) {
let r = e.byteLength;
r < 24 ? y[f++] = 64 + r : r < 256 ? (y[f++] = 88, y[f++] = r) : r < 65536 ? (y[f++] = 89, y[f++] = r >> 8, y[f++] = r & 255) : (y[f++] = 90, J.setUint32(f, r), f += 4), f + r >= y.length && t(f + r), y.set(e.buffer ? e : new Uint8Array(e), f), f += r;
}
function xn(e, t) {
let r, n = t.length * 2, o = e.length - n;
t.sort((s, i) => s.offset > i.offset ? 1 : -1);
for (let s = 0; s < t.length; s++) {
let i = t[s];
i.id = s;
for (let l of i.references) e[l++] = s >> 8, e[l] = s & 255;
}
for (; r = t.pop(); ) {
let s = r.offset;
e.copyWithin(s + n, s, o), n -= 2;
let i = s + n;
e[i++] = 216, e[i++] = 28, o = s;
}
return e;
}
function tr(e, t) {
J.setUint32(Y.position + e, f - Y.position - e + 1);
let r = Y;
Y = null, t(r[0]), t(r[1]);
}
let Ht = new En({ useRecords: false });
Ht.encode;
Ht.encodeAsIterable;
Ht.encodeAsAsyncIterable;
const rr = 512, On = 1024, ut = 2048;
new FinalizationRegistry((e) => e());
var Pe = { exports: {} }, Bn = Pe.exports, nr;
function Fn() {
return nr || (nr = 1, (function(e) {
(function(t, r) {
var n = {};
r(n);
var o = n.default;
for (var s in n) o[s] = n[s];
e.exports = o;
})(Bn, function(t) {
t.__esModule = true, t.digestLength = 32, t.blockSize = 64;
var r = new Uint32Array([1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]);
function n(g, b, p, S, C) {
for (var F, R, m, P, O, k, D, L, E, U, M, z, a; C >= 64; ) {
for (F = b[0], R = b[1], m = b[2], P = b[3], O = b[4], k = b[5], D = b[6], L = b[7], U = 0; U < 16; U++) M = S + U * 4, g[U] = (p[M] & 255) << 24 | (p[M + 1] & 255) << 16 | (p[M + 2] & 255) << 8 | p[M + 3] & 255;
for (U = 16; U < 64; U++) E = g[U - 2], z = (E >>> 17 | E << 15) ^ (E >>> 19 | E << 13) ^ E >>> 10, E = g[U - 15], a = (E >>> 7 | E << 25) ^ (E >>> 18 | E << 14) ^ E >>> 3, g[U] = (z + g[U - 7] | 0) + (a + g[U - 16] | 0);
for (U = 0; U < 64; U++) z = (((O >>> 6 | O << 26) ^ (O >>> 11 | O << 21) ^ (O >>> 25 | O << 7)) + (O & k ^ ~O & D) | 0) + (L + (r[U] + g[U] | 0) | 0) | 0, a = ((F >>> 2 | F << 30) ^ (F >>> 13 | F << 19) ^ (F >>> 22 | F << 10)) + (F & R ^ F & m ^ R & m) | 0, L = D, D = k, k = O, O = P + z | 0, P = m, m = R, R = F, F = z + a | 0;
b[0] += F, b[1] += R, b[2] += m, b[3] += P, b[4] += O, b[5] += k, b[6] += D, b[7] += L, S += 64, C -= 64;
}
return S;
}
var o = (function() {
function g() {
this.digestLength = t.digestLength, this.blockSize = t.blockSize, this.state = new Int32Array(8), this.temp = new Int32Array(64), this.buffer = new Uint8Array(128), this.bufferLength = 0, this.bytesHashed = 0, this.finished = false, this.reset();
}
return g.prototype.reset = function() {
return this.state[0] = 1779033703, this.state[1] = 3144134277, this.state[2] = 1013904242, this.state[3] = 2773480762, this.state[4] = 1359893119, this.state[5] = 2600822924, this.state[6] = 528734635, this.state[7] = 1541459225, this.bufferLength = 0, this.bytesHashed = 0, this.finished = false, this;
}, g.prototype.clean = function() {
for (var b = 0; b < this.buffer.length; b++) this.buffer[b] = 0;
for (var b = 0; b < this.temp.length; b++) this.temp[b] = 0;
this.reset();
}, g.prototype.update = function(b, p) {
if (p === void 0 && (p = b.length), this.finished) throw new Error("SHA256: can't update because hash was finished.");
var S = 0;
if (this.bytesHashed += p, this.bufferLength > 0) {
for (; this.bufferLength < 64 && p > 0; ) this.buffer[this.bufferLength++] = b[S++], p--;
this.bufferLength === 64 && (n(this.temp, this.state, this.buffer, 0, 64), this.bufferLength = 0);
}
for (p >= 64 && (S = n(this.temp, this.state, b, S, p), p %= 64); p > 0; ) this.buffer[this.bufferLength++] = b[S++], p--;
return this;
}, g.prototype.finish = function(b) {
if (!this.finished) {
var p = this.bytesHashed, S = this.bufferLength, C = p / 536870912 | 0, F = p << 3, R = p % 64 < 56 ? 64 : 128;
this.buffer[S] = 128;
for (var m = S + 1; m < R - 8; m++) this.buffer[m] = 0;
this.buffer[R - 8] = C >>> 24 & 255, this.buffer[R - 7] = C >>> 16 & 255, this.buffer[R - 6] = C >>> 8 & 255, this.buffer[R - 5] = C >>> 0 & 255, this.buffer[R - 4] = F >>> 24 & 255, this.buffer[R - 3] = F >>> 16 & 255, this.buffer[R - 2] = F >>> 8 & 255, this.buffer[R - 1] = F >>> 0 & 255, n(this.temp, this.state, this.buffer, 0, R), this.finished = true;
}
for (var m = 0; m < 8; m++) b[m * 4 + 0] = this.state[m] >>> 24 & 255, b[m * 4 + 1] = this.state[m] >>> 16 & 255, b[m * 4 + 2] = this.state[m] >>> 8 & 255, b[m * 4 + 3] = this.state[m] >>> 0 & 255;
return this;
}, g.prototype.digest = function() {
var b = new Uint8Array(this.digestLength);
return this.finish(b), b;
}, g.prototype._saveState = function(b) {
for (var p = 0; p < this.state.length; p++) b[p] = this.state[p];
}, g.prototype._restoreState = function(b, p) {
for (var S = 0; S < this.state.length; S++) this.state[S] = b[S];
this.bytesHashed = p, this.finished = false, this.bufferLength = 0;
}, g;
})();
t.Hash = o;
var s = (function() {
function g(b) {
this.inner = new o(), this.outer = new o(), this.blockSize = this.inner.blockSize, this.digestLength = this.inner.digestLength;
var p = new Uint8Array(this.blockSize);
if (b.length > this.blockSize) new o().update(b).finish(p).clean();
else for (var S = 0; S < b.length; S++) p[S] = b[S];
for (var S = 0; S < p.length; S++) p[S] ^= 54;
this.inner.update(p);
for (var S = 0; S < p.length; S++) p[S] ^= 106;
this.outer.update(p), this.istate = new Uint32Array(8), this.ostate = new Uint32Array(8), this.inner._saveState(this.istate), this.outer._saveState(this.ostate);
for (var S = 0; S < p.length; S++) p[S] = 0;
}
return g.prototype.reset = function() {
return this.inner._restoreState(this.istate, this.inner.blockSize), this.outer._restoreState(this.ostate, this.outer.blockSize), this;
}, g.prototype.clean = function() {
for (var b = 0; b < this.istate.length; b++) this.ostate[b] = this.istate[b] = 0;
this.inner.clean(), this.outer.clean();
}, g.prototype.update = function(b) {
return this.inner.update(b), this;
}, g.prototype.finish = function(b) {
return this.outer.finished ? this.outer.finish(b) : (this.inner.finish(b), this.outer.update(b, this.digestLength).finish(b)), this;
}, g.prototype.digest = function() {
var b = new Uint8Array(this.digestLength);
return this.finish(b), b;
}, g;
})();
t.HMAC = s;
function i(g) {
var b = new o().update(g), p = b.digest();
return b.clean(), p;
}
t.hash = i, t.default = i;
function l(g, b) {
var p = new s(g).update(b), S = p.digest();
return p.clean(), S;
}
t.hmac = l;
function c(g, b, p, S) {
var C = S[0];
if (C === 0) throw new Error("hkdf: cannot expand more");
b.reset(), C > 1 && b.update(g), p && b.update(p), b.update(S), b.finish(g), S[0]++;
}
var w = new Uint8Array(t.digestLength);
function h(g, b, p, S) {
b === void 0 && (b = w), S === void 0 && (S = 32);
for (var C = new Uint8Array([1]), F = l(b, g), R = new s(F), m = new Uint8Array(R.digestLength), P = m.length, O = new Uint8Array(S), k = 0; k < S; k++) P === m.length && (c(m, R, p, C), P = 0), O[k] = m[P++];
return R.clean(), m.fill(0), C.fill(0), O;
}
t.hkdf = h;
function d(g, b, p, S) {
for (var C = new s(g), F = C.digestLength, R = new Uint8Array(4), m = new Uint8Array(F), P = new Uint8Array(F), O = new Uint8Array(S), k = 0; k * F < S; k++) {
var D = k + 1;
R[0] = D >>> 24 & 255, R[1] = D >>> 16 & 255, R[2] = D >>> 8 & 255, R[3] = D >>> 0 & 255, C.reset(), C.update(b), C.update(R), C.finish(P);
for (var L = 0; L < F; L++) m[L] = P[L];
for (var L = 2; L <= p; L++) {
C.reset(), C.update(P).finish(P);
for (var E = 0; E < F; E++) m[E] ^= P[E];
}
for (var L = 0; L < F && k * F + L < S; L++) O[k * F + L] = m[L];
}
for (var k = 0; k < F; k++) m[k] = P[k] = 0;
for (var k = 0; k < 4; k++) R[k] = 0;
return C.clean(), O;
}
t.pbkdf2 = d;
});
})(Pe)), Pe.exports;
}
Fn();
ln("automerge-repo:collectionsync");
export {
Cr as R,
Mn as a,
Ir as u
};