{"version":3,"file":"util-DiEla9R9-Dmmkl_-R.mjs","names":[],"sources":["../../../node_modules/scure-base-2.3.0/index.js","../../connect-core/build/util-DiEla9R9.mjs"],"sourcesContent":["/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Freeze the result of a thunk. `/* @__PURE__ */ freeze(() => expr)` keeps the whole\n// initializer tree-shakable: the annotated call's only argument is a function literal,\n// so bundlers drop everything (inner chain()/alphabet() calls included) when unused.\nconst freeze = (fn) => Object.freeze(fn());\nfunction isBytes(a) {\n    // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. The\n    // fallback still requires a real ArrayBuffer view, so plain JSON-deserialized\n    // `{ constructor: ... }` spoofing is rejected. `BYTES_PER_ELEMENT === 1` keeps the\n    // fallback on byte-oriented views.\n    return (a instanceof Uint8Array ||\n        (ArrayBuffer.isView(a) &&\n            a.constructor.name === 'Uint8Array' &&\n            'BYTES_PER_ELEMENT' in a &&\n            a.BYTES_PER_ELEMENT === 1));\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b) {\n    if (!isBytes(b))\n        throw new TypeError('Uint8Array expected');\n}\nfunction isArrayOf(isString, arr) {\n    if (!Array.isArray(arr))\n        return false;\n    if (arr.length === 0)\n        return true;\n    if (isString) {\n        return arr.every((item) => typeof item === 'string');\n    }\n    else {\n        return arr.every((item) => Number.isSafeInteger(item));\n    }\n}\nfunction afn(input) {\n    if (typeof input !== 'function')\n        throw new TypeError('function expected');\n    return true;\n}\nfunction astr(label, input) {\n    if (typeof input !== 'string')\n        throw new TypeError(`${label}: string expected`);\n    return true;\n}\nfunction anumber(n, title = 'number') {\n    if (typeof n !== 'number')\n        throw new TypeError(`${title}: expected number, got ${typeof n}`);\n    if (!Number.isSafeInteger(n))\n        throw new RangeError(`${title}: expected safe integer, got ${n}`);\n}\nfunction anumArr(label, input) {\n    if (!isArrayOf(false, input))\n        throw new TypeError(`${label}: array of numbers expected`);\n}\nfunction chain(...args) {\n    const id = (a) => a;\n    // Wrap call in closure so JIT can inline calls\n    const wrap = (a, b) => (c) => a(b(c));\n    // Construct chain of args[-1].encode(args[-2].encode([...]))\n    const encode = args.map((x) => x.encode).reduceRight(wrap, id);\n    // Construct chain of args[0].decode(args[1].decode(...))\n    const decode = args.map((x) => x.decode).reduce(wrap, id);\n    return { encode, decode };\n}\nfunction normalize(fn) {\n    afn(fn);\n    return { encode: (from) => from, decode: (to) => fn(to) };\n}\nconst powers = /* @__PURE__ */ (() => {\n    let res = [];\n    for (let i = 0; i < 40; i++)\n        res.push(2 ** i);\n    return res;\n})();\n// Indexed copy loops instead of Array.from / Uint8Array.from: those go through the\n// iterator protocol on typed arrays, which is ~10x slower and would swamp the fast\n// links' gains on the conversion boundaries.\nfunction u8ToNumArr(u8, len = u8.length) {\n    const res = new Array(len);\n    for (let i = 0; i < len; i++)\n        res[i] = u8[i];\n    return res;\n}\n// UTF-8 TextDecoder builds a string from ASCII codes 2x faster than `TextDecoder('latin1')`\n// (4x on freshly allocated, our exact case).\n// All codes here are < 128 (range is validated elsewhere): UTF-8 agrees with ASCII byte-for-byte.\n// UTF-8 needs no ICU, so the probe only guards runtimes without TextDecoder at all (Hermes).\nconst asciiDecoder = /* @__PURE__ */ (() => {\n    try {\n        const decoder = new TextDecoder();\n        // Self-check on the domain we use (codes < 128): reject broken polyfills at\n        // probe time instead of producing corrupted codec output later.\n        return decoder.decode(Uint8Array.of(0x41, 0x30, 0x2b, 0x7f)) === 'A0+\\x7f'\n            ? decoder\n            : undefined;\n    }\n    catch (e) {\n        return undefined;\n    }\n})();\nconst B2S_CHUNK = 8192; // char codes per String.fromCharCode call, avoids arg-count limits\nfunction charcodesToString(codes) {\n    const len = codes.length;\n    // Measured crossover: the TextDecoder's per-call setup dominates below ~12 chars,\n    // where String.fromCharCode wins (bech32 checksums, base58xmr blocks).\n    if (asciiDecoder !== undefined && len >= 12)\n        return asciiDecoder.decode(codes);\n    if (len <= B2S_CHUNK)\n        return String.fromCharCode.apply(null, codes);\n    let res = '';\n    for (let i = 0; i < len; i += B2S_CHUNK)\n        res += String.fromCharCode.apply(null, codes.subarray(i, i + B2S_CHUNK));\n    return res;\n}\n/**\n * Linear 8 <-> bits regrouping (radix2Slow semantics), with Uint8Array digits and\n * preallocated output.\n */\nfunction radix2(bits) {\n    anumber(bits);\n    if (bits <= 0 || bits > 8)\n        throw new RangeError('radix2: bits should be in (0..8]');\n    const mask = powers[bits] - 1;\n    return {\n        encode: (bytes) => {\n            abytes(bytes);\n            const len = bytes.length;\n            // 8->bits with zero-bit padding of the last digit, like convertRadix2(padding=true)\n            const res = new Uint8Array(Math.ceil((len * 8) / bits));\n            let carry = 0;\n            let pos = 0;\n            let j = 0;\n            for (let i = 0; i < len;) {\n                // At most 7 residual bits plus 24 new bits fit in the signed 32-bit carry.\n                if (i + 2 < len) {\n                    carry = (carry << 24) | (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n                    pos += 24;\n                    i += 3;\n                }\n                else {\n                    // Constant mask instead of convertRadix2's exact powers[pos]-1 cleanup: with\n                    // bits <= 8 the residual is pos <= 7 bits, so carry needs at most pos + 8 <= 15\n                    // meaningful bits. Stale bits in [pos, 16) shift to >= bits on extraction and\n                    // are removed by `& mask` there and in the tail below.\n                    carry = ((carry << 8) | bytes[i]) & 0xffff;\n                    pos += 8;\n                    i++;\n                }\n                // Each input adds at least `bits`, so the first extraction is unconditional.\n                for (;;) {\n                    pos -= bits;\n                    res[j++] = (carry >> pos) & mask;\n                    if (pos < bits)\n                        break;\n                }\n            }\n            if (pos > 0)\n                res[j] = (carry << (bits - pos)) & mask;\n            return res;\n        },\n        decode: (digits) => {\n            // bits->8, strict canonical form, like convertRadix2(padding=false):\n            // rejects leftover whole input words and non-zero pad bits.\n            const len = digits.length;\n            const res = new Uint8Array(Math.floor((len * bits) / 8));\n            let carry = 0;\n            let pos = 0;\n            let j = 0;\n            for (let i = 0; i < len; i++) {\n                // Same constant-mask carry bound as encode: pos <= 7 residual plus bits <= 8\n                // incoming keeps meaningful carry within 15 bits; stale bits above pos are\n                // masked out on extraction and in the tail check below.\n                carry = ((carry << bits) | digits[i]) & 0xffff;\n                pos += bits;\n                for (; pos >= 8; pos -= 8)\n                    res[j++] = (carry >> (pos - 8)) & 0xff;\n            }\n            carry = (carry << (8 - pos)) & 0xff;\n            if (pos >= bits)\n                throw new Error('Excess padding');\n            if (carry > 0)\n                throw new Error(`Non-zero padding: ${carry}`);\n            return res;\n        },\n    };\n}\n/**\n * Digit <-> letter mapping fused with string join (chain(alphabetSlow(letters), join(''))\n * semantics), via char-code lookup tables.\n */\nfunction alphabet(letters, aliases) {\n    const len = letters.length;\n    // Larger indexes would wrap in the Int8Array reverse table and decode to wrong digits.\n    if (len > 128)\n        throw new Error('alphabet: max 128 letters');\n    const encTable = new Uint8Array(len);\n    const decTable = new Int8Array(128).fill(-1);\n    for (let i = 0; i < len; i++) {\n        const code = letters.charCodeAt(i);\n        if (letters.codePointAt(i) !== code || code > 127)\n            throw new Error('alphabet: single-char ASCII letters only');\n        encTable[i] = code;\n        decTable[code] = i;\n    }\n    // Aliases decode like their canonical letter (e.g. hex case-folding), without a\n    // separate normalization pass over the input string.\n    if (aliases !== undefined) {\n        for (const alias of Object.keys(aliases)) {\n            const code = alias.charCodeAt(0);\n            const target = decTable[aliases[alias].charCodeAt(0)];\n            if (alias.length !== 1 || code > 127 || target === undefined || target === -1)\n                throw new Error(`alphabet: invalid alias ${alias}`);\n            decTable[code] = target;\n        }\n    }\n    return {\n        encode: (digits) => {\n            const codes = new Uint8Array(digits.length);\n            for (let i = 0; i < digits.length; i++) {\n                const d = digits[i];\n                const code = encTable[d];\n                // Reuse the table lookup's bounds result for the required per-digit range check.\n                // Chained radix2 always emits digits < 2**bits === len; check anyway so a\n                // mismatched chain throws (like alphabetSlow) instead of silently emitting letter 0.\n                if (code === undefined)\n                    throw new Error(`alphabet.encode: invalid digit ${d}`);\n                codes[i] = code;\n            }\n            return charcodesToString(codes);\n        },\n        decode: (input) => {\n            // Uniform label: this is the decode entry link for nopad codecs, padding for padded\n            // ones. Keeps \"decode: string expected\" identical across all built-in codecs\n            // (released 2.x said \"join.decode: string expected\").\n            astr('decode', input);\n            const slen = input.length;\n            const digits = new Uint8Array(slen);\n            for (let i = 0; i < slen; i++) {\n                const code = input.charCodeAt(i);\n                const digit = code < 128 ? decTable[code] : -1;\n                if (digit === -1)\n                    throw new Error(`Unknown letter \"${input[i]}\". Allowed: ${letters}`);\n                digits[i] = digit;\n            }\n            return digits;\n        },\n    };\n}\n/**\n * Pad / unpad (paddingSlow semantics), on the joined string.\n */\nfunction padding(bits, chr = '=') {\n    anumber(bits);\n    astr('padding', chr);\n    return {\n        encode(data) {\n            while ((data.length * bits) % 8)\n                data += chr;\n            return data;\n        },\n        decode(input) {\n            // Uniform label, see alphabet.decode above.\n            astr('decode', input);\n            let end = input.length;\n            if ((end * bits) % 8)\n                throw new Error('padding: invalid length');\n            for (; end > 0 && input[end - 1] === chr; end--) {\n                const byte = (end - 1) * bits;\n                if (byte % 8 === 0)\n                    throw new Error('padding: excess padding');\n            }\n            return input.slice(0, end);\n        },\n    };\n}\nfunction unsafeWrapper(fn) {\n    afn(fn);\n    return function (...args) {\n        // Only for *Unsafe APIs that intentionally collapse validation failures to `undefined`.\n        // Do not wrap code that needs to preserve exception details.\n        try {\n            return fn.apply(null, args);\n        }\n        catch (e) { }\n    };\n}\nfunction checksum(len, fn) {\n    anumber(len);\n    // Reject degenerate zero-byte checksums up front so callers don't accidentally\n    // build a no-op checksum stage.\n    if (len <= 0)\n        throw new RangeError(`checksum length must be positive: ${len}`);\n    afn(fn);\n    const _fn = fn;\n    // Uses the first `len` bytes of fn(data) in both directions.\n    // Current call sites rely on `len > 0` and checksum functions that return at least that many bytes.\n    return {\n        encode(data) {\n            abytes(data);\n            const sum = _fn(data).slice(0, len);\n            const res = new Uint8Array(data.length + len);\n            res.set(data);\n            res.set(sum, data.length);\n            return res;\n        },\n        decode(data) {\n            abytes(data);\n            const payload = data.slice(0, -len);\n            const oldChecksum = data.slice(-len);\n            const newChecksum = _fn(payload).slice(0, len);\n            for (let i = 0; i < len; i++)\n                if (newChecksum[i] !== oldChecksum[i])\n                    throw new Error('Invalid checksum');\n            return payload;\n        },\n    };\n}\n// RFC 4648 aka RFC 3548\n// ---------------------\n/**\n * base16 encoding from RFC 4648.\n * This codec uses RFC 4648 Table 5's uppercase alphabet directly.\n * RFC 4648 §8 calls base16 \"case-insensitive hex encoding\", but we intentionally do not case-fold decode input here.\n * Use `hex` for case-insensitive hex decoding.\n * @example\n * ```js\n * base16.encode(Uint8Array.from([0x12, 0xab]));\n * // => '12AB'\n * ```\n */\nexport const base16 = /* @__PURE__ */ freeze(() => chain(radix2(4), alphabet('0123456789ABCDEF')));\n/**\n * base32 encoding from RFC 4648. Has padding.\n * RFC 4648 §6 Table 3 uses uppercase letters, and RFC 4648 §3.4 allows applications to choose\n * upper- or lowercase alphabets. We keep the published uppercase table and do not case-fold decode input.\n * Use `base32nopad` for unpadded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ===='\n * base32.decode('CKVQ====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32 = /* @__PURE__ */ freeze(() => chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5)));\n/**\n * base32 encoding from RFC 4648. No padding.\n * This variant inherits RFC 4648 base32's uppercase table and intentionally does not case-fold decode input.\n * Use `base32` for padded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ'\n * base32nopad.decode('CKVQ');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32nopad = /* @__PURE__ */ freeze(() => chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567')));\n/**\n * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet.\n * RFC 4648 §7 Table 4 uses uppercase letters, and we intentionally keep that table without case-folding decode input.\n * Use `base32hexnopad` for unpadded version.\n * @example\n * ```js\n * base32hex.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG===='\n * base32hex.decode('2ALG====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hex = /* @__PURE__ */ freeze(() => chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5)));\n/**\n * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet.\n * This variant inherits RFC 4648 base32hex's uppercase table and intentionally does not case-fold decode input.\n * Use `base32hex` for padded version.\n * @example\n * ```js\n * base32hexnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG'\n * base32hexnopad.decode('2ALG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hexnopad = /* @__PURE__ */ freeze(() => chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV')));\n/**\n * base32 encoding from RFC 4648. Doug Crockford's version.\n * See {@link https://www.crockford.com/base32.html | Douglas Crockford's Base32}.\n * @example\n * ```js\n * base32crockford.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ANG'\n * base32crockford.decode('2ANG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32crockford = /* @__PURE__ */ freeze(() => chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), normalize((s) => {\n    astr('base32crockford.decode', s);\n    return s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1');\n})));\n// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64\n// Require both directions before taking the native fast path, so base64/base64url don't mix native and JS behavior.\n// prettier-ignore\nconst hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' &&\n    typeof Uint8Array.fromBase64 === 'function')();\n// Native `Uint8Array.fromBase64()` accepts these ASCII whitespace chars.\n// Reject them first so the native base64 path still follows RFC 4648 §3.3.\n// ASCII whitespace is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE\nconst ASCII_WHITESPACE = /[\\t\\n\\f\\r ]/;\nconst decodeBase64Builtin = (s, isUrl) => {\n    astr('base64', s);\n    const alphabet = isUrl ? 'base64url' : 'base64';\n    // Per spec, .fromBase64 already throws on any other non-alphabet symbols except ASCII whitespace\n    // And checking just for whitespace makes decoding about 3x faster than a full range check.\n    // lastChunkHandling: 'strict' rejects loose tails and non-zero pad bits so native decoding stays canonical.\n    if (s.length > 0 && ASCII_WHITESPACE.test(s))\n        throw new Error('invalid base64');\n    return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' });\n};\n/** base64 from RFC 4648. Padded. Pure JS version */\nconst base64Fallback = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6)));\n/**\n * base64 from RFC 4648. Padded.\n * Alternative variants: `base64nopad`, `base64url`, `base64urlnopad`.\n * Utilizes native `Uint8Array.fromBase64` builtin, otherwise falls back to `base64fallback` when it's unavailable.\n * @example\n * ```js\n * base64.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64 = /* @__PURE__ */ freeze(() => hasBase64Builtin ? {\n    encode(b) { abytes(b); return b.toBase64(); },\n    decode(s) { return decodeBase64Builtin(s, false); },\n} : base64Fallback);\n/**\n * base64 from RFC 4648. No padding.\n * Use `base64` for padded version.\n * @example\n * ```js\n * base64nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64nopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64nopad = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. Padded.\n * Use `base64urlnopad` for unpadded version.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64url.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64url.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64url = /* @__PURE__ */ freeze(() => hasBase64Builtin ? {\n    encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); },\n    decode(s) { return decodeBase64Builtin(s, true); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6)));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. No padding.\n * Use `base64url` for padded version.\n * @example\n * ```js\n * base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64urlnopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64urlnopad = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_')));\n// base58 code\n// -----------\n// Base conversion 256 <-> 58 done on 16-bit limbs, five base58 digits (one divmod by\n// 58**5) per pass, ~10x fewer inner-loop iterations than digit-at-a-time conversion.\n// Exactness: every intermediate is a non-negative integer below 2**53, so float64\n// arithmetic (including Math.floor of the quotients) is exact:\n// - encode: carry * 2**16 + limb < 58**5 * 2**16 < 2**46\n// - decode: limb * 58**5 + carry < 2**16 * 58**5 + 2**30 < 2**46\n// Still O(n^2) overall like any positional-base conversion — see the base58 DoS note.\nconst B58_GROUP = 656356768; // 58**5 < 2**30; literal (not `58 ** 5`) so bundlers can drop it as dead code\nconst radix58 = {\n    encode: (bytes) => {\n        abytes(bytes);\n        const blen = bytes.length;\n        if (blen === 0)\n            return new Uint8Array(0);\n        // Leading zero bytes map 1:1 to leading zero digits (at most blen-1 explicit zeros;\n        // an all-zero value still contributes one digit below).\n        let zeros = 0;\n        while (zeros < blen - 1 && bytes[zeros] === 0)\n            zeros++;\n        // Pack big-endian 16-bit limbs; odd length makes the top limb a single byte.\n        const nlimbs = Math.ceil(blen / 2);\n        const limbs = new Uint16Array(nlimbs);\n        const odd = blen & 1;\n        if (odd)\n            limbs[0] = bytes[0];\n        for (let i = odd, j = odd; i < blen; i += 2, j++)\n            limbs[j] = (bytes[i] << 8) | bytes[i + 1];\n        // Repeated divmod by 58**5; each pass emits one 5-digit group, least significant\n        // first. No carry-overflow guard like convertRadix had: that one faced arbitrary\n        // caller-chosen bases, while these bounds are static and proven exact above.\n        const groups = [];\n        let pos = 0; // limbs before pos are known zero\n        while (pos < nlimbs) {\n            let carry = 0;\n            for (let i = pos; i < nlimbs; i++) {\n                const cur = carry * 0x10000 + limbs[i];\n                const q = Math.floor(cur / B58_GROUP);\n                carry = cur - q * B58_GROUP;\n                limbs[i] = q;\n                if (q === 0 && i === pos)\n                    pos++;\n            }\n            groups.push(carry);\n        }\n        // The top group is nonzero unless the whole value is zero, so total significant\n        // digit count is 5 per full group plus the top group's own width. (Writing 5 digits\n        // per group and trimming via subarray is smaller code, but the offset view slows\n        // encode ~25% and base58xmr 2x — measured.)\n        const top = groups.length - 1;\n        let sig = top * 5;\n        for (let v = groups[top];; v = Math.floor(v / 58)) {\n            sig++;\n            if (v < 58)\n                break;\n        }\n        const res = new Uint8Array(zeros + sig); // leading zero digits are already 0\n        let j = res.length - 1;\n        for (let g = 0; g < top; g++) {\n            let v = groups[g];\n            for (let k = 0; k < 5; k++) {\n                res[j--] = v % 58;\n                v = Math.floor(v / 58);\n            }\n        }\n        for (let v = groups[top]; j >= zeros; v = Math.floor(v / 58))\n            res[j--] = v % 58;\n        return res;\n    },\n    decode: (digits) => {\n        abytes(digits);\n        const dlen = digits.length;\n        if (dlen === 0)\n            return new Uint8Array(0);\n        if (dlen >= 65536)\n            throw new Error('invalid length');\n        let zeros = 0;\n        while (zeros < dlen - 1 && digits[zeros] === 0)\n            zeros++;\n        // Multiply-accumulate 16-bit limbs (little-endian, `used` live) group by group,\n        // most significant group first; the first group may be shorter than 5 digits, and\n        // its 58**group factor falls out of the digit fold.\n        const limbs = new Uint16Array(Math.ceil((dlen * 6) / 16) + 1);\n        let used = 0;\n        let i = 0;\n        let group = dlen % 5 || 5;\n        while (i < dlen) {\n            let gval = 0;\n            let factor = 1;\n            for (const end = i + group; i < end; i++) {\n                const d = digits[i];\n                // Unreachable through the public chain (alphabet emits digits < 58); guards\n                // internal misuse from silently corrupting output.\n                if (d >= 58)\n                    throw new Error(`invalid integer: ${d}`);\n                gval = gval * 58 + d;\n                factor *= 58;\n            }\n            group = 5;\n            let carry = gval;\n            for (let k = 0; k < used; k++) {\n                const cur = limbs[k] * factor + carry;\n                carry = Math.floor(cur / 0x10000);\n                limbs[k] = cur - carry * 0x10000;\n            }\n            for (; carry > 0; carry = Math.floor(carry / 0x10000))\n                limbs[used++] = carry % 0x10000;\n        }\n        // used === 0 means the value is zero: it still contributes one byte, like a lone\n        // zero digit does.\n        const valueBytes = used === 0 ? 1 : used * 2 - (limbs[used - 1] < 256 ? 1 : 0);\n        const res = new Uint8Array(zeros + valueBytes); // leading zero bytes are already 0\n        let j = res.length - 1;\n        for (let k = 0; k < used; k++) {\n            const limb = limbs[k];\n            res[j--] = limb & 0xff;\n            if (j >= zeros)\n                res[j--] = limb >> 8;\n        }\n        return res;\n    },\n};\nconst genBase58 = (abc) => chain(radix58, alphabet(abc));\n/**\n * base58: base64 without ambigous characters +, /, 0, O, I, l.\n * Quadratic (O(n^2)) - so, can't be used on large inputs.\n * @example\n * ```js\n * const text = base58.encode(Uint8Array.from([0, 1, 2]));\n * base58.decode(text);\n * // => Uint8Array.from([0, 1, 2])\n * ```\n */\nexport const base58 = /* @__PURE__ */ freeze(() => genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'));\n/**\n * base58: flickr version. Check out `base58`.\n * @example\n * Round-trip bytes with the Flickr alphabet.\n * ```ts\n * const text = base58flickr.encode(Uint8Array.from([0, 1, 2]));\n * base58flickr.decode(text);\n * ```\n */\nexport const base58flickr = /* @__PURE__ */ freeze(() => genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'));\n/**\n * base58: XRP version. Check out `base58`.\n * @example\n * Round-trip bytes with the XRP alphabet.\n * ```ts\n * const text = base58xrp.encode(Uint8Array.from([0, 1, 2]));\n * base58xrp.decode(text);\n * ```\n */\nexport const base58xrp = /* @__PURE__ */ freeze(() => genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'));\n// Data len (index) -> encoded block len.\n// Monero pads each 1..8-byte block to this fixed base58 width so decode can recover the tail length.\nconst XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11];\n/**\n * base58: XMR version. Check out `base58`.\n * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN.\n * Block encoding significantly reduces quadratic complexity of base58.\n * @example\n * Round-trip bytes with the Monero block codec.\n * ```ts\n * const text = base58xmr.encode(Uint8Array.from([0, 1, 2]));\n * base58xmr.decode(text);\n * ```\n */\nexport const base58xmr = /* @__PURE__ */ freeze(() => ({\n    encode(data) {\n        abytes(data);\n        let res = '';\n        for (let i = 0; i < data.length; i += 8) {\n            const block = data.subarray(i, i + 8);\n            res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1');\n        }\n        return res;\n    },\n    decode(str) {\n        astr('base58xmr.decode', str);\n        const strLen = str.length;\n        // Only the last block may be short, and only to one of the XMR_BLOCK_LEN widths —\n        // so the output length is known up front and blocks write into place. Growing a\n        // number[] via concat per block was quadratic; this keeps decode linear like the\n        // block encoding always intended.\n        const tailChars = strLen % 11;\n        const tailBytes = tailChars === 0 ? 0 : XMR_BLOCK_LEN.indexOf(tailChars);\n        if (tailBytes === -1)\n            throw new Error(`base58xmr: invalid block length ${tailChars}`);\n        const res = new Uint8Array(Math.floor(strLen / 11) * 8 + tailBytes);\n        let w = 0;\n        for (let i = 0; i < strLen; i += 11) {\n            const slice = str.slice(i, i + 11);\n            const blockLen = slice.length === 11 ? 8 : tailBytes;\n            const block = base58.decode(slice);\n            for (let j = 0; j < block.length - blockLen; j++) {\n                if (block[j] !== 0)\n                    throw new Error('base58xmr: wrong padding');\n            }\n            for (let j = block.length - blockLen; j < block.length; j++)\n                res[w++] = block[j];\n        }\n        return res;\n    },\n}));\n/**\n * Method, which creates base58check encoder.\n * Requires function, calculating sha256.\n * Callers must include any version bytes in `data`; this helper only applies the\n * 4-byte double-SHA256 checksum used by Bitcoin Base58Check.\n * @param sha256 - Function used to calculate the checksum hash.\n * @returns base58check codec using 4 checksum bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Create a base58check codec from a SHA-256 implementation.\n * ```ts\n * import { createBase58check } from '@scure/base';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const coder = createBase58check(sha256);\n * coder.encode(Uint8Array.from([1, 2, 3]));\n * ```\n */\nexport const createBase58check = (sha256) => {\n    // Validate the hash function at construction time so wrong inputs fail before returning a coder.\n    afn(sha256);\n    const _sha256 = sha256;\n    return chain(checksum(4, (data) => _sha256(_sha256(data))), base58);\n};\n/**\n * Use `createBase58check` instead.\n * @deprecated Use {@link createBase58check} instead.\n * Callers must include any version bytes in `data`; this alias keeps the same\n * 4-byte double-SHA256 checksum behavior as `createBase58check`.\n * @param sha256 - Function used to calculate the checksum hash.\n * @returns base58check codec using 4 checksum bytes.\n * @example\n * Create a base58check codec with the deprecated alias.\n * ```ts\n * import { base58check } from '@scure/base';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const coder = base58check(sha256);\n * coder.encode(Uint8Array.from([1, 2, 3]));\n * ```\n */\nexport const base58check = createBase58check;\n// BIP 173 character table.\n// Callers adapt the public number[] words API to Uint8Array at the edges (wordsToU8 below):\n// feeding number[] into alphabet.encode would work at runtime, but it turns the shared\n// hot loop polymorphic and measurably slows the RFC 4648 codecs using the same literal.\nconst BECH_ALPHABET = /* @__PURE__ */ alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l');\n// Range-checks while packing: a plain copy would silently wrap out-of-range words\n// (256 -> 0 would encode to a valid letter). Same message the old slow alphabet threw.\nfunction wordsToU8(words) {\n    const len = words.length;\n    const res = new Uint8Array(len);\n    for (let i = 0; i < len; i++) {\n        const w = words[i];\n        if (w < 0 || w >= 32)\n            throw new Error(`alphabet.encode: invalid digit ${w}`);\n        res[i] = w;\n    }\n    return res;\n}\n// BIP 173 `bech32_polymod` GEN coefficients.\nconst POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3];\n// BIP 173 step split: this applies the polymod state transition before callers xor in the next 5-bit value.\nfunction bech32Polymod(pre) {\n    const b = pre >> 25;\n    let chk = (pre & 0x1ffffff) << 5;\n    for (let i = 0; i < POLYMOD_GENERATORS.length; i++) {\n        if (((b >> i) & 1) === 1)\n            chk ^= POLYMOD_GENERATORS[i];\n    }\n    return chk;\n}\nfunction bechChecksum(prefix, words, encodingConst = 1) {\n    const len = prefix.length;\n    let chk = 1;\n    for (let i = 0; i < len; i++) {\n        const c = prefix.charCodeAt(i);\n        if (c < 33 || c > 126)\n            throw new Error(`Invalid prefix (${prefix})`);\n        chk = bech32Polymod(chk) ^ (c >> 5);\n    }\n    chk = bech32Polymod(chk);\n    for (let i = 0; i < len; i++)\n        chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f);\n    for (let v of words)\n        chk = bech32Polymod(chk) ^ v;\n    for (let i = 0; i < 6; i++)\n        chk = bech32Polymod(chk);\n    // BIP 173/BIP 350: xor the final checksum constant, then emit the 30-bit state as six 5-bit symbols.\n    chk ^= encodingConst;\n    const sum = new Uint8Array(6);\n    for (let i = 0; i < 6; i++)\n        sum[i] = (chk >>> (5 * (5 - i))) & 31;\n    return BECH_ALPHABET.encode(sum);\n}\nfunction genBech32(encoding) {\n    // BIP 173 uses final xor constant 1; BIP 350 swaps in 0x2bc830a3 for Bech32m.\n    const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3;\n    // Public API words are number[], so adapt the fast radix2's Uint8Array protocol at the edge.\n    const _words = radix2(5);\n    const toWords = (from) => {\n        abytes(from);\n        // Dedicated 8->5 regrouping (radix2(5).encode semantics) writing the public number[]\n        // directly; encode-into-Uint8Array plus a copy loop measurably regressed this hot path.\n        const len = from.length;\n        const res = new Array(Math.ceil((len * 8) / 5));\n        let carry = 0;\n        let pos = 0;\n        let j = 0;\n        for (let i = 0; i < len; i++) {\n            // No carry cleanup needed: stale bits sit above pos and every extraction (including\n            // the tail below) masks with `& 31`, so they never reach the output. Masking carry\n            // here measurably slowed the loop.\n            carry = (carry << 8) | from[i];\n            pos += 8;\n            for (; pos >= 5; pos -= 5)\n                res[j++] = (carry >> (pos - 5)) & 31;\n        }\n        if (pos > 0)\n            res[j] = (carry << (5 - pos)) & 31;\n        return res;\n    };\n    const fromWords = (to) => {\n        anumArr('radix2.decode', to);\n        // Range-check while packing into the byte buffer: a plain copy would silently\n        // truncate out-of-range words. Rejecting negatives is a deliberate fix — the old\n        // convertRadix2 path silently corrupted output for them.\n        const len = to.length;\n        const digits = new Uint8Array(len);\n        for (let i = 0; i < len; i++) {\n            const w = to[i];\n            if (w < 0 || w >= 32)\n                throw new Error(`convertRadix2: invalid word=${w}`);\n            digits[i] = w;\n        }\n        return _words.decode(digits);\n    };\n    const fromWordsUnsafe = unsafeWrapper(fromWords);\n    function encode(prefix, words, limit = 90) {\n        astr('bech32.encode prefix', prefix);\n        if (limit !== false)\n            anumber(limit, 'limit');\n        if (isBytes(words))\n            words = u8ToNumArr(words);\n        anumArr('bech32.encode', words);\n        const plen = prefix.length;\n        if (plen === 0)\n            throw new TypeError(`Invalid prefix length ${plen}`);\n        // Total output is hrp + `1` separator + payload words + 6 checksum chars.\n        const actualLength = plen + 7 + words.length;\n        if (limit !== false && actualLength > limit)\n            throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);\n        const lowered = prefix.toLowerCase();\n        const sum = bechChecksum(lowered, words, ENCODING_CONST);\n        return `${lowered}1${BECH_ALPHABET.encode(wordsToU8(words))}${sum}`;\n    }\n    function decode(str, limit = 90) {\n        astr('bech32.decode input', str);\n        if (limit !== false)\n            anumber(limit, 'limit');\n        const slen = str.length;\n        // Minimum length is 1-char hrp + `1` separator + 6-char checksum.\n        if (slen < 8 || (limit !== false && slen > limit))\n            throw new TypeError(`invalid string length ${slen}, expected (8..${limit})`);\n        // don't allow mixed case\n        const lowered = str.toLowerCase();\n        if (str !== lowered && str !== str.toUpperCase())\n            throw new Error(`mixed-case string not allowed`);\n        const sepIndex = lowered.lastIndexOf('1');\n        if (sepIndex === 0 || sepIndex === -1)\n            throw new Error(`invalid separator \"1\"`);\n        const prefix = lowered.slice(0, sepIndex);\n        const data = lowered.slice(sepIndex + 1);\n        if (data.length < 6)\n            throw new Error('invalid data length');\n        const digits = BECH_ALPHABET.decode(data);\n        const words = u8ToNumArr(digits, digits.length - 6);\n        const sum = bechChecksum(prefix, words, ENCODING_CONST);\n        if (!data.endsWith(sum))\n            throw new Error(`Invalid checksum in ${str}`);\n        return { prefix, words };\n    }\n    const decodeUnsafe = unsafeWrapper(decode);\n    function decodeToBytes(str) {\n        // Keep the byte helper unbounded; callers that need the default BIP 173 length cap should use decode(str).\n        const { prefix, words } = decode(str, false);\n        return {\n            prefix,\n            words,\n            bytes: fromWords(words),\n        };\n    }\n    function encodeFromBytes(prefix, bytes) {\n        // Keep the convenience wrapper on encode()'s default 90-char cap; custom limits should call encode(prefix, toWords(bytes), limit).\n        return encode(prefix, toWords(bytes));\n    }\n    return {\n        encode,\n        decode,\n        encodeFromBytes,\n        decodeToBytes,\n        decodeUnsafe,\n        fromWords,\n        fromWordsUnsafe,\n        toWords,\n    };\n}\n/**\n * bech32 from BIP 173. Operates on words.\n * For high-level helpers, check out {@link https://github.com/paulmillr/scure-btc-signer | scure-btc-signer}.\n * @example\n * Convert bytes to words, encode them, then decode back.\n * ```ts\n * const words = bech32.toWords(Uint8Array.from([1, 2, 3]));\n * const text = bech32.encode('bc', words);\n * bech32.decode(text);\n * ```\n */\nexport const bech32 = /* @__PURE__ */ freeze(() => genBech32('bech32'));\n/**\n * bech32m from BIP 350. Operates on words.\n * It was to mitigate `bech32` weaknesses.\n * For high-level helpers, check out {@link https://github.com/paulmillr/scure-btc-signer | scure-btc-signer}.\n * @example\n * Convert bytes to words, encode them with bech32m, then decode back.\n * ```ts\n * const words = bech32m.toWords(Uint8Array.from([1, 2, 3]));\n * const text = bech32m.encode('bc', words);\n * bech32m.decode(text);\n * ```\n */\nexport const bech32m = /* @__PURE__ */ freeze(() => genBech32('bech32m'));\n/**\n * ASCII-to-byte decoder. Rejects non-ASCII text and bytes instead of doing UTF-8 replacement.\n * Method names follow `BytesCoder`, so `encode(bytes)` returns a string and `decode(string)` returns bytes.\n * @example\n * ```js\n * const b = ascii.decode(\"ABC\"); // => new Uint8Array([ 65, 66, 67 ])\n * const str = ascii.encode(b); // \"ABC\"\n * ```\n */\nexport const ascii = /* @__PURE__ */ freeze(() => ({\n    encode(data) {\n        abytes(data);\n        for (let i = 0; i < data.length; i++) {\n            const byte = data[i];\n            // ASCII is 7-bit; reject bytes outside 0x00..0x7f instead of silently widening to\n            // Latin-1/UTF-8. Validating up front keeps the error position exact while the\n            // string itself is built in bulk (~3x faster at 1KB than per-char concat).\n            if (byte > 127)\n                throw new RangeError(`non-ASCII byte ${byte} at ${i}`);\n        }\n        return charcodesToString(data);\n    },\n    decode(str) {\n        if (typeof str !== 'string')\n            throw new TypeError('ascii string expected, got ' + typeof str);\n        const res = new Uint8Array(str.length);\n        for (let i = 0; i < str.length; i++) {\n            // Indexed access is much faster than Uint8Array.from(str, mapFn) here and keeps\n            // exact error positions.\n            const charCode = str.charCodeAt(i);\n            if (charCode > 127)\n                throw new RangeError(`non-ASCII char \"${str[i]}\" (${charCode}) at ${i}`);\n            res[i] = charCode;\n        }\n        return res;\n    },\n}));\nconst _isWellFormedShim = (str) => {\n    // encodeURI rejects malformed UTF-16, giving a compact fallback that matches native\n    // isWellFormed on our tests/fuzz corpus.\n    try {\n        return encodeURI(str) !== null;\n    }\n    catch {\n        return false;\n    }\n};\nconst _isWellFormed = /* @__PURE__ */ (() => \n// Pick the native check once so utf8.decode doesn't re-probe String.prototype on every call.\ntypeof ''.isWellFormed === 'function'\n    ? (str) => str.isWellFormed()\n    : _isWellFormedShim)();\n// This fallback stays small because strict UTF-8 only needs fatal decoding plus well-formed\n// UTF-16 checks, not the replacement, streaming, or legacy-encoding behavior of full platform\n// text codecs.\nconst utf8err = (i) => new TypeError(`invalid utf8 at byte ${i}`);\nconst utf8Fallback = /* @__PURE__ */ freeze(() => ({\n    encode(data) {\n        abytes(data);\n        let res = '';\n        for (let i = 0; i < data.length;) {\n            const a = data[i++];\n            if (a < 0b1000_0000) {\n                res += String.fromCharCode(a);\n                continue;\n            }\n            if (a < 0b1100_0010 || i >= data.length)\n                throw utf8err(i - 1);\n            const b = data[i++];\n            if ((b & 0b1100_0000) !== 0b1000_0000)\n                throw utf8err(i - 1);\n            let cp = ((a & 0b0001_1111) << 6) | (b & 0b0011_1111);\n            if (a >= 0b1110_0000) {\n                if (i >= data.length)\n                    throw utf8err(i - 1);\n                const c = data[i++];\n                if ((c & 0b1100_0000) !== 0b1000_0000 ||\n                    (a === 0b1110_0000 && b < 0b1010_0000) ||\n                    (a === 0xed && b >= 0b1010_0000))\n                    throw utf8err(i - 1);\n                cp = ((a & 0b0000_1111) << 12) | ((b & 0b0011_1111) << 6) | (c & 0b0011_1111);\n                if (a >= 0b1111_0000) {\n                    if (i >= data.length)\n                        throw utf8err(i - 1);\n                    const d = data[i++];\n                    if (a > 0b1111_0100 ||\n                        (d & 0b1100_0000) !== 0b1000_0000 ||\n                        (a === 0b1111_0000 && b < 0b1001_0000) ||\n                        (a === 0b1111_0100 && b >= 0b1001_0000))\n                        throw utf8err(i - 1);\n                    cp =\n                        ((a & 7) << 18) |\n                            ((b & 0b0011_1111) << 12) |\n                            ((c & 0b0011_1111) << 6) |\n                            (d & 0b0011_1111);\n                }\n            }\n            if (cp < 0x10000)\n                res += String.fromCharCode(cp);\n            else {\n                cp -= 0x10000;\n                res += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);\n            }\n        }\n        return res;\n    },\n    decode(str) {\n        astr('utf8', str);\n        if (!_isWellFormed(str))\n            throw new TypeError('utf8 expected well-formed string');\n        // Direct Uint8Array writes are much faster than number[] + Uint8Array.from on Hermes and\n        // large Node inputs.\n        const res = new Uint8Array(str.length * 3);\n        let pos = 0;\n        for (let i = 0; i < str.length; i++) {\n            let c = str.charCodeAt(i);\n            if (c < 0b1000_0000) {\n                res[pos++] = c;\n                continue;\n            }\n            if (c >= 0xd800 && c <= 0xdfff) {\n                const d = str.charCodeAt(++i);\n                c = 0x10000 + ((c - 0xd800) << 10) + d - 0xdc00;\n            }\n            if (c >= 0x10000) {\n                res[pos++] = (c >> 18) | 0b1111_0000;\n                res[pos++] = ((c >> 12) & 0b0011_1111) | 0b1000_0000;\n            }\n            else if (c >= 0x800)\n                res[pos++] = (c >> 12) | 0b1110_0000;\n            else\n                res[pos++] = (c >> 6) | 0b1100_0000;\n            if (c >= 0x800)\n                res[pos++] = ((c >> 6) & 0b0011_1111) | 0b1000_0000;\n            res[pos++] = (c & 0b0011_1111) | 0b1000_0000;\n        }\n        return res.subarray(0, pos);\n    },\n}));\n/**\n * Strict UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder when available.\n * Method names follow `BytesCoder`, so `encode(bytes)` returns a string and\n * `decode(string)` returns bytes.\n * `encode(bytes)` requires Uint8Array input, preserves an explicit leading BOM, and\n *   throws on invalid UTF-8 bytes.\n * `decode(string)` requires a primitive string and throws on malformed UTF-16 strings with\n *   lone surrogates.\n * @example\n * ```js\n * const b = utf8.decode(\"hey\"); // => new Uint8Array([ 104, 101, 121 ])\n * const str = utf8.encode(b); // \"hey\"\n * ```\n */\nexport const utf8 = /* @__PURE__ */ freeze(() => {\n    let _utf8Encoder;\n    let _utf8Decoder;\n    const utf8Builtin = {\n        // ignoreBOM preserves an explicit leading U+FEFF;\n        // fatal rejects invalid UTF-8 bytes instead of replacing them.\n        encode(data) {\n            abytes(data);\n            return (_utf8Decoder || (_utf8Decoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }))).decode(data);\n        },\n        decode(str) {\n            astr('utf8', str);\n            if (!_isWellFormed(str))\n                throw new TypeError('utf8 expected well-formed string');\n            return (_utf8Encoder || (_utf8Encoder = new TextEncoder())).encode(str);\n        },\n    };\n    return {\n        // Select each direction once at module init, since\n        // TextEncoder and TextDecoder can exist independently.\n        encode: typeof TextDecoder === 'function' ? utf8Builtin.encode : utf8Fallback.encode,\n        decode: typeof TextEncoder === 'function' ? utf8Builtin.decode : utf8Fallback.decode,\n    };\n});\n// Keep internal parity probes behind a test-only export.\nexport const __TESTS = /* @__PURE__ */ freeze(() => ({\n    alphabet: alphabet,\n    base64Fallback: base64Fallback,\n    radix2: radix2,\n    radix58: radix58,\n    checksum: checksum,\n    utf8Fallback: utf8Fallback,\n    _isWellFormedShim: _isWellFormedShim,\n}));\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\n// prettier-ignore\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// Require both directions before enabling the native hex path so encode/decode stay symmetric.\ntypeof Uint8Array.from([]).toHex === 'function' &&\n    typeof Uint8Array.fromHex === 'function')();\n// prettier-ignore\nconst hexBuiltin = {\n    // Keep local type guards so the native path preserves library-level input errors.\n    // Native toHex emits lowercase hex, matching the fallback alphabet and Node's hex strings.\n    encode(data) { abytes(data); return data.toHex(); },\n    // Native fromHex accepts either hex case and rejects odd-length / non-hex syntax.\n    decode(s) { astr('hex', s); return Uint8Array.fromHex(s); },\n};\n/**\n * hex string decoder. Uses built-in function, when available.\n * Lowercase codec; unlike `base16`, this variant accepts either hex case and emits lowercase.\n * @example\n * ```js\n * const b = hex.decode(\"0102ff\"); // => new Uint8Array([ 1, 2, 255 ])\n * const str = hex.encode(b); // \"0102ff\"\n * ```\n */\nexport const hex = /* @__PURE__ */ freeze(() => hasHexBuiltin\n    ? hexBuiltin\n    : chain(radix2(4), \n    // Case-insensitive decode via table aliases instead of a toLowerCase pass.\n    alphabet('0123456789abcdef', { A: 'a', B: 'b', C: 'c', D: 'd', E: 'e', F: 'f' }), normalize((s) => {\n        // astr first: same non-string message as the native path, and no `s.length`\n        // access on null / undefined while building the error.\n        astr('hex', s);\n        if (s.length % 2 !== 0)\n            throw new TypeError(`hex.decode: odd-length string (${s.length})`);\n        return s;\n    })));\n","import { base64, base64urlnopad } from \"scure-base-2.3.0\";\nimport * as v from \"valibot\";\n//#region src/util/data_type/string/nullEmpty.ts\nconst notNullEmpty = (str) => {\n\treturn str != null && str.length > 0;\n};\n//#endregion\n//#region src/util/crypto/x25519/createSharedBitsFromX25519.ts\nconst createSharedBitsFromX25519 = async ({ privateKey, publicKey }) => {\n\treturn new Uint8Array(await crypto.subtle.deriveBits({\n\t\tname: \"X25519\",\n\t\tpublic: publicKey\n\t}, privateKey, 256));\n};\n//#endregion\n//#region src/util/crypto/aes_gcm/createAesGcmKeyFromX25519Keys.ts\nconst DEFAULT_INFO_STRING = \"METEOR_BRIDGE_DEFAULT_INFO_STRING\";\nconst createAesGcmKeyFromX25519Keys = async ({ externalX25519PublicKey, internalX25519PrivateKey, infoString, saltString }) => {\n\tconst sharedBits = await createSharedBitsFromX25519({\n\t\tprivateKey: internalX25519PrivateKey,\n\t\tpublicKey: externalX25519PublicKey\n\t});\n\tconst ikm = await crypto.subtle.importKey(\"raw\", new Uint8Array(sharedBits), \"HKDF\", false, [\"deriveKey\"]);\n\tconst salt = notNullEmpty(saltString) ? new TextEncoder().encode(saltString) : /* @__PURE__ */ new Uint8Array();\n\tconst info = new TextEncoder().encode(notNullEmpty(infoString) ? infoString : DEFAULT_INFO_STRING);\n\treturn await crypto.subtle.deriveKey({\n\t\tname: \"HKDF\",\n\t\thash: \"SHA-256\",\n\t\tsalt,\n\t\tinfo\n\t}, ikm, {\n\t\tname: \"AES-GCM\",\n\t\tlength: 256\n\t}, false, [\"encrypt\", \"decrypt\"]);\n};\n//#endregion\n//#region src/util/crypto/aes_gcm/decryptBytesWithAesGcmKey.ts\n/**\n* Decrypts a raw-bytes AES-GCM payload (binary nonce + ciphertext) back to bytes. The counterpart of\n* {@link decryptTextDataWithAesGcmKey}. AES-GCM verifies integrity, so a tampered ciphertext throws.\n*/\nconst decryptBytesWithAesGcmKey = async ({ aesGcmKey, dataToDecrypt }) => {\n\tconst decryptedData = await crypto.subtle.decrypt({\n\t\tname: \"AES-GCM\",\n\t\tiv: new Uint8Array(dataToDecrypt.nonce)\n\t}, aesGcmKey, new Uint8Array(dataToDecrypt.ciphertext));\n\treturn new Uint8Array(decryptedData);\n};\n//#endregion\n//#region src/util/crypto/aes_gcm/decryptTextDataWithAesGcmKey.ts\nconst decryptTextDataWithAesGcmKey = async ({ aesGcmKey, dataToDecrypt }) => {\n\tconst decryptedData = await crypto.subtle.decrypt({\n\t\tname: \"AES-GCM\",\n\t\tiv: new Uint8Array(base64.decode(dataToDecrypt.nonce))\n\t}, aesGcmKey, new Uint8Array(base64.decode(dataToDecrypt.ciphertext)));\n\treturn new TextDecoder().decode(decryptedData);\n};\n//#endregion\n//#region src/util/crypto/aes_gcm/encryptBytesWithAesGcmKey.ts\n/**\n* Encrypts raw bytes with an AES-GCM key, returning the binary nonce + ciphertext. The bytes\n* counterpart of {@link encryptTextDataWithAesGcmKey} — use it for binary channels (msgpack frames)\n* to avoid base64 inflation. A fresh 12-byte nonce is generated per call (never reuse a nonce).\n*/\nconst encryptBytesWithAesGcmKey = async ({ aesGcmKey, dataToEncrypt }) => {\n\tconst nonce = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(12));\n\tconst encryptedData = await crypto.subtle.encrypt({\n\t\tname: \"AES-GCM\",\n\t\tiv: nonce\n\t}, aesGcmKey, new Uint8Array(dataToEncrypt));\n\treturn {\n\t\tnonce,\n\t\tciphertext: new Uint8Array(encryptedData)\n\t};\n};\n//#endregion\n//#region src/util/crypto/aes_gcm/encryptTextDataWithAesGcmKey.ts\nconst encryptTextDataWithAesGcmKey = async ({ aesGcmKey, dataToEncrypt }) => {\n\tconst nonce = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(12));\n\tconst encryptedData = await crypto.subtle.encrypt({\n\t\tname: \"AES-GCM\",\n\t\tiv: nonce\n\t}, aesGcmKey, new TextEncoder().encode(dataToEncrypt));\n\treturn {\n\t\tnonce: base64.encode(nonce),\n\t\tciphertext: base64.encode(new Uint8Array(encryptedData))\n\t};\n};\n//#endregion\n//#region src/util/crypto/canonical/stringifyCanonicalJson.ts\n/**\n* Deterministic, signing-grade JSON serialization: the same data always produces the same bytes,\n* regardless of key insertion order — the foundation for content hashes, idempotency keys, and\n* signed challenges. This is a **frozen project contract** (guarded by byte-level test vectors),\n* not RFC 8785/JCS. The exact rules:\n*\n* - `null`, booleans, strings, and finite numbers serialize with native `JSON.stringify` spelling\n*   and escaping (so `-0` emits `0`).\n* - Objects contribute their **own enumerable string-keyed** entries only, sorted by UTF-16\n*   code-unit order; entries whose value is `undefined` are omitted. Symbol keys and prototype\n*   properties are ignored. `toJSON` is **never** invoked — a Date/Map/Set/class instance\n*   contributes only its own enumerable entries.\n* - Arrays retain element order. A sparse **hole** serializes as `null` (native JSON behavior); an\n*   **explicit** `undefined`/function/symbol/bigint element throws.\n* - Non-finite numbers, bigints, functions/symbols as values, top-level `undefined`, and circular\n*   references throw. Repeated (non-cyclic) references are allowed.\n*\n* Error *messages* are not part of the contract; accepted-value bytes are.\n*/\nfunction stringifyCanonicalJson(value) {\n\treturn writeCanonical(value, \"$\", /* @__PURE__ */ new Set());\n}\nfunction writeCanonical(value, path, ancestors) {\n\tif (value === null) return \"null\";\n\tswitch (typeof value) {\n\t\tcase \"string\": return JSON.stringify(value);\n\t\tcase \"boolean\": return value ? \"true\" : \"false\";\n\t\tcase \"number\":\n\t\t\tif (!Number.isFinite(value)) throw new Error(`stringifyCanonicalJson: non-finite number at ${path}`);\n\t\t\treturn JSON.stringify(value);\n\t\tcase \"undefined\":\n\t\tcase \"bigint\":\n\t\tcase \"function\":\n\t\tcase \"symbol\": throw new Error(`stringifyCanonicalJson: unsupported ${typeof value} at ${path}`);\n\t\tdefault: break;\n\t}\n\tconst obj = value;\n\tif (ancestors.has(obj)) throw new Error(`stringifyCanonicalJson: circular reference at ${path}`);\n\tancestors.add(obj);\n\ttry {\n\t\tif (Array.isArray(obj)) {\n\t\t\tlet out = \"[\";\n\t\t\tfor (let i = 0; i < obj.length; i++) {\n\t\t\t\tif (i > 0) out += \",\";\n\t\t\t\tout += i in obj ? writeCanonical(obj[i], `${path}[${i}]`, ancestors) : \"null\";\n\t\t\t}\n\t\t\treturn `${out}]`;\n\t\t}\n\t\tconst record = obj;\n\t\tconst keys = Object.keys(record).sort();\n\t\tconst parts = [];\n\t\tfor (const key of keys) {\n\t\t\tconst entry = record[key];\n\t\t\tif (entry === void 0) continue;\n\t\t\tparts.push(`${JSON.stringify(key)}:${writeCanonical(entry, `${path}.${key}`, ancestors)}`);\n\t\t}\n\t\treturn `{${parts.join(\",\")}}`;\n\t} finally {\n\t\tancestors.delete(obj);\n\t}\n}\n//#endregion\n//#region src/util/crypto/canonical/buildCanonicalChallenge.ts\n/**\n* The canonical string a {@link ICanonicalChallenge} signs:\n* `stringifyCanonicalJson({ domainTag, version, fields })`. Both signer and verifier call this,\n* so the signed bytes are constructed one way, everywhere.\n*\n* Unlike the general serializer (which accepts `unknown` with documented compatibility\n* behaviors), this **rejects** anything that is not a strict {@link TCanonicalJsonValue}: values\n* that alias to the same JSON (`undefined` entries, sparse arrays, non-plain objects) are refused\n* rather than normalized — a signing API must not guess. An empty `domainTag` or a non-positive /\n* unsafe `version` throws.\n*/\nfunction buildCanonicalChallenge(challenge) {\n\tif (typeof challenge.domainTag !== \"string\" || challenge.domainTag.length === 0) throw new Error(\"buildCanonicalChallenge: domainTag must be a non-empty string\");\n\tif (typeof challenge.version !== \"number\" || !Number.isSafeInteger(challenge.version) || challenge.version < 1) throw new Error(\"buildCanonicalChallenge: version must be a positive safe integer\");\n\tif (!isPlainObject(challenge.fields)) throw new Error(\"buildCanonicalChallenge: fields must be a plain object\");\n\tfor (const [key, value] of Object.entries(challenge.fields)) assertStrictCanonicalValue(value, `fields.${key}`);\n\treturn stringifyCanonicalJson({\n\t\tdomainTag: challenge.domainTag,\n\t\tversion: challenge.version,\n\t\tfields: challenge.fields\n\t});\n}\nfunction isPlainObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\nfunction assertStrictCanonicalValue(value, path) {\n\tif (value === void 0) throw new Error(`buildCanonicalChallenge: undefined entry at ${path}`);\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw new Error(`buildCanonicalChallenge: non-finite number at ${path}`);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\tif (!(i in value)) throw new Error(`buildCanonicalChallenge: sparse array hole at ${path}[${i}]`);\n\t\t\tassertStrictCanonicalValue(value[i], `${path}[${i}]`);\n\t\t}\n\t\treturn;\n\t}\n\tif (isPlainObject(value)) {\n\t\tfor (const [key, entry] of Object.entries(value)) {\n\t\t\tif (entry === void 0) throw new Error(`buildCanonicalChallenge: undefined entry at ${path}.${key}`);\n\t\t\tassertStrictCanonicalValue(entry, `${path}.${key}`);\n\t\t}\n\t\treturn;\n\t}\n\tthrow new Error(`buildCanonicalChallenge: unsupported value at ${path} — strict JSON values only (null, boolean, finite number, string, dense array, plain object)`);\n}\n//#endregion\n//#region src/util/data_type/bytes/base64.ts\n/**\n* Byte ⇄ base64 conversions that work in **every** JavaScript runtime — browsers, Node, Cloudflare\n* Workers, Deno, Bun, and React Native (Hermes) — without leaning on environment-specific interfaces:\n* the browser-only `btoa`/`atob` globals (absent in Hermes), or Node's `Buffer` (absent in browsers /\n* Workers / RN). Built on `@scure/base` (pure JS, audited, zero-dependency) — the same base64\n* implementation the crypto layer already uses, so the whole library stays consistent.\n*\n* Produces / consumes **standard** base64 (RFC 4648 §4: `+` and `/`, `=` padding) — byte-for-byte\n* interchangeable with `btoa`/`atob` and Node's `Buffer.toString(\"base64\")`, so it interoperates with\n* any peer regardless of how that peer encodes.\n*\n* NOTE: the TC39 `Uint8Array.prototype.toBase64()` / `Uint8Array.fromBase64()` methods would be the\n* \"native\" choice, but as of 2026 they are not yet available across all target runtimes (notably Hermes),\n* so a pure-JS implementation remains the portable option.\n*/\nfunction bytesToBase64(bytes) {\n\treturn base64.encode(bytes);\n}\nfunction base64ToBytes(encoded) {\n\treturn base64.decode(encoded);\n}\n//#endregion\n//#region src/util/crypto/canonical/sha256.ts\n/**\n* Synchronous SHA-256 (FIPS 180-4) over a UTF-8 string or raw bytes. Synchronous on purpose:\n* definition-time hashes (e.g. nice-realm's schema hash at `defineRealm`) must be computable\n* during module evaluation in both Node and workerd, and `crypto.subtle.digest` is async — a\n* small pure implementation keeps callers synchronous and platform-stable. Moved here from\n* nice-realm (which re-exports `sha256Hex` from its `/internals` for compatibility); verified\n* against the FIPS 180-4 test vectors in `canonical.test.ts`.\n*/\nconst K = new Uint32Array([\n\t1116352408,\n\t1899447441,\n\t3049323471,\n\t3921009573,\n\t961987163,\n\t1508970993,\n\t2453635748,\n\t2870763221,\n\t3624381080,\n\t310598401,\n\t607225278,\n\t1426881987,\n\t1925078388,\n\t2162078206,\n\t2614888103,\n\t3248222580,\n\t3835390401,\n\t4022224774,\n\t264347078,\n\t604807628,\n\t770255983,\n\t1249150122,\n\t1555081692,\n\t1996064986,\n\t2554220882,\n\t2821834349,\n\t2952996808,\n\t3210313671,\n\t3336571891,\n\t3584528711,\n\t113926993,\n\t338241895,\n\t666307205,\n\t773529912,\n\t1294757372,\n\t1396182291,\n\t1695183700,\n\t1986661051,\n\t2177026350,\n\t2456956037,\n\t2730485921,\n\t2820302411,\n\t3259730800,\n\t3345764771,\n\t3516065817,\n\t3600352804,\n\t4094571909,\n\t275423344,\n\t430227734,\n\t506948616,\n\t659060556,\n\t883997877,\n\t958139571,\n\t1322822218,\n\t1537002063,\n\t1747873779,\n\t1955562222,\n\t2024104815,\n\t2227730452,\n\t2361852424,\n\t2428436474,\n\t2756734187,\n\t3204031479,\n\t3329325298\n]);\nfunction rotr(x, n) {\n\treturn x >>> n | x << 32 - n;\n}\n/** SHA-256 of a UTF-8 string or raw bytes, as the 32-byte digest. */\nfunction sha256Bytes(input) {\n\tconst bytes = typeof input === \"string\" ? new TextEncoder().encode(input) : input;\n\tconst bitLen = bytes.length * 8;\n\tconst paddedLen = (bytes.length + 8 >> 6) + 1 << 6;\n\tconst padded = new Uint8Array(paddedLen);\n\tpadded.set(bytes);\n\tpadded[bytes.length] = 128;\n\tconst view = new DataView(padded.buffer);\n\tview.setUint32(paddedLen - 8, Math.floor(bitLen / 4294967296), false);\n\tview.setUint32(paddedLen - 4, bitLen >>> 0, false);\n\tconst h = new Uint32Array([\n\t\t1779033703,\n\t\t3144134277,\n\t\t1013904242,\n\t\t2773480762,\n\t\t1359893119,\n\t\t2600822924,\n\t\t528734635,\n\t\t1541459225\n\t]);\n\tconst w = /* @__PURE__ */ new Uint32Array(64);\n\tfor (let offset = 0; offset < paddedLen; offset += 64) {\n\t\tfor (let i = 0; i < 16; i++) w[i] = view.getUint32(offset + i * 4, false);\n\t\tfor (let i = 16; i < 64; i++) {\n\t\t\tconst s0 = rotr(w[i - 15], 7) ^ rotr(w[i - 15], 18) ^ w[i - 15] >>> 3;\n\t\t\tconst s1 = rotr(w[i - 2], 17) ^ rotr(w[i - 2], 19) ^ w[i - 2] >>> 10;\n\t\t\tw[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;\n\t\t}\n\t\tlet a = h[0];\n\t\tlet b = h[1];\n\t\tlet c = h[2];\n\t\tlet d = h[3];\n\t\tlet e = h[4];\n\t\tlet f = h[5];\n\t\tlet g = h[6];\n\t\tlet hh = h[7];\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tconst s1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);\n\t\t\tconst ch = e & f ^ ~e & g;\n\t\t\tconst temp1 = hh + s1 + ch + K[i] + w[i] >>> 0;\n\t\t\tconst temp2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + (a & b ^ a & c ^ b & c) >>> 0;\n\t\t\thh = g;\n\t\t\tg = f;\n\t\t\tf = e;\n\t\t\te = d + temp1 >>> 0;\n\t\t\td = c;\n\t\t\tc = b;\n\t\t\tb = a;\n\t\t\ta = temp1 + temp2 >>> 0;\n\t\t}\n\t\th[0] = h[0] + a >>> 0;\n\t\th[1] = h[1] + b >>> 0;\n\t\th[2] = h[2] + c >>> 0;\n\t\th[3] = h[3] + d >>> 0;\n\t\th[4] = h[4] + e >>> 0;\n\t\th[5] = h[5] + f >>> 0;\n\t\th[6] = h[6] + g >>> 0;\n\t\th[7] = h[7] + hh >>> 0;\n\t}\n\tconst digest = /* @__PURE__ */ new Uint8Array(32);\n\tconst digestView = new DataView(digest.buffer);\n\tfor (let i = 0; i < 8; i++) digestView.setUint32(i * 4, h[i], false);\n\treturn digest;\n}\n/** SHA-256 of a UTF-8 string or raw bytes, as lowercase hex. */\nfunction sha256Hex(input) {\n\tconst digest = sha256Bytes(input);\n\tlet hex = \"\";\n\tfor (const byte of digest) hex += byte.toString(16).padStart(2, \"0\");\n\treturn hex;\n}\n/** SHA-256 of a UTF-8 string or raw bytes, as standard padded base64 (RFC 4648 §4). */\nfunction sha256Base64(input) {\n\treturn bytesToBase64(sha256Bytes(input));\n}\n//#endregion\n//#region src/util/crypto/canonical/hashCanonicalJson.ts\n/**\n* SHA-256 over `stringifyCanonicalJson(value)` — the canonical string is UTF-8 encoded exactly\n* once and hashed. Equal data (regardless of key order) always yields the same digest, so these\n* are safe for content addressing, idempotency keys, and signed-hash bindings.\n*/\nfunction hashCanonicalJsonSha256Hex(value) {\n\treturn sha256Hex(stringifyCanonicalJson(value));\n}\n/** {@link hashCanonicalJsonSha256Hex}, as standard padded base64 (RFC 4648 §4). */\nfunction hashCanonicalJsonSha256Base64(value) {\n\treturn sha256Base64(stringifyCanonicalJson(value));\n}\n//#endregion\n//#region src/util/crypto/ed25519/signTextDataWithKeyEd25519.ts\nconst signTextDataWithKeyEd25519 = async (data, cryptoKey) => {\n\tconst dataBuffer = new TextEncoder().encode(data);\n\tconst signature = await crypto.subtle.sign({ name: \"ED25519\" }, cryptoKey, dataBuffer);\n\treturn new Uint8Array(signature);\n};\n//#endregion\n//#region src/util/crypto/ed25519/signCombinedTextDataWithKeyEd25519.ts\nconst DEFAULT_COMBINED_TEXT_DATA_SEPARATOR = \"::\";\n/**\n* ⚠ Separator-joining caller-controlled strings is a **concatenation-ambiguity** hazard: the parts\n* have no escaping, so `[\"a::b\"]` and `[\"a\",\"b\"]` sign identical bytes, and two operations'\n* challenges can collide unless every call site adds its own fixed tag. For new signing surfaces\n* prefer the canonical challenge form (`buildCanonicalChallenge` /\n* `ClientCryptoKeyLink.signChallengeCanonical`) — exact field boundaries by construction. This\n* helper stays byte-for-byte for deployed contracts.\n*/\nconst signCombinedTextDataWithKeyEd25519 = async (data, cryptoKey, separator = \"::\") => {\n\treturn await signTextDataWithKeyEd25519(data.join(separator), cryptoKey);\n};\n//#endregion\n//#region src/util/crypto/client_key_link/buildVerifyKeyBoundInfoString.ts\n/**\n* The canonical HKDF `info` for a client-to-client shared key that binds both sides' verify\n* public keys into the derivation.\n*\n* When the two keys are relayed through an intermediary, a tampered key produces mismatched AES\n* keys on the two sides — the very first decryption fails, so key substitution is detected without\n* any extra signature ceremony.\n*\n* The keys are sorted lexicographically so the result is independent of which side is \"local\" —\n* both ends of a link compute the identical string without coordinating an order. Used internally\n* by ClientCryptoKeyLink (`bindVerifyKeysIntoDerivation`); exported for code that derives the same\n* key outside the link.\n*/\nconst buildVerifyKeyBoundInfoString = ({ infoString, verifyPublicKeys }) => {\n\tconst sortedKeys = [...verifyPublicKeys].sort();\n\treturn [...infoString != null ? [infoString] : [], ...sortedKeys].join(\"::\");\n};\n//#endregion\n//#region src/util/storage_adapter/typed_storage/StorageValidationError.ts\n/**\n* A typed-storage read, default, write, or update failed schema validation. Always thrown —\n* validation is fail-closed; the `onInvalid` option observes, it never suppresses. Carries the\n* storage `key` and the schema's `issues` so callers can branch (e.g. treat a corrupt record as\n* absent, run a migration, or surface telemetry).\n*/\nvar StorageValidationError = class extends Error {\n\tkey;\n\tissues;\n\tconstructor(key, issues) {\n\t\tconst rendered = issues.map((issue, index) => {\n\t\t\tconst path = issue.path?.map((segment) => typeof segment === \"object\" ? String(segment.key) : String(segment)).join(\".\");\n\t\t\treturn ` (issue ${index + 1})${path ? ` [${path}]` : \"\"}: ${issue.message}`;\n\t\t}).join(\"\\n\");\n\t\tsuper(`Typed storage validation failed for key \"${key}\":\\n${rendered}`);\n\t\tthis.name = \"StorageValidationError\";\n\t\tthis.key = key;\n\t\tthis.issues = issues;\n\t}\n};\n//#endregion\n//#region src/util/storage_adapter/typed_storage/createTypedStorage.ts\n/**\n* A typed view over a {@link StorageAdapter}. Without `schemas` it is types-only (the stored value\n* is trusted to match `T` — fine for values only your own code writes). With `schemas`, the\n* storage boundary gets the same treatment the action layer gives the wire: values are validated\n* on the way out **and** in, because durable storage is where stale shapes live longest — a value\n* written by version N and read by version N+3 has crossed every schema change in between.\n*/\nfunction createTypedStorage({ storageAdapter, schemas, onInvalid }) {\n\tconst validate = (key, value) => {\n\t\tconst schema = schemas?.[key];\n\t\tif (schema == null) return value;\n\t\tconst result = schema[\"~standard\"].validate(value);\n\t\tlet issues;\n\t\tif (result instanceof Promise) issues = [{ message: \"async schema validation is not supported for typed storage\" }];\n\t\telse if (result.issues != null) issues = result.issues;\n\t\telse return result.value;\n\t\tconst error = new StorageValidationError(key, issues);\n\t\tonInvalid?.(error);\n\t\tthrow error;\n\t};\n\tconst hasSchema = (key) => schemas?.[key] != null;\n\tconst getJson = async (key) => {\n\t\tconst stored = await storageAdapter.getJson(key);\n\t\tif (stored === void 0 || !hasSchema(key)) return stored;\n\t\treturn validate(key, stored);\n\t};\n\tconst getJsonOrDef = async (key, defVal) => {\n\t\tconst value = await storageAdapter.getJson(key) ?? defVal;\n\t\tif (!hasSchema(key)) return value;\n\t\treturn validate(key, value);\n\t};\n\tconst setJson = async (key, val) => {\n\t\treturn storageAdapter.setJson(key, hasSchema(key) ? validate(key, val) : val);\n\t};\n\tconst removeItem = async (key) => {\n\t\tawait storageAdapter.removeItem(key);\n\t};\n\tconst updateJson = async (key, updater) => {\n\t\tif (!hasSchema(key)) {\n\t\t\tawait storageAdapter.updateJson(key, updater);\n\t\t\treturn;\n\t\t}\n\t\tawait storageAdapter.updateJson(key, (currentVal) => validate(key, updater(currentVal === void 0 ? void 0 : validate(key, currentVal))));\n\t};\n\tconst updateJsonWithDef = async (key, defaultVal, updater) => {\n\t\tif (!hasSchema(key)) {\n\t\t\tawait storageAdapter.updateJsonOrDef(key, defaultVal, updater);\n\t\t\treturn;\n\t\t}\n\t\tawait storageAdapter.updateJsonOrDef(key, defaultVal, (currentVal) => validate(key, updater(validate(key, currentVal))));\n\t};\n\treturn {\n\t\tgetJson,\n\t\tgetJsonOrDef,\n\t\tsetJson,\n\t\tremoveItem,\n\t\tupdateJson,\n\t\tupdateJsonWithDef,\n\t\tclearAll: async () => {\n\t\t\tawait storageAdapter.clearAll();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/util/crypto/ed25519/generateEd25519KeyPair.ts\nconst generateEd25519KeyPair = async () => {\n\treturn await crypto.subtle.generateKey({ name: \"Ed25519\" }, true, [\"sign\", \"verify\"]);\n};\n//#endregion\n//#region src/util/core/createDataStringConverter_stringToObject.ts\nconst createDataStringConverter_stringToObject = ({ transformJsonForFormats = [], transformJson = false } = {}) => (inputDataString) => {\n\tconst [type, format, dataString] = inputDataString.split(\"::\");\n\tlet parsedData = dataString;\n\tif (transformJson || transformJsonForFormats.includes(format)) try {\n\t\tparsedData = JSON.parse(dataString);\n\t} catch (error) {\n\t\tconst err = /* @__PURE__ */ new Error(`Failed to parse type and format data string. Given input: \"${inputDataString}\", expected JSON parsable \"data\" value in the format \"${type}::${format}::data\" ${error instanceof Error ? error.message : String(error)}`);\n\t\terr.cause = error;\n\t\tthrow err;\n\t}\n\treturn {\n\t\tformattedString: inputDataString,\n\t\ttype,\n\t\tformat,\n\t\tdata: parsedData\n\t};\n};\n//#endregion\n//#region src/util/core/core_valibot_schemas.ts\nconst vBase64 = v.pipe(v.string(), v.base64());\nconst vCreateSchema_TypeAndFormatPrefixedDataString = ({ type, format, typeKind, formatKind }) => {\n\tconst _typeKind = typeKind ?? \"data_type\";\n\tconst _formatKind = formatKind ?? \"data_format\";\n\treturn v.pipe(v.custom((input) => {\n\t\tif (typeof input !== \"string\") return false;\n\t\tconst [typePart, formatPart, dataPart] = input.split(\"::\");\n\t\treturn typePart === type && formatPart === format && typeof dataPart === \"string\";\n\t}, `Invalid format, expected '<${_typeKind}>::<${_formatKind}>::<value>' where \"${_typeKind}\" is \"${type}\", \"${_formatKind}\" is \"${format}\", and \"value\" is a string in the specified format`));\n};\n//#endregion\n//#region src/util/crypto/crypto.schema.ts\nlet ECryptoKeyAlgo = /* @__PURE__ */ function(ECryptoKeyAlgo) {\n\tECryptoKeyAlgo[\"ed25519\"] = \"ed25519\";\n\tECryptoKeyAlgo[\"x25519\"] = \"x25519\";\n\treturn ECryptoKeyAlgo;\n}({});\nlet ECryptoKeyFormat = /* @__PURE__ */ function(ECryptoKeyFormat) {\n\tECryptoKeyFormat[\"raw_base64\"] = \"raw_base64\";\n\tECryptoKeyFormat[\"jwk\"] = \"jwk\";\n\treturn ECryptoKeyFormat;\n}({});\nconst vSerializedCryptoKeyDataEd25519_Raw = vCreateSchema_TypeAndFormatPrefixedDataString({\n\tformat: \"raw_base64\",\n\ttype: \"ed25519\",\n\ttypeKind: \"algo\"\n});\nconst vSerializedCryptoKeyDataEd25519_Jwk = vCreateSchema_TypeAndFormatPrefixedDataString({\n\tformat: \"jwk\",\n\ttype: \"ed25519\",\n\ttypeKind: \"algo\",\n\ttransformJson: true\n});\nconst vSerializedCryptoKeyDataX25519_Raw = vCreateSchema_TypeAndFormatPrefixedDataString({\n\tformat: \"raw_base64\",\n\ttype: \"x25519\",\n\ttypeKind: \"algo\"\n});\nconst vSerializedCryptoKeyDataX25519_Jwk = vCreateSchema_TypeAndFormatPrefixedDataString({\n\tformat: \"jwk\",\n\ttype: \"x25519\",\n\ttypeKind: \"algo\",\n\ttransformJson: true\n});\nconst vCryptoKeyPairDataX25519 = v.object({\n\tpublicKey: vSerializedCryptoKeyDataX25519_Raw,\n\tprivateKey: vSerializedCryptoKeyDataX25519_Jwk\n});\nconst vCryptoKeyPairDataEd25519 = v.object({\n\tpublicKey: vSerializedCryptoKeyDataEd25519_Raw,\n\tprivateKey: vSerializedCryptoKeyDataEd25519_Jwk\n});\nconst vVerifyChallengeWithSignature_Input = v.object({\n\tchallenge: v.string(),\n\tsignatureBase64: vBase64\n});\nconst vVerifyChallengeWithSignature_WithThrow_Input = v.intersect([vVerifyChallengeWithSignature_Input, v.object({ throwOnInvalid: v.optional(v.boolean()) })]);\nconst vEncryptedAesGcmPayload = v.object({\n\tnonce: vBase64,\n\tciphertext: vBase64\n});\n//#endregion\n//#region src/util/crypto/crypto.converters.ts\n/**\n*\n* [CRYPTO ALGO] ED25519\n*\n*/\nconst convertEd25519RawDataStringToObject = createDataStringConverter_stringToObject();\nconst convertEd25519JwkDataStringToObject = createDataStringConverter_stringToObject({ transformJson: true });\nconst convertEd25519FormattedStringToObject = createDataStringConverter_stringToObject({ transformJsonForFormats: [\"jwk\"] });\nconst convertEd25519RawDataStringToSerializedKeyData = (input) => {\n\treturn {\n\t\tprefixed: input,\n\t\ttransformed: convertEd25519RawDataStringToObject(input)\n\t};\n};\nconst convertEd25519JwkDataStringToSerializedKeyData = (input) => {\n\treturn {\n\t\tprefixed: input,\n\t\ttransformed: convertEd25519JwkDataStringToObject(input)\n\t};\n};\nconst convertEd25519FormattedStringToSerializedKeyData = (input) => {\n\treturn convertEd25519FormattedStringToObject(input);\n};\n/**\n*\n* [CRYPTO ALGO] X25519\n*\n*/\nconst convertX25519RawDataStringToObject = createDataStringConverter_stringToObject();\nconst convertX25519JwkDataStringToObject = createDataStringConverter_stringToObject({ transformJson: true });\nconst convertX25519FormattedStringToObject = createDataStringConverter_stringToObject({ transformJsonForFormats: [\"jwk\"] });\nconst convertX25519RawDataStringToSerializedKeyData = (input) => {\n\treturn {\n\t\tprefixed: input,\n\t\ttransformed: convertX25519RawDataStringToObject(input)\n\t};\n};\nconst convertX25519JwkDataStringToSerializedKeyData = (input) => {\n\treturn {\n\t\tprefixed: input,\n\t\ttransformed: convertX25519JwkDataStringToObject(input)\n\t};\n};\nconst convertX25519FormattedStringToSerializedKeyData = (input) => {\n\treturn convertX25519FormattedStringToObject(input);\n};\n//#endregion\n//#region src/util/crypto/ed25519/importEd25519Key.ts\nconst fromBase64$1 = async (dataBase64, keyUsage, extractable) => {\n\tconst keyBuffer = Uint8Array.from(base64.decode(dataBase64));\n\treturn await crypto.subtle.importKey(\"raw\", keyBuffer, { name: \"Ed25519\" }, extractable, keyUsage);\n};\nconst fromJwk$1 = async (jwk, keyUsage, extractable = true) => {\n\treturn await crypto.subtle.importKey(\"jwk\", jwk, { name: \"Ed25519\" }, extractable, keyUsage);\n};\nconst fromSerializedObject$1 = async (serialized, keyUsage, extractable = true) => {\n\tif (serialized.format === \"jwk\") return await fromJwk$1(serialized.data, keyUsage, extractable);\n\treturn await fromBase64$1(serialized.data, keyUsage, extractable);\n};\nconst fromFormattedString$1 = async (dataString, keyUsage, extractable = true) => {\n\tconst transformed = convertEd25519FormattedStringToSerializedKeyData(dataString);\n\treturn await fromSerializedObject$1(transformed, keyUsage, extractable);\n};\nconst extractableOrNonExtractable$1 = (keyUsage, func) => ({\n\textractable: (input) => func(input, keyUsage, true),\n\tnonExtractable: (input) => func(input, keyUsage, false)\n});\nconst importEd25519Key = {\n\tprivate: {\n\t\tfromFormattedString: extractableOrNonExtractable$1([\"sign\"], fromFormattedString$1),\n\t\tfromSerializedObject: extractableOrNonExtractable$1([\"sign\"], fromSerializedObject$1),\n\t\tfromJwk: extractableOrNonExtractable$1([\"sign\"], fromJwk$1)\n\t},\n\tpublic: {\n\t\tfromBase64: extractableOrNonExtractable$1([\"verify\"], fromBase64$1),\n\t\tfromFormattedString: extractableOrNonExtractable$1([\"verify\"], fromFormattedString$1),\n\t\tfromSerializedObject: extractableOrNonExtractable$1([\"verify\"], fromSerializedObject$1),\n\t\tfromJwk: extractableOrNonExtractable$1([\"verify\"], fromJwk$1)\n\t}\n};\n//#endregion\n//#region src/util/crypto/ed25519/serializeEd25519Key_Jwk.ts\nconst serializeEd25519Key_Jwk = async (key) => {\n\tconst keyJwk = await crypto.subtle.exportKey(\"jwk\", key);\n\tconst prefixed = `ed25519::jwk::${JSON.stringify(keyJwk)}`;\n\treturn {\n\t\ttransformed: {\n\t\t\tformattedString: prefixed,\n\t\t\ttype: \"ed25519\",\n\t\t\tdata: keyJwk,\n\t\t\tformat: \"jwk\"\n\t\t},\n\t\tprefixed\n\t};\n};\n//#endregion\n//#region src/util/crypto/ed25519/serializeEd25519Key_Raw.ts\nconst serializeEd25519Key_Raw = async (publicKey) => {\n\tconst publicKeyBuffer = await crypto.subtle.exportKey(\"raw\", publicKey);\n\tconst publicKeyBase64 = base64.encode(new Uint8Array(publicKeyBuffer));\n\tconst prefixed = `ed25519::raw_base64::${publicKeyBase64}`;\n\treturn {\n\t\ttransformed: {\n\t\t\tformattedString: prefixed,\n\t\t\ttype: \"ed25519\",\n\t\t\tdata: publicKeyBase64,\n\t\t\tformat: \"raw_base64\"\n\t\t},\n\t\tprefixed\n\t};\n};\n//#endregion\n//#region src/util/crypto/ed25519/verifyWithKeyEd25519.ts\nconst verifyWithKeyEd25519 = async ({ challenge, signatureBase64, publicKey }) => {\n\tconst signatureBuffer = Uint8Array.from(base64.decode(signatureBase64));\n\tconst challengeBuffer = new TextEncoder().encode(challenge);\n\treturn await crypto.subtle.verify({ name: \"ED25519\" }, publicKey, signatureBuffer, challengeBuffer);\n};\n//#endregion\n//#region src/util/crypto/x25519/generateX25519KeyPair.ts\nconst generateX25519KeyPair = async () => {\n\treturn await crypto.subtle.generateKey({ name: \"X25519\" }, true, [\"deriveKey\", \"deriveBits\"]);\n};\n//#endregion\n//#region src/util/crypto/x25519/importX25519Key.ts\nconst fromBase64 = async (dataBase64, keyUsage, extractable) => {\n\tconst keyBuffer = Uint8Array.from(base64.decode(dataBase64));\n\treturn await crypto.subtle.importKey(\"raw\", keyBuffer, { name: \"X25519\" }, extractable, keyUsage);\n};\nconst fromJwk = async (jwk, keyUsage, extractable = true) => {\n\treturn await crypto.subtle.importKey(\"jwk\", jwk, { name: \"X25519\" }, extractable, keyUsage);\n};\nconst fromSerializedObject = async (serialized, keyUsage, extractable = true) => {\n\tif (serialized.format === \"jwk\") return await fromJwk(serialized.data, keyUsage, extractable);\n\treturn await fromBase64(serialized.data, keyUsage, extractable);\n};\nconst fromFormattedString = async (dataString, keyUsage, extractable = true) => {\n\tconst transformed = convertX25519FormattedStringToSerializedKeyData(dataString);\n\treturn await fromSerializedObject(transformed, keyUsage, extractable);\n};\nconst extractableOrNonExtractable = (keyUsage, func) => ({\n\textractable: (input) => func(input, keyUsage, true),\n\tnonExtractable: (input) => func(input, keyUsage, false)\n});\nconst importX25519Key = {\n\tprivate: {\n\t\tfromFormattedString: extractableOrNonExtractable([\"deriveKey\", \"deriveBits\"], fromFormattedString),\n\t\tfromSerializedObject: extractableOrNonExtractable([\"deriveKey\", \"deriveBits\"], fromSerializedObject),\n\t\tfromJwk: extractableOrNonExtractable([\"deriveKey\", \"deriveBits\"], fromJwk)\n\t},\n\tpublic: {\n\t\tfromBase64: extractableOrNonExtractable([], fromBase64),\n\t\tfromFormattedString: extractableOrNonExtractable([], fromFormattedString),\n\t\tfromSerializedObject: extractableOrNonExtractable([], fromSerializedObject),\n\t\tfromJwk: extractableOrNonExtractable([], fromJwk)\n\t}\n};\n//#endregion\n//#region src/util/crypto/x25519/serializeX25519Key_Jwk.ts\nconst serializeX25519Key_Jwk = async (key) => {\n\tconst publicKeyJwk = await crypto.subtle.exportKey(\"jwk\", key);\n\tconst prefixed = `x25519::jwk::${JSON.stringify(publicKeyJwk)}`;\n\treturn {\n\t\ttransformed: {\n\t\t\tformattedString: prefixed,\n\t\t\ttype: \"x25519\",\n\t\t\tdata: publicKeyJwk,\n\t\t\tformat: \"jwk\"\n\t\t},\n\t\tprefixed\n\t};\n};\n//#endregion\n//#region src/util/crypto/x25519/serializeX25519Key_Raw.ts\nconst serializeX25519Key_Raw = async (key) => {\n\tconst publicKeyBuffer = await crypto.subtle.exportKey(\"raw\", key);\n\tconst publicKeyBase64 = base64.encode(new Uint8Array(publicKeyBuffer));\n\tconst prefixed = `x25519::raw_base64::${publicKeyBase64}`;\n\treturn {\n\t\ttransformed: {\n\t\t\tformattedString: prefixed,\n\t\t\ttype: \"x25519\",\n\t\t\tdata: publicKeyBase64,\n\t\t\tformat: \"raw_base64\"\n\t\t},\n\t\tprefixed\n\t};\n};\n//#endregion\n//#region src/util/crypto/client_key_link/ClientCryptoKeyLink.ts\n/**\n* Thrown by the local-key getters when the link is in {@link TIdentityMode} `\"required\"` and no\n* identity has been provisioned. Surfacing this (instead of silently minting a fresh identity on a\n* storage miss) is what keeps a shared backend identity from forking across isolates.\n*/\nvar IdentityNotProvisionedError = class extends Error {\n\tconstructor(message = \"ClientCryptoKeyLink: identity not provisioned (identityMode 'required'). Call provisionIdentity() once, out-of-band, before serving.\") {\n\t\tsuper(message);\n\t\tthis.name = \"IdentityNotProvisionedError\";\n\t}\n};\nvar ClientCryptoKeyLink = class {\n\tlocalExchangeKeyPair;\n\tlocalVerifyKeyPair;\n\tlinkedClientKeys = /* @__PURE__ */ new Map();\n\tstorage;\n\tidentityMode;\n\tinitialized = false;\n\tinitializePromise;\n\tlocalExchangeKeyPairPromise;\n\tlocalVerifyKeyPairPromise;\n\tconstructor({ storageAdapter, identityMode } = {}) {\n\t\tif (storageAdapter != null) this.storage = createTypedStorage({ storageAdapter });\n\t\tthis.identityMode = identityMode ?? \"lazy\";\n\t}\n\t/**\n\t* Loads the local key pairs and any linked client public keys from storage (when a storage\n\t* adapter was provided), generating and persisting fresh local key pairs if none exist yet.\n\t*\n\t* Must be called (and awaited) before any sign/verify/encrypt/decrypt operation.\n\t*/\n\tasync initialize() {\n\t\tif (this.initialized) return;\n\t\tthis.initializePromise ??= this.runInitialize();\n\t\ttry {\n\t\t\tawait this.initializePromise;\n\t\t} finally {\n\t\t\tthis.initializePromise = void 0;\n\t\t}\n\t}\n\tasync runInitialize() {\n\t\tawait this.loadStoredLocalKeys();\n\t\tawait this.loadLinkedClients();\n\t\tthis.initialized = true;\n\t}\n\t/**\n\t* Provision the local identity once: load any persisted identity, then mint + persist the exchange\n\t* and verify key pairs only if absent. Idempotent — a no-op when an identity already exists.\n\t*\n\t* This is the *only* way to mint when {@link TIdentityMode} is `\"required\"`. Run it from a single\n\t* coordinated writer (a deploy hook, a first-boot path, a locked admin route) — **never on the hot\n\t* request path** — because concurrent provisioning over an eventually-consistent store could read\n\t* \"absent\" on two isolates at once and fork divergent identities. The serving path uses `\"required\"`,\n\t* which never mints, so a transient storage miss fails that one request loudly instead of forking.\n\t*\n\t* A genuine storage *read error* propagates here (it is never coerced to \"absent\"), so an outage\n\t* surfaces rather than silently minting a replacement identity.\n\t*/\n\tasync provisionIdentity() {\n\t\tawait this.initialize();\n\t\tawait this.mintLocalExchangeKeyPair();\n\t\tawait this.mintLocalVerifyKeyPair();\n\t}\n\t/**\n\t* Loads the local key pairs from storage if they were previously persisted. Does NOT generate\n\t* fresh keys — local identity is created lazily on first use (see {@link ensureLocalExchangeKeyPair}\n\t* / {@link ensureLocalVerifyKeyPair}), so a verify-only or otherwise key-less consumer never\n\t* generates or stores keys it does not need.\n\t*/\n\tasync loadStoredLocalKeys() {\n\t\tconst storedExchange = await this.storage?.getJson(\"localExchangeKeyPair\");\n\t\tif (storedExchange != null) {\n\t\t\tconst exchangePrivateKey = await importX25519Key.private.fromFormattedString.extractable(storedExchange.privateKey);\n\t\t\tconst exchangePublicKey = await importX25519Key.public.fromFormattedString.extractable(storedExchange.publicKey);\n\t\t\tthis.localExchangeKeyPair = {\n\t\t\t\tprivateKey: exchangePrivateKey,\n\t\t\t\tpublicKey: exchangePublicKey\n\t\t\t};\n\t\t}\n\t\tconst storedVerify = await this.storage?.getJson(\"localVerifyKeyPair\");\n\t\tif (storedVerify != null) {\n\t\t\tconst verifyPrivateKey = await importEd25519Key.private.fromFormattedString.extractable(storedVerify.privateKey);\n\t\t\tconst verifyPublicKey = await importEd25519Key.public.fromFormattedString.extractable(storedVerify.publicKey);\n\t\t\tthis.localVerifyKeyPair = {\n\t\t\t\tprivateKey: verifyPrivateKey,\n\t\t\t\tpublicKey: verifyPublicKey\n\t\t\t};\n\t\t}\n\t}\n\t/**\n\t* Returns the local exchange (X25519) key pair. In `\"lazy\"` mode it generates + persists it on first\n\t* use; in `\"required\"` mode it throws {@link IdentityNotProvisionedError} when none was loaded (mint\n\t* only via {@link provisionIdentity}). The read path of every encrypt/derive operation.\n\t*/\n\tasync ensureLocalExchangeKeyPair() {\n\t\tif (this.localExchangeKeyPair != null) return this.localExchangeKeyPair;\n\t\tif (this.identityMode === \"required\") throw new IdentityNotProvisionedError();\n\t\treturn this.mintLocalExchangeKeyPair();\n\t}\n\t/**\n\t* Generates + persists the local exchange key pair if absent, returning an already-loaded pair\n\t* untouched (so provisioning is idempotent). Bypasses the `\"required\"` guard by design — it is the\n\t* sole minting path. Concurrent callers share a single generation.\n\t*/\n\tasync mintLocalExchangeKeyPair() {\n\t\tif (this.localExchangeKeyPair != null) return this.localExchangeKeyPair;\n\t\tthis.localExchangeKeyPairPromise ??= (async () => {\n\t\t\tconst keyPair = await generateX25519KeyPair();\n\t\t\tthis.localExchangeKeyPair = keyPair;\n\t\t\tif (this.storage != null) await this.storage.setJson(\"localExchangeKeyPair\", await this.serializeExchangeKeyPair(keyPair));\n\t\t\treturn keyPair;\n\t\t})();\n\t\ttry {\n\t\t\treturn await this.localExchangeKeyPairPromise;\n\t\t} finally {\n\t\t\tthis.localExchangeKeyPairPromise = void 0;\n\t\t}\n\t}\n\t/**\n\t* Returns the local verify (Ed25519) key pair. In `\"lazy\"` mode it generates + persists it on first\n\t* use; in `\"required\"` mode it throws {@link IdentityNotProvisionedError} when none was loaded (mint\n\t* only via {@link provisionIdentity}). The read path of every sign operation.\n\t*/\n\tasync ensureLocalVerifyKeyPair() {\n\t\tif (this.localVerifyKeyPair != null) return this.localVerifyKeyPair;\n\t\tif (this.identityMode === \"required\") throw new IdentityNotProvisionedError();\n\t\treturn this.mintLocalVerifyKeyPair();\n\t}\n\t/**\n\t* Generates + persists the local verify key pair if absent, returning an already-loaded pair\n\t* untouched (so provisioning is idempotent). Bypasses the `\"required\"` guard by design — it is the\n\t* sole minting path. Concurrent callers share a single generation.\n\t*/\n\tasync mintLocalVerifyKeyPair() {\n\t\tif (this.localVerifyKeyPair != null) return this.localVerifyKeyPair;\n\t\tthis.localVerifyKeyPairPromise ??= (async () => {\n\t\t\tconst keyPair = await generateEd25519KeyPair();\n\t\t\tthis.localVerifyKeyPair = keyPair;\n\t\t\tif (this.storage != null) await this.storage.setJson(\"localVerifyKeyPair\", await this.serializeVerifyKeyPair(keyPair));\n\t\t\treturn keyPair;\n\t\t})();\n\t\ttry {\n\t\t\treturn await this.localVerifyKeyPairPromise;\n\t\t} finally {\n\t\t\tthis.localVerifyKeyPairPromise = void 0;\n\t\t}\n\t}\n\tasync loadLinkedClients() {\n\t\tconst storedLinkedClients = await this.storage?.getJson(\"linkedClientPublicKeys\");\n\t\tif (storedLinkedClients == null) return;\n\t\tfor (const [linkedClientId, publicKeys] of Object.entries(storedLinkedClients)) await this.linkClient({\n\t\t\tlinkedClientId,\n\t\t\tverifyPublicKey: publicKeys.verifyPublicKey,\n\t\t\texchangePublicKey: publicKeys.exchangePublicKey,\n\t\t\tsaltString: publicKeys.saltString,\n\t\t\tinfoString: publicKeys.infoString,\n\t\t\tbindVerifyKeysIntoDerivation: publicKeys.bindVerifyKeysIntoDerivation\n\t\t});\n\t}\n\tasync serializeExchangeKeyPair(keyPair) {\n\t\treturn {\n\t\t\tpublicKey: (await serializeX25519Key_Raw(keyPair.publicKey)).prefixed,\n\t\t\tprivateKey: (await serializeX25519Key_Jwk(keyPair.privateKey)).prefixed\n\t\t};\n\t}\n\tasync serializeVerifyKeyPair(keyPair) {\n\t\treturn {\n\t\t\tpublicKey: (await serializeEd25519Key_Raw(keyPair.publicKey)).prefixed,\n\t\t\tprivateKey: (await serializeEd25519Key_Jwk(keyPair.privateKey)).prefixed\n\t\t};\n\t}\n\t/**\n\t* The local public keys that should be shared with a linked client so that it can verify this\n\t* client's signatures and derive a shared encryption key. Generates the local identity on first\n\t* use.\n\t*/\n\tasync getLocalPublicKeys() {\n\t\treturn {\n\t\t\tverifyPublicKey: await this.getLocalVerifyPublicKey(),\n\t\t\texchangePublicKey: await this.getLocalExchangePublicKey()\n\t\t};\n\t}\n\t/**\n\t* The local exchange (X25519) public key, generating the exchange key pair on first use. Does not\n\t* touch the verify key pair — useful for an exchange-only consumer (e.g. a bridge) that never\n\t* signs.\n\t*/\n\tasync getLocalExchangePublicKey() {\n\t\treturn (await serializeX25519Key_Raw((await this.ensureLocalExchangeKeyPair()).publicKey)).prefixed;\n\t}\n\t/**\n\t* The local verify (Ed25519) public key, generating the verify key pair on first use. Does not\n\t* touch the exchange key pair.\n\t*/\n\tasync getLocalVerifyPublicKey() {\n\t\treturn (await serializeEd25519Key_Raw((await this.ensureLocalVerifyKeyPair()).publicKey)).prefixed;\n\t}\n\t/**\n\t* Registers (or updates) the public keys of a linked client in memory only — nothing is written\n\t* to storage. Use this for ephemeral links (e.g. a per-session bridge or end-to-end peer keyed by\n\t* a session salt/info), so the derived shared key never outlives the process.\n\t*\n\t* Re-linking with a new exchange public key, salt, or info invalidates any previously cached\n\t* shared key for the link.\n\t*/\n\tasync linkClient({ linkedClientId, verifyPublicKey, exchangePublicKey, saltString, infoString, bindVerifyKeysIntoDerivation }) {\n\t\tconst existing = this.linkedClientKeys.get(linkedClientId);\n\t\tlet verify = existing?.verify;\n\t\tif (verifyPublicKey != null) verify = {\n\t\t\tpublicKey: await importEd25519Key.public.fromFormattedString.extractable(verifyPublicKey),\n\t\t\tpublicKeySerialized: verifyPublicKey\n\t\t};\n\t\tconst verifyKeyChanged = verifyPublicKey != null && verifyPublicKey !== existing?.verify?.publicKeySerialized;\n\t\tlet exchange = existing?.exchange;\n\t\tif (exchangePublicKey != null || saltString !== void 0 || infoString !== void 0 || bindVerifyKeysIntoDerivation !== void 0) {\n\t\t\tconst nextPublicKeySerialized = exchangePublicKey ?? existing?.exchange?.publicKeySerialized;\n\t\t\tif (nextPublicKeySerialized == null) throw new Error(`ClientCryptoKeyLink: Cannot set salt/info for ${linkedClientId} without an exchange public key`);\n\t\t\tconst nextSalt = saltString !== void 0 ? saltString : existing?.exchange?.saltString;\n\t\t\tconst nextInfo = infoString !== void 0 ? infoString : existing?.exchange?.infoString;\n\t\t\tconst nextBind = bindVerifyKeysIntoDerivation !== void 0 ? bindVerifyKeysIntoDerivation : existing?.exchange?.bindVerifyKeysIntoDerivation;\n\t\t\tlet publicKey;\n\t\t\tif (exchangePublicKey != null) publicKey = await importX25519Key.public.fromFormattedString.extractable(exchangePublicKey);\n\t\t\telse publicKey = existing.exchange.publicKey;\n\t\t\tconst unchanged = nextPublicKeySerialized === existing?.exchange?.publicKeySerialized && nextSalt === existing?.exchange?.saltString && nextInfo === existing?.exchange?.infoString && nextBind === existing?.exchange?.bindVerifyKeysIntoDerivation && !(nextBind === true && verifyKeyChanged);\n\t\t\texchange = {\n\t\t\t\tpublicKey,\n\t\t\t\tpublicKeySerialized: nextPublicKeySerialized,\n\t\t\t\tsaltString: nextSalt,\n\t\t\t\tinfoString: nextInfo,\n\t\t\t\tbindVerifyKeysIntoDerivation: nextBind,\n\t\t\t\tsharedEncryptKey: unchanged ? existing?.exchange?.sharedEncryptKey : void 0\n\t\t\t};\n\t\t} else if (exchange?.bindVerifyKeysIntoDerivation === true && verifyKeyChanged && exchange.sharedEncryptKey != null) exchange = {\n\t\t\t...exchange,\n\t\t\tsharedEncryptKey: void 0\n\t\t};\n\t\tthis.linkedClientKeys.set(linkedClientId, {\n\t\t\tverify,\n\t\t\texchange\n\t\t});\n\t}\n\t/**\n\t* Like {@link linkClient}, but also persists the linked client's public keys (and salt/info) to\n\t* storage so the link survives a reload.\n\t*\n\t* NOTE: salt/info are written in plaintext. When they are session secrets (e.g. a partner secret\n\t* or bridge salt), prefer {@link linkClient} and re-establish the link per session instead.\n\t*/\n\tasync linkClientAndStore(input) {\n\t\tawait this.linkClient(input);\n\t\tif (this.storage == null) return;\n\t\tconst { linkedClientId, verifyPublicKey, exchangePublicKey, saltString, infoString, bindVerifyKeysIntoDerivation } = input;\n\t\tawait this.storage.updateJsonWithDef(\"linkedClientPublicKeys\", {}, (current) => ({\n\t\t\t...current,\n\t\t\t[linkedClientId]: {\n\t\t\t\t...current[linkedClientId],\n\t\t\t\t...verifyPublicKey != null ? { verifyPublicKey } : {},\n\t\t\t\t...exchangePublicKey != null ? { exchangePublicKey } : {},\n\t\t\t\t...saltString !== void 0 ? { saltString } : {},\n\t\t\t\t...infoString !== void 0 ? { infoString } : {},\n\t\t\t\t...bindVerifyKeysIntoDerivation !== void 0 ? { bindVerifyKeysIntoDerivation } : {}\n\t\t\t}\n\t\t}));\n\t}\n\t/**\n\t* Whether a linked client is currently registered (in memory) under this id.\n\t*/\n\thasLinkedClient(linkedClientId) {\n\t\treturn this.linkedClientKeys.has(linkedClientId);\n\t}\n\t/**\n\t* The serialized public keys registered for a linked client, or undefined when the client is not\n\t* linked. Useful when a holder needs to relay a linked client's keys onward (e.g. a backend\n\t* relaying a wallet's verify key to a partner).\n\t*/\n\tgetLinkedClientPublicKeys(linkedClientId) {\n\t\tconst linkedClient = this.linkedClientKeys.get(linkedClientId);\n\t\tif (linkedClient == null) return;\n\t\treturn {\n\t\t\tverifyPublicKey: linkedClient.verify?.publicKeySerialized,\n\t\t\texchangePublicKey: linkedClient.exchange?.publicKeySerialized\n\t\t};\n\t}\n\t/**\n\t* Removes a single linked client from memory and, when storage is available, from persisted\n\t* state. Any cached shared key for the link is dropped with it.\n\t*/\n\tasync unlinkClient(linkedClientId) {\n\t\tthis.linkedClientKeys.delete(linkedClientId);\n\t\tif (this.storage != null) await this.storage.updateJson(\"linkedClientPublicKeys\", (current) => {\n\t\t\tif (current == null) return {};\n\t\t\tconst { [linkedClientId]: _removed, ...rest } = current;\n\t\t\treturn rest;\n\t\t});\n\t}\n\t/**\n\t* Removes all linked clients from memory and persisted state, while keeping the local identity\n\t* key pairs intact.\n\t*/\n\tasync unlinkAllClients() {\n\t\tthis.linkedClientKeys.clear();\n\t\tif (this.storage != null) await this.storage.setJson(\"linkedClientPublicKeys\", {});\n\t}\n\t/**\n\t* Wipes everything this instance owns — local identity key pairs and all linked clients, in\n\t* memory and in storage. After a reset, {@link initialize} must be called again before use (it\n\t* will generate a fresh local identity).\n\t*\n\t* Only the keys owned by this util are removed, so a shared storage adapter's other data is left\n\t* untouched.\n\t*/\n\tasync reset() {\n\t\tthis.linkedClientKeys.clear();\n\t\tthis.localExchangeKeyPair = void 0;\n\t\tthis.localVerifyKeyPair = void 0;\n\t\tthis.initialized = false;\n\t\tif (this.storage != null) {\n\t\t\tawait this.storage.removeItem(\"linkedClientPublicKeys\");\n\t\t\tawait this.storage.removeItem(\"localExchangeKeyPair\");\n\t\t\tawait this.storage.removeItem(\"localVerifyKeyPair\");\n\t\t}\n\t}\n\tgetLinkedClient(linkedClientId) {\n\t\tconst linkedClient = this.linkedClientKeys.get(linkedClientId);\n\t\tif (linkedClient == null) throw new Error(`ClientCryptoKeyLink: No linked client for ${linkedClientId}`);\n\t\treturn linkedClient;\n\t}\n\tasync getAesGcmKeyForLinkedClient(externalClientSourceId) {\n\t\tconst linkedClient = this.getLinkedClient(externalClientSourceId);\n\t\tif (linkedClient.exchange?.sharedEncryptKey != null) return linkedClient.exchange.sharedEncryptKey;\n\t\tif (linkedClient.exchange?.publicKey == null) throw new Error(`ClientCryptoKeyLink: No public exchange key set for ${externalClientSourceId}`);\n\t\tconst localExchangeKeyPair = await this.ensureLocalExchangeKeyPair();\n\t\tlet infoString = linkedClient.exchange.infoString;\n\t\tif (linkedClient.exchange.bindVerifyKeysIntoDerivation === true) {\n\t\t\tconst linkedVerifyPublicKey = linkedClient.verify?.publicKeySerialized;\n\t\t\tif (linkedVerifyPublicKey == null) throw new Error(`ClientCryptoKeyLink: Link for ${externalClientSourceId} binds verify keys into the derivation, but no verify public key is set`);\n\t\t\tinfoString = buildVerifyKeyBoundInfoString({\n\t\t\t\tinfoString: linkedClient.exchange.infoString,\n\t\t\t\tverifyPublicKeys: [await this.getLocalVerifyPublicKey(), linkedVerifyPublicKey]\n\t\t\t});\n\t\t}\n\t\tconst sharedEncryptKey = await createAesGcmKeyFromX25519Keys({\n\t\t\tinternalX25519PrivateKey: localExchangeKeyPair.privateKey,\n\t\t\texternalX25519PublicKey: linkedClient.exchange.publicKey,\n\t\t\tsaltString: linkedClient.exchange.saltString,\n\t\t\tinfoString\n\t\t});\n\t\tthis.linkedClientKeys.set(externalClientSourceId, {\n\t\t\t...linkedClient,\n\t\t\texchange: {\n\t\t\t\t...linkedClient.exchange,\n\t\t\t\tsharedEncryptKey\n\t\t\t}\n\t\t});\n\t\treturn sharedEncryptKey;\n\t}\n\t/**\n\t* Derive the shared AES-GCM key from *explicit* key material + this link's local exchange private\n\t* key, returning a standalone key that is **not** stored in (or read from) the per-`linkedClientId`\n\t* cache. Use it to give a single session its own immutable key: two sessions that share one\n\t* `linkedClientId` (e.g. a secure WebSocket and a secure HTTP exchange to the same peer) would\n\t* otherwise clobber each other's cached shared key — the second handshake's re-link drops the\n\t* first's key, so frames on the other transport fail to decrypt. Mirrors the derivation in\n\t* {@link getAesGcmKeyForLinkedClient} exactly, so the resulting key matches the peer's.\n\t*\n\t* Requires the local identity to be loaded — call {@link initialize} first when resuming a link\n\t* cold (the handshake paths have already initialized by the time they hold key material).\n\t*/\n\tasync deriveSharedAesGcmKey({ exchangePublicKey, saltString, infoString, bindVerifyKeysIntoDerivation, verifyPublicKey }) {\n\t\tconst localExchangeKeyPair = await this.ensureLocalExchangeKeyPair();\n\t\tconst externalX25519PublicKey = await importX25519Key.public.fromFormattedString.extractable(exchangePublicKey);\n\t\tlet derivedInfoString = infoString;\n\t\tif (bindVerifyKeysIntoDerivation === true) {\n\t\t\tif (verifyPublicKey == null) throw new Error(\"ClientCryptoKeyLink.deriveSharedAesGcmKey: a verify public key is required when binding verify keys into the derivation\");\n\t\t\tderivedInfoString = buildVerifyKeyBoundInfoString({\n\t\t\t\tinfoString,\n\t\t\t\tverifyPublicKeys: [await this.getLocalVerifyPublicKey(), verifyPublicKey]\n\t\t\t});\n\t\t}\n\t\treturn await createAesGcmKeyFromX25519Keys({\n\t\t\tinternalX25519PrivateKey: localExchangeKeyPair.privateKey,\n\t\t\texternalX25519PublicKey,\n\t\t\tsaltString,\n\t\t\tinfoString: derivedInfoString\n\t\t});\n\t}\n\t/**\n\t* Derive a symmetric AES-GCM key bound to **this link's own identity** — for sealing data the server\n\t* hands a client and reads back later (e.g. a stateless secure-exchange session ticket), where only\n\t* this server (any isolate that loaded the same persisted identity) can open it.\n\t*\n\t* Deterministic: an X25519 ECDH of the local exchange private key against its own public key, fed\n\t* through the same vetted HKDF as peer key derivation, with a fixed versioned info label. So every\n\t* isolate sharing the persisted identity derives the identical key, and no raw private-key bytes are\n\t* exposed. The {@link version} is part of the label, so a future rotation can run two keys during a\n\t* grace window (old tickets opened with `v1` while new ones issue under `v2`).\n\t*\n\t* Requires the local identity (call {@link initialize} / {@link provisionIdentity} first); in\n\t* `\"required\"` mode an unprovisioned link throws {@link IdentityNotProvisionedError}.\n\t*/\n\tasync deriveLocalSealKey(options) {\n\t\tconst localExchangeKeyPair = await this.ensureLocalExchangeKeyPair();\n\t\treturn await createAesGcmKeyFromX25519Keys({\n\t\t\tinternalX25519PrivateKey: localExchangeKeyPair.privateKey,\n\t\t\texternalX25519PublicKey: localExchangeKeyPair.publicKey,\n\t\t\tinfoString: `exchange-ticket-seal/${options?.version ?? \"v1\"}`\n\t\t});\n\t}\n\tasync encryptDataForLinkedClient({ dataToEncrypt, linkedClientId }) {\n\t\treturn await encryptTextDataWithAesGcmKey({\n\t\t\tdataToEncrypt,\n\t\t\taesGcmKey: await this.getAesGcmKeyForLinkedClient(linkedClientId)\n\t\t});\n\t}\n\tasync decryptDataFromLinkedClient({ dataToDecrypt, linkedClientId }) {\n\t\treturn await decryptTextDataWithAesGcmKey({\n\t\t\tdataToDecrypt,\n\t\t\taesGcmKey: await this.getAesGcmKeyForLinkedClient(linkedClientId)\n\t\t});\n\t}\n\t/**\n\t* Bytes counterpart of {@link encryptDataForLinkedClient} — encrypts raw bytes with the shared\n\t* AES-GCM key, returning a binary nonce + ciphertext. Use it for binary channels (e.g. msgpack\n\t* WebSocket frames) to avoid base64 inflation.\n\t*/\n\tasync encryptBytesForLinkedClient({ dataToEncrypt, linkedClientId }) {\n\t\treturn await encryptBytesWithAesGcmKey({\n\t\t\tdataToEncrypt,\n\t\t\taesGcmKey: await this.getAesGcmKeyForLinkedClient(linkedClientId)\n\t\t});\n\t}\n\t/** Bytes counterpart of {@link decryptDataFromLinkedClient}. */\n\tasync decryptBytesFromLinkedClient({ dataToDecrypt, linkedClientId }) {\n\t\treturn await decryptBytesWithAesGcmKey({\n\t\t\tdataToDecrypt,\n\t\t\taesGcmKey: await this.getAesGcmKeyForLinkedClient(linkedClientId)\n\t\t});\n\t}\n\tasync signAndEncryptDataForLinkedClient({ dataToEncrypt, linkedClientId }) {\n\t\tconst { signatureBase64 } = await this.signChallenge([dataToEncrypt]);\n\t\treturn {\n\t\t\tencryptedData: await this.encryptDataForLinkedClient({\n\t\t\t\tdataToEncrypt,\n\t\t\t\tlinkedClientId\n\t\t\t}),\n\t\t\tsignatureBase64\n\t\t};\n\t}\n\t/**\n\t* Decrypts a payload from a linked client and verifies that the decrypted plaintext was signed\n\t* by that client. Counterpart to {@link signAndEncryptDataForLinkedClient}.\n\t*\n\t* Returns the decrypted `data` alongside `isValid` — the caller decides how to handle an invalid\n\t* signature. (A tampered ciphertext fails earlier at AES-GCM decryption.)\n\t*/\n\tasync decryptAndVerifyDataFromLinkedClient({ dataToDecrypt, linkedClientId, signatureBase64 }) {\n\t\tconst data = await this.decryptDataFromLinkedClient({\n\t\t\tdataToDecrypt,\n\t\t\tlinkedClientId\n\t\t});\n\t\treturn {\n\t\t\tdata,\n\t\t\tisValid: await this.verifyChallengeFromLinkedClient({\n\t\t\t\tlinkedClientId,\n\t\t\t\tchallenge: data,\n\t\t\t\tsignatureBase64\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* ⚠ Multi-part challenges join with `\"::\"` — a **concatenation-ambiguity** hazard: when a caller\n\t* controls two adjacent parts, distinct tuples can produce identical signed bytes (`[\"a::b\"]`\n\t* vs `[\"a\",\"b\"]`), and two operations' challenges can collide unless every call site remembers\n\t* its own fixed tag. Prefer {@link signChallengeCanonical}: domain-tagged, versioned, exact\n\t* field boundaries by construction. This method stays byte-for-byte for deployed contracts.\n\t*/\n\tasync signChallenge(challenge) {\n\t\tif (challenge.length === 0) throw new Error(\"Challenge must contain at least one string\");\n\t\tconst localVerifyKeyPair = await this.ensureLocalVerifyKeyPair();\n\t\tconst signature = challenge.length > 1 ? await signCombinedTextDataWithKeyEd25519(challenge, localVerifyKeyPair.privateKey) : await signTextDataWithKeyEd25519(challenge[0], localVerifyKeyPair.privateKey);\n\t\treturn { signatureBase64: base64.encode(signature) };\n\t}\n\t/**\n\t* Sign a {@link ICanonicalChallenge} — the canonical, domain-tagged, versioned challenge form\n\t* ({@link buildCanonicalChallenge} defines the signed bytes). Same key and signature scheme as\n\t* {@link signChallenge}, safer byte layout; the verify dual is\n\t* {@link verifyChallengeCanonicalFromLinkedClient}, which takes the same structured challenge.\n\t*/\n\tasync signChallengeCanonical(challenge) {\n\t\treturn this.signChallenge([buildCanonicalChallenge(challenge)]);\n\t}\n\t/**\n\t* Verify a signature produced by {@link signChallengeCanonical} against the linked client's\n\t* verify key. Takes the **structured** challenge and rebuilds the canonical string itself, so\n\t* signer and verifier can never disagree on byte construction.\n\t*/\n\tasync verifyChallengeCanonicalFromLinkedClient({ linkedClientId, challenge, signatureBase64 }) {\n\t\treturn this.verifyChallengeFromLinkedClient({\n\t\t\tlinkedClientId,\n\t\t\tchallenge: buildCanonicalChallenge(challenge),\n\t\t\tsignatureBase64\n\t\t});\n\t}\n\t/**\n\t* Verifies a signature over `challenge` against the linked client's verify (Ed25519) public key.\n\t*/\n\tasync verifyChallengeFromLinkedClient({ linkedClientId, challenge, signatureBase64 }) {\n\t\tconst linkedClient = this.getLinkedClient(linkedClientId);\n\t\tif (linkedClient.verify?.publicKey == null) throw new Error(`ClientCryptoKeyLink: No verify public key set for ${linkedClientId}`);\n\t\treturn await verifyWithKeyEd25519({\n\t\t\tchallenge,\n\t\t\tsignatureBase64,\n\t\t\tpublicKey: linkedClient.verify.publicKey\n\t\t});\n\t}\n};\n//#endregion\n//#region src/util/crypto/portable_key/portable_symmetric_key.ts\n/**\n* A \"portable\" AES-256-GCM key is one a user can carry across devices by hand: rendered as a\n* single prefixed string suitable for both QR codes and manual entry.\n*\n* String format (a cross-app contract — change only with a new prefix/version):\n*\n*   `${keyPrefix}.${base64urlnopad(32 key bytes)}.${checksum}`\n*\n* - the separator is \".\" because it is OUTSIDE the base64url alphabet — both \"_\" and \"-\" are\n*   base64url data characters and would collide with the encoded key bytes;\n* - data part is always 43 chars (canonical unpadded base64url of 32 bytes);\n* - checksum is the first 6 chars of base64urlnopad(SHA-256(`${keyPrefix}.${dataPart}`)) — catches\n*   manual-entry typos before any decryption is attempted;\n* - the prefix names the consuming protocol/version (e.g. \"mck1\") so scanners and inputs can\n*   validate shape instantly.\n*/\nconst SEPARATOR = \".\";\nconst KEY_BYTE_LENGTH = 32;\nconst DATA_PART_LENGTH = 43;\nconst CHECKSUM_LENGTH = 6;\nconst KEY_PREFIX_REGEX = /^[a-z][a-z0-9]{1,15}$/;\nconst assertValidKeyPrefix = (keyPrefix) => {\n\tif (!KEY_PREFIX_REGEX.test(keyPrefix)) throw new Error(`Portable key prefix \"${keyPrefix}\" is invalid: must match ${KEY_PREFIX_REGEX} (no \"_\" or whitespace)`);\n};\nconst checksumForDataPart = async ({ keyPrefix, dataPart }) => {\n\tconst digestInput = new TextEncoder().encode(`${keyPrefix}${SEPARATOR}${dataPart}`);\n\tconst digest = await crypto.subtle.digest(\"SHA-256\", digestInput);\n\treturn base64urlnopad.encode(new Uint8Array(digest)).slice(0, CHECKSUM_LENGTH);\n};\nconst generatePortableAesGcmKey = () => {\n\treturn crypto.subtle.generateKey({\n\t\tname: \"AES-GCM\",\n\t\tlength: 256\n\t}, true, [\"encrypt\", \"decrypt\"]);\n};\nconst exportPortableAesGcmKeyToString = async ({ aesGcmKey, keyPrefix }) => {\n\tassertValidKeyPrefix(keyPrefix);\n\tconst rawKey = await crypto.subtle.exportKey(\"raw\", aesGcmKey);\n\tconst dataPart = base64urlnopad.encode(new Uint8Array(rawKey));\n\tconst checksum = await checksumForDataPart({\n\t\tkeyPrefix,\n\t\tdataPart\n\t});\n\treturn `${keyPrefix}${SEPARATOR}${dataPart}${SEPARATOR}${checksum}`;\n};\n/**\n* Parses a user-entered portable key string. Never throws for bad input strings — every failure\n* mode maps to a typed `{ ok: false }` reason so UIs can render friendly feedback. (An invalid\n* `expectedKeyPrefix` still throws: that is a programming error, not user input.)\n*/\nconst importPortableAesGcmKeyFromString = async ({ keyString, expectedKeyPrefix }) => {\n\tassertValidKeyPrefix(expectedKeyPrefix);\n\tconst parts = keyString.replace(/\\s+/g, \"\").split(SEPARATOR);\n\tif (parts.length !== 3) return {\n\t\tok: false,\n\t\treason: \"bad_format\"\n\t};\n\tconst [prefix, dataPart, checksum] = parts;\n\tif (prefix.length === 0 || dataPart.length === 0 || checksum.length === 0) return {\n\t\tok: false,\n\t\treason: \"bad_format\"\n\t};\n\tif (prefix !== expectedKeyPrefix) return {\n\t\tok: false,\n\t\treason: \"bad_prefix\"\n\t};\n\tlet keyBytes;\n\ttry {\n\t\tkeyBytes = base64urlnopad.decode(dataPart);\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"bad_format\"\n\t\t};\n\t}\n\tif (base64urlnopad.encode(keyBytes) !== dataPart) return {\n\t\tok: false,\n\t\treason: \"bad_format\"\n\t};\n\tif (dataPart.length !== DATA_PART_LENGTH || keyBytes.length !== KEY_BYTE_LENGTH) return {\n\t\tok: false,\n\t\treason: \"bad_key_length\"\n\t};\n\tif (checksum !== await checksumForDataPart({\n\t\tkeyPrefix: expectedKeyPrefix,\n\t\tdataPart\n\t})) return {\n\t\tok: false,\n\t\treason: \"bad_checksum\"\n\t};\n\tlet aesGcmKey;\n\ttry {\n\t\taesGcmKey = await crypto.subtle.importKey(\"raw\", new Uint8Array(keyBytes), { name: \"AES-GCM\" }, true, [\"encrypt\", \"decrypt\"]);\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"bad_format\"\n\t\t};\n\t}\n\treturn {\n\t\tok: true,\n\t\taesGcmKey\n\t};\n};\n//#endregion\n//#region src/util/crypto/portable_key/key_encrypted_payload.ts\n/**\n* Encrypts a JSON-serializable value under a freshly generated portable AES-256-GCM key.\n* The returned `keyString` is the ONLY way to decrypt — hand it to the user (QR / copy),\n* never send it alongside `encryptedData`.\n*/\nconst encryptJsonWithGeneratedKey = async ({ data, keyPrefix }) => {\n\tconst aesGcmKey = await generatePortableAesGcmKey();\n\treturn {\n\t\tkeyString: await exportPortableAesGcmKeyToString({\n\t\t\taesGcmKey,\n\t\t\tkeyPrefix\n\t\t}),\n\t\tencryptedData: await encryptTextDataWithAesGcmKey({\n\t\t\taesGcmKey,\n\t\t\tdataToEncrypt: JSON.stringify(data)\n\t\t})\n\t};\n};\n/**\n* Decrypts with a user-entered portable key string and validates the recovered plaintext against\n* `schema` before returning it — decrypted data is untrusted input until it parses. Never throws\n* for bad key strings, wrong keys, or tampered/invalid payloads.\n*/\nconst decryptJsonWithKeyString = async ({ keyString, expectedKeyPrefix, encryptedData, schema }) => {\n\tconst imported = await importPortableAesGcmKeyFromString({\n\t\tkeyString,\n\t\texpectedKeyPrefix\n\t});\n\tif (!imported.ok) return {\n\t\tok: false,\n\t\treason: \"bad_key_string\"\n\t};\n\tlet plaintext;\n\ttry {\n\t\tplaintext = await decryptTextDataWithAesGcmKey({\n\t\t\taesGcmKey: imported.aesGcmKey,\n\t\t\tdataToDecrypt: encryptedData\n\t\t});\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"decrypt_failed\"\n\t\t};\n\t}\n\tlet parsedJson;\n\ttry {\n\t\tparsedJson = JSON.parse(plaintext);\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\treason: \"invalid_payload\"\n\t\t};\n\t}\n\tconst validated = v.safeParse(schema, parsedJson);\n\tif (!validated.success) return {\n\t\tok: false,\n\t\treason: \"invalid_payload\"\n\t};\n\treturn {\n\t\tok: true,\n\t\tdata: validated.output\n\t};\n};\n//#endregion\n//#region src/util/storage_adapter/storage_adapter.types.ts\nlet EStorageAdapterType = /* @__PURE__ */ function(EStorageAdapterType) {\n\tEStorageAdapterType[\"string\"] = \"string\";\n\tEStorageAdapterType[\"json\"] = \"json\";\n\treturn EStorageAdapterType;\n}({});\n//#endregion\n//#region src/util/storage_adapter/StorageAdapter.ts\nvar StorageAdapter = class StorageAdapter {\n\timplementation;\n\tkeyPrefix;\n\t/**\n\t* Whether the backing store outlives a page reload / process restart (from the methods'\n\t* {@link TStorageAdapterMethods} `durable` flag). `false` on the memory and web-session adapters,\n\t* `true` on localStorage / Durable Object / KV, `undefined` (unknown) on custom methods.\n\t*/\n\tdurable;\n\ttrackKeysForClearing;\n\tadapterStorage;\n\t/**\n\t* Serializes mutations of the `__usedKeys__` index so its read-modify-write cycles can't\n\t* interleave. Without this, two overlapping `trackUsedKey`/`untrackUsedKey` calls each read the\n\t* old index and the later write clobbers the earlier one (last-writer-wins), silently dropping\n\t* entries — so `clearAll` leaves those keys behind. The window is negligible on synchronous\n\t* stores (localStorage) but wide on real async I/O (React Native AsyncStorage), where it routinely\n\t* corrupts a client-identity reset. See docs/issues/storage-adapter-clearall-react-native.md.\n\t*/\n\tindexMutationChain = Promise.resolve();\n\tconstructor({ methods, keyPrefix, trackKeysForClearing: trackKeys }) {\n\t\tthis.implementation = methods;\n\t\tthis.durable = methods.durable;\n\t\tthis.keyPrefix = keyPrefix ?? \"\";\n\t\tconst _trackKeys = trackKeys ?? true;\n\t\tthis.trackKeysForClearing = _trackKeys;\n\t\tthis.adapterStorage = _trackKeys ? createTypedStorage({ storageAdapter: new StorageAdapter({\n\t\t\tmethods,\n\t\t\tkeyPrefix,\n\t\t\ttrackKeysForClearing: false\n\t\t}) }) : void 0;\n\t}\n\tgetPrefixedKey(rawKey) {\n\t\treturn `${this.keyPrefix}${rawKey}`;\n\t}\n\t/**\n\t* Runs `fn` after every previously-enqueued index mutation has settled, so the index's\n\t* read-modify-write cycles execute one at a time per adapter instance. Failures don't break the\n\t* chain — the next waiter still runs.\n\t*/\n\twithIndexLock(fn) {\n\t\tconst run = this.indexMutationChain.then(fn, fn);\n\t\tthis.indexMutationChain = run.then(() => void 0, () => void 0);\n\t\treturn run;\n\t}\n\t/**\n\t* Derive a new adapter over the *same* backing store with an extra key-prefix segment appended.\n\t* Lets an independent namespace (e.g. a second crypto identity) share one underlying storage without\n\t* key collisions. Key-tracking policy is inherited: deriving from an intentionally untracked\n\t* adapter must not silently create a `__usedKeys__` index.\n\t*/\n\twithKeyPrefix(extraPrefix) {\n\t\treturn new StorageAdapter({\n\t\t\tmethods: this.implementation,\n\t\t\tkeyPrefix: `${this.keyPrefix}${extraPrefix}`,\n\t\t\ttrackKeysForClearing: this.trackKeysForClearing\n\t\t});\n\t}\n\tasync trackUsedKey(rawKey) {\n\t\tconst adapterStorage = this.adapterStorage;\n\t\tif (!adapterStorage) return;\n\t\tawait this.withIndexLock(() => adapterStorage.updateJsonWithDef(\"__usedKeys__\", [], (currentKeys) => {\n\t\t\tif (!currentKeys.includes(rawKey)) return [...currentKeys, rawKey];\n\t\t\treturn currentKeys;\n\t\t}));\n\t}\n\tasync untrackUsedKey(rawKey) {\n\t\tconst adapterStorage = this.adapterStorage;\n\t\tif (!adapterStorage) return;\n\t\tawait this.withIndexLock(() => adapterStorage.updateJsonWithDef(\"__usedKeys__\", [], (currentKeys) => {\n\t\t\treturn currentKeys.filter((k) => k !== rawKey);\n\t\t}));\n\t}\n\tasync clearAll() {\n\t\tconst adapterStorage = this.adapterStorage;\n\t\tif (!adapterStorage) return;\n\t\tawait this.withIndexLock(async () => {\n\t\t\tconst allKeys = await adapterStorage.getJsonOrDef(\"__usedKeys__\", []) ?? [];\n\t\t\tawait Promise.all(allKeys.map((key) => this.implementation.removeItem(this.getPrefixedKey(key))));\n\t\t\tawait adapterStorage.removeItem(\"__usedKeys__\");\n\t\t});\n\t}\n\tasync removeItem(rawKey) {\n\t\tawait this.implementation.removeItem(this.getPrefixedKey(rawKey));\n\t\tawait this.untrackUsedKey(rawKey);\n\t}\n\tasync setJson(rawKey, value) {\n\t\tconst key = this.getPrefixedKey(rawKey);\n\t\tif (this.implementation.type === \"string\") await this.implementation.setItem(key, JSON.stringify(value));\n\t\telse await this.implementation.setItem(key, value);\n\t\tawait this.trackUsedKey(rawKey);\n\t}\n\tasync getJson(rawKey) {\n\t\tconst key = this.getPrefixedKey(rawKey);\n\t\tif (this.implementation.type === \"string\") {\n\t\t\tconst val = await this.implementation.getItem(key);\n\t\t\tif (val == null || val === \"undefined\" || val === \"null\") return;\n\t\t\treturn JSON.parse(val);\n\t\t} else {\n\t\t\tconst val = await this.implementation.getItem(key);\n\t\t\tif (val == null || val === \"undefined\" || val === \"null\") return;\n\t\t\treturn val;\n\t\t}\n\t}\n\tasync getJsonOrDef(rawKey, defVal) {\n\t\tif (this.implementation.type === \"string\") {\n\t\t\tconst val = await this.implementation.getItem(this.getPrefixedKey(rawKey));\n\t\t\tif (val == null || val === \"undefined\" || val === \"null\") return defVal;\n\t\t\treturn JSON.parse(val);\n\t\t}\n\t\tconst val = await this.implementation.getItem(this.getPrefixedKey(rawKey));\n\t\tif (val == null || val === \"undefined\" || val === \"null\") return defVal;\n\t\treturn val;\n\t}\n\tasync updateJson(rawKey, updater) {\n\t\tconst newVal = updater(await this.getJson(rawKey));\n\t\tawait this.setJson(rawKey, newVal);\n\t\treturn newVal;\n\t}\n\tasync updateJsonOrDef(rawKey, defVal, updater) {\n\t\tconst newVal = updater(await this.getJsonOrDef(rawKey, defVal));\n\t\tawait this.setJson(rawKey, newVal);\n\t\treturn newVal;\n\t}\n\tcreateJsonGetterSetter(rawKey) {\n\t\treturn {\n\t\t\tget: () => this.getJson(rawKey),\n\t\t\tset: (value) => this.setJson(rawKey, value)\n\t\t};\n\t}\n};\n//#endregion\n//#region src/util/storage_adapter/specific/browser/browser_storage.ts\nfunction createWebLocalStorageMethods(_localStorage) {\n\treturn {\n\t\ttype: \"string\",\n\t\tdurable: true,\n\t\tgetItem: async (key) => _localStorage.getItem(key),\n\t\tsetItem: async (key, value) => {\n\t\t\t_localStorage.setItem(key, value);\n\t\t},\n\t\tremoveItem: async (key) => {\n\t\t\t_localStorage.removeItem(key);\n\t\t}\n\t};\n}\nconst createWebLocalStorageAdapter = ({ localStorage: _localStorage, ...options }) => {\n\treturn new StorageAdapter({\n\t\tmethods: createWebLocalStorageMethods(_localStorage),\n\t\t...options\n\t});\n};\nfunction createTypedWebLocalStorage(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options;\n\treturn createTypedStorage({\n\t\tstorageAdapter: createWebLocalStorageAdapter(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\nfunction createWebSessionStorageMethods(_sessionStorage) {\n\treturn {\n\t\ttype: \"string\",\n\t\tdurable: false,\n\t\tgetItem: async (key) => _sessionStorage.getItem(key),\n\t\tsetItem: async (key, value) => {\n\t\t\t_sessionStorage.setItem(key, value);\n\t\t},\n\t\tremoveItem: async (key) => {\n\t\t\t_sessionStorage.removeItem(key);\n\t\t}\n\t};\n}\nconst createWebSessionStorageAdapter = ({ sessionStorage: _sessionStorage, ...options }) => {\n\treturn new StorageAdapter({\n\t\tmethods: createWebSessionStorageMethods(_sessionStorage),\n\t\t...options\n\t});\n};\nfunction createTypedWebSessionStorage(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options;\n\treturn createTypedStorage({\n\t\tstorageAdapter: createWebSessionStorageAdapter(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\n//#endregion\n//#region src/util/storage_adapter/specific/cloudflare/durable_object/durable_object_storage.ts\nfunction createDurableObjectStorageMethods(durableObjectStorage) {\n\treturn {\n\t\ttype: \"json\",\n\t\tdurable: true,\n\t\tgetItem: (key) => durableObjectStorage.get(key),\n\t\tsetItem: (key, value) => durableObjectStorage.put(key, value),\n\t\tremoveItem: async (key) => {\n\t\t\tawait durableObjectStorage.delete(key);\n\t\t}\n\t};\n}\n/**\n* Wraps a Durable Object's storage in the generic StorageAdapter interface, e.g. for handing to a\n* ClientCryptoKeyLink so it can persist its keys inside the DO's own storage.\n*/\nconst createDurableObjectStorageAdapter = ({ durableObjectStorage, ...options }) => {\n\treturn new StorageAdapter({\n\t\tmethods: createDurableObjectStorageMethods(durableObjectStorage),\n\t\t...options\n\t});\n};\nfunction createDurableObjectTypedStorage(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options;\n\treturn createTypedStorage({\n\t\tstorageAdapter: createDurableObjectStorageAdapter(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\n//#endregion\n//#region src/util/storage_adapter/specific/cloudflare/kv/kv_storage.ts\nfunction createKVStorageMethods({ kvNamespace, defaultPutOptions }) {\n\treturn {\n\t\ttype: \"string\",\n\t\tdurable: true,\n\t\tgetItem: (key) => kvNamespace.get(key),\n\t\tsetItem: (key, value) => kvNamespace.put(key, value, defaultPutOptions),\n\t\tremoveItem: (key) => kvNamespace.delete(key)\n\t};\n}\n/**\n* Wraps a Cloudflare KV namespace binding in the generic StorageAdapter interface, e.g. for handing\n* to a ClientCryptoKeyLink so it can persist its keys inside KV.\n*/\nconst createKVStorageAdapter = ({ kvNamespace, defaultPutOptions, ...options }) => {\n\treturn new StorageAdapter({\n\t\tmethods: createKVStorageMethods({\n\t\t\tkvNamespace,\n\t\t\tdefaultPutOptions\n\t\t}),\n\t\t...options\n\t});\n};\nfunction createKVTypedStorage(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options;\n\treturn createTypedStorage({\n\t\tstorageAdapter: createKVStorageAdapter(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\n//#endregion\n//#region src/util/storage_adapter/specific/memory/memory_storage.ts\nfunction createMemoryStorageMethods_string(memoryStorageMap = /* @__PURE__ */ new Map()) {\n\treturn {\n\t\ttype: \"string\",\n\t\tdurable: false,\n\t\tgetItem: async (key) => memoryStorageMap.get(key) ?? null,\n\t\tsetItem: async (key, value) => {\n\t\t\tmemoryStorageMap.set(key, value);\n\t\t},\n\t\tremoveItem: async (key) => {\n\t\t\tmemoryStorageMap.delete(key);\n\t\t}\n\t};\n}\nconst createMemoryStorageAdapter_string = (options) => {\n\treturn new StorageAdapter({\n\t\tmethods: createMemoryStorageMethods_string(options?.memoryStorageMap),\n\t\t...options\n\t});\n};\nfunction createTypedMemoryStorage_string(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options ?? {};\n\treturn createTypedStorage({\n\t\tstorageAdapter: createMemoryStorageAdapter_string(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\nfunction createMemoryStorageMethods_json(memoryStorageMap = /* @__PURE__ */ new Map()) {\n\treturn {\n\t\ttype: \"json\",\n\t\tdurable: false,\n\t\tgetItem: async (key) => memoryStorageMap.get(key),\n\t\tsetItem: async (key, value) => {\n\t\t\tmemoryStorageMap.set(key, value);\n\t\t},\n\t\tremoveItem: async (key) => {\n\t\t\tmemoryStorageMap.delete(key);\n\t\t}\n\t};\n}\nconst createMemoryStorageAdapter_json = (options) => {\n\treturn new StorageAdapter({\n\t\tmethods: createMemoryStorageMethods_json(options?.memoryStorageMap),\n\t\t...options\n\t});\n};\nfunction createTypedMemoryStorage_json(options) {\n\tconst { schemas, onInvalid, ...adapterOptions } = options ?? {};\n\treturn createTypedStorage({\n\t\tstorageAdapter: createMemoryStorageAdapter_json(adapterOptions),\n\t\tschemas,\n\t\tonInvalid\n\t});\n}\n//#endregion\n//#region src/util/timing/unrefTimer.ts\n/**\n* Detach a pending timer from the event loop so it never, by itself, keeps a Node process (or a\n* test runner) alive — a no-op in browsers and Workers, where a timer handle is a plain `number`\n* with no `unref`.\n*\n* It exists to keep the one cross-environment shape difference in a single place instead of at every\n* timer site: the `ReturnType<typeof setTimeout>` a caller holds is `NodeJS.Timeout` under Node (it\n* carries `unref`) and a bare `number` under the DOM lib (it does not). Typing the parameter as the\n* union of both lets every `setTimeout` handle pass without a cast, and the `typeof` narrows to the\n* only arm that has the method.\n*/\nfunction unrefTimer(timer) {\n\tif (typeof timer !== \"number\") timer.unref?.();\n}\n//#endregion\nexport { vEncryptedAesGcmPayload as $, serializeX25519Key_Jwk as A, convertEd25519JwkDataStringToSerializedKeyData as B, encryptJsonWithGeneratedKey as C, encryptBytesWithAesGcmKey as Ct, ClientCryptoKeyLink as D, createSharedBitsFromX25519 as Dt, importPortableAesGcmKeyFromString as E, createAesGcmKeyFromX25519Keys as Et, serializeEd25519Key_Jwk as F, convertX25519JwkDataStringToObject as G, convertEd25519RawDataStringToSerializedKeyData as H, importEd25519Key as I, convertX25519RawDataStringToSerializedKeyData as J, convertX25519JwkDataStringToSerializedKeyData as K, convertEd25519FormattedStringToObject as L, generateX25519KeyPair as M, verifyWithKeyEd25519 as N, IdentityNotProvisionedError as O, serializeEd25519Key_Raw as P, vCryptoKeyPairDataX25519 as Q, convertEd25519FormattedStringToSerializedKeyData as R, decryptJsonWithKeyString as S, encryptTextDataWithAesGcmKey as St, generatePortableAesGcmKey as T, decryptBytesWithAesGcmKey as Tt, convertX25519FormattedStringToObject as U, convertEd25519RawDataStringToObject as V, convertX25519FormattedStringToSerializedKeyData as W, ECryptoKeyFormat as X, ECryptoKeyAlgo as Y, vCryptoKeyPairDataEd25519 as Z, createWebLocalStorageMethods as _, sha256Hex as _t, createMemoryStorageMethods_string as a, vVerifyChallengeWithSignature_WithThrow_Input as at, StorageAdapter as b, buildCanonicalChallenge as bt, createKVStorageAdapter as c, StorageValidationError as ct, createDurableObjectStorageAdapter as d, signCombinedTextDataWithKeyEd25519 as dt, vSerializedCryptoKeyDataEd25519_Jwk as et, createDurableObjectStorageMethods as f, signTextDataWithKeyEd25519 as ft, createWebLocalStorageAdapter as g, sha256Bytes as gt, createTypedWebSessionStorage as h, sha256Base64 as ht, createMemoryStorageMethods_json as i, vVerifyChallengeWithSignature_Input as it, importX25519Key as j, serializeX25519Key_Raw as k, createKVStorageMethods as l, buildVerifyKeyBoundInfoString as lt, createTypedWebLocalStorage as m, hashCanonicalJsonSha256Hex as mt, createMemoryStorageAdapter_json as n, vSerializedCryptoKeyDataX25519_Jwk as nt, createTypedMemoryStorage_json as o, generateEd25519KeyPair as ot, createDurableObjectTypedStorage as p, hashCanonicalJsonSha256Base64 as pt, convertX25519RawDataStringToObject as q, createMemoryStorageAdapter_string as r, vSerializedCryptoKeyDataX25519_Raw as rt, createTypedMemoryStorage_string as s, createTypedStorage as st, unrefTimer as t, vSerializedCryptoKeyDataEd25519_Raw as tt, createKVTypedStorage as u, DEFAULT_COMBINED_TEXT_DATA_SEPARATOR as ut, createWebSessionStorageAdapter as v, base64ToBytes as vt, exportPortableAesGcmKeyToString as w, decryptTextDataWithAesGcmKey as wt, EStorageAdapterType as x, stringifyCanonicalJson as xt, createWebSessionStorageMethods as y, bytesToBase64 as yt, convertEd25519JwkDataStringToObject as z };\n\n//# sourceMappingURL=util-DiEla9R9.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAIA,MAAM,UAAU,OAAO,OAAO,OAAO,GAAG,CAAC;AACzC,SAAS,QAAQ,GAAG;CAKhB,OAAQ,aAAa,cAChB,YAAY,OAAO,CAAC,KACjB,EAAE,YAAY,SAAS,gBACvB,uBAAuB,KACvB,EAAE,sBAAsB;AACpC;;AAEA,SAAS,OAAO,GAAG;CACf,IAAI,CAAC,QAAQ,CAAC,GACV,MAAM,IAAI,UAAU,qBAAqB;AACjD;AAkBA,SAAS,KAAK,OAAO,OAAO;CACxB,IAAI,OAAO,UAAU,UACjB,MAAM,IAAI,UAAU,GAAG,MAAM,kBAAkB;CACnD,OAAO;AACX;AACA,SAAS,QAAQ,GAAG,QAAQ,UAAU;CAClC,IAAI,OAAO,MAAM,UACb,MAAM,IAAI,UAAU,GAAG,MAAM,yBAAyB,OAAO,GAAG;CACpE,IAAI,CAAC,OAAO,cAAc,CAAC,GACvB,MAAM,IAAI,WAAW,GAAG,MAAM,+BAA+B,GAAG;AACxE;AAKA,SAAS,MAAM,GAAG,MAAM;CACpB,MAAM,MAAM,MAAM;CAElB,MAAM,QAAQ,GAAG,OAAO,MAAM,EAAE,EAAE,CAAC,CAAC;CAKpC,OAAO;EAAE,QAHM,KAAK,KAAK,MAAM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