;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "2107310d-230c-d93d-0bb1-1d3eea0a4c08")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 405126, (e, t, n) => {
    "use strict";
    Object.defineProperty(n, "__esModule", {
        value: !0
    }), n.toBig = n.shrSL = n.shrSH = n.rotrSL = n.rotrSH = n.rotrBL = n.rotrBH = n.rotr32L = n.rotr32H = n.rotlSL = n.rotlSH = n.rotlBL = n.rotlBH = n.add5L = n.add5H = n.add4L = n.add4H = n.add3L = n.add3H = void 0, n.add = w, n.fromBig = r, n.split = a;
    let s = BigInt(0x100000000 - 1),
        i = BigInt(32);

    function r(e, t = !1) {
        return t ? {
            h: Number(e & s),
            l: Number(e >> i & s)
        } : {
            h: 0 | Number(e >> i & s),
            l: 0 | Number(e & s)
        }
    }

    function a(e, t = !1) {
        let n = e.length,
            s = new Uint32Array(n),
            i = new Uint32Array(n);
        for (let a = 0; a < n; a++) {
            let {
                h: n,
                l: o
            } = r(e[a], t);
            [s[a], i[a]] = [n, o]
        }
        return [s, i]
    }
    let o = (e, t) => BigInt(e >>> 0) << i | BigInt(t >>> 0);
    n.toBig = o;
    let l = (e, t, n) => e >>> n;
    n.shrSH = l;
    let c = (e, t, n) => e << 32 - n | t >>> n;
    n.shrSL = c;
    let h = (e, t, n) => e >>> n | t << 32 - n;
    n.rotrSH = h;
    let d = (e, t, n) => e << 32 - n | t >>> n;
    n.rotrSL = d;
    let u = (e, t, n) => e << 64 - n | t >>> n - 32;
    n.rotrBH = u;
    let p = (e, t, n) => e >>> n - 32 | t << 64 - n;
    n.rotrBL = p;
    let f = (e, t) => t;
    n.rotr32H = f;
    let g = (e, t) => e;
    n.rotr32L = g;
    let m = (e, t, n) => e << n | t >>> 32 - n;
    n.rotlSH = m;
    let y = (e, t, n) => t << n | e >>> 32 - n;
    n.rotlSL = y;
    let _ = (e, t, n) => t << n - 32 | e >>> 64 - n;
    n.rotlBH = _;
    let b = (e, t, n) => e << n - 32 | t >>> 64 - n;

    function w(e, t, n, s) {
        let i = (t >>> 0) + (s >>> 0);
        return {
            h: e + n + (i / 0x100000000 | 0) | 0,
            l: 0 | i
        }
    }
    n.rotlBL = b;
    let v = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0);
    n.add3L = v;
    let k = (e, t, n, s) => t + n + s + (e / 0x100000000 | 0) | 0;
    n.add3H = k;
    let I = (e, t, n, s) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (s >>> 0);
    n.add4L = I;
    let C = (e, t, n, s, i) => t + n + s + i + (e / 0x100000000 | 0) | 0;
    n.add4H = C;
    let E = (e, t, n, s, i) => (e >>> 0) + (t >>> 0) + (n >>> 0) + (s >>> 0) + (i >>> 0);
    n.add5L = E;
    let x = (e, t, n, s, i, r) => t + n + s + i + r + (e / 0x100000000 | 0) | 0;
    n.add5H = x, n.default = {
        fromBig: r,
        split: a,
        toBig: o,
        shrSH: l,
        shrSL: c,
        rotrSH: h,
        rotrSL: d,
        rotrBH: u,
        rotrBL: p,
        rotr32H: f,
        rotr32L: g,
        rotlSH: m,
        rotlSL: y,
        rotlBH: _,
        rotlBL: b,
        add: w,
        add3L: v,
        add3H: k,
        add4L: I,
        add4H: C,
        add5H: x,
        add5L: E
    }
}, 733174, (e, t, n) => {
    "use strict";
    Object.defineProperty(n, "__esModule", {
        value: !0
    }), n.crypto = void 0, n.crypto = "object" == typeof globalThis && "crypto" in globalThis ? globalThis.crypto : void 0
}, 443829, (e, t, n) => {
    "use strict";
    Object.defineProperty(n, "__esModule", {
        value: !0
    }), n.wrapXOFConstructorWithOpts = n.wrapConstructorWithOpts = n.wrapConstructor = n.Hash = n.nextTick = n.swap32IfBE = n.byteSwapIfBE = n.swap8IfBE = n.isLE = void 0, n.isBytes = i, n.anumber = r, n.abytes = a, n.ahash = function(e) {
        if ("function" != typeof e || "function" != typeof e.create) throw Error("Hash should be wrapped by utils.createHasher");
        r(e.outputLen), r(e.blockLen)
    }, n.aexists = function(e, t = !0) {
        if (e.destroyed) throw Error("Hash instance has been destroyed");
        if (t && e.finished) throw Error("Hash#digest() has already been called")
    }, n.aoutput = function(e, t) {
        a(e);
        let n = t.outputLen;
        if (e.length < n) throw Error("digestInto() expects output buffer of length at least " + n)
    }, n.u8 = function(e) {
        return new Uint8Array(e.buffer, e.byteOffset, e.byteLength)
    }, n.u32 = function(e) {
        return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4))
    }, n.clean = function(...e) {
        for (let t = 0; t < e.length; t++) e[t].fill(0)
    }, n.createView = function(e) {
        return new DataView(e.buffer, e.byteOffset, e.byteLength)
    }, n.rotr = function(e, t) {
        return e << 32 - t | e >>> t
    }, n.rotl = function(e, t) {
        return e << t | e >>> 32 - t >>> 0
    }, n.byteSwap = o, n.byteSwap32 = l, n.bytesToHex = function(e) {
        if (a(e), c) return e.toHex();
        let t = "";
        for (let n = 0; n < e.length; n++) t += h[e[n]];
        return t
    }, n.hexToBytes = function(e) {
        if ("string" != typeof e) throw Error("hex string expected, got " + typeof e);
        if (c) return Uint8Array.fromHex(e);
        let t = e.length,
            n = t / 2;
        if (t % 2) throw Error("hex string expected, got unpadded hex of length " + t);
        let s = new Uint8Array(n);
        for (let t = 0, i = 0; t < n; t++, i += 2) {
            let n = d(e.charCodeAt(i)),
                r = d(e.charCodeAt(i + 1));
            if (void 0 === n || void 0 === r) throw Error('hex string expected, got non-hex character "' + (e[i] + e[i + 1]) + '" at index ' + i);
            s[t] = 16 * n + r
        }
        return s
    }, n.asyncLoop = u, n.utf8ToBytes = p, n.bytesToUtf8 = function(e) {
        return new TextDecoder().decode(e)
    }, n.toBytes = f, n.kdfInputToBytes = function(e) {
        return "string" == typeof e && (e = p(e)), a(e), e
    }, n.concatBytes = function(...e) {
        let t = 0;
        for (let n = 0; n < e.length; n++) {
            let s = e[n];
            a(s), t += s.length
        }
        let n = new Uint8Array(t);
        for (let t = 0, s = 0; t < e.length; t++) {
            let i = e[t];
            n.set(i, s), s += i.length
        }
        return n
    }, n.checkOpts = function(e, t) {
        if (void 0 !== t && "[object Object]" !== ({}).toString.call(t)) throw Error("options should be object or undefined");
        return Object.assign(e, t)
    }, n.createHasher = g, n.createOptHasher = m, n.createXOFer = y, n.randomBytes = function(e = 32) {
        if (s.crypto && "function" == typeof s.crypto.getRandomValues) return s.crypto.getRandomValues(new Uint8Array(e));
        if (s.crypto && "function" == typeof s.crypto.randomBytes) return Uint8Array.from(s.crypto.randomBytes(e));
        throw Error("crypto.getRandomValues must be defined")
    };
    let s = e.r(733174);

    function i(e) {
        return e instanceof Uint8Array || ArrayBuffer.isView(e) && "Uint8Array" === e.constructor.name
    }

    function r(e) {
        if (!Number.isSafeInteger(e) || e < 0) throw Error("positive integer expected, got " + e)
    }

    function a(e, ...t) {
        if (!i(e)) throw Error("Uint8Array expected");
        if (t.length > 0 && !t.includes(e.length)) throw Error("Uint8Array expected of length " + t + ", got length=" + e.length)
    }

    function o(e) {
        return e << 24 & 0xff000000 | e << 8 & 0xff0000 | e >>> 8 & 65280 | e >>> 24 & 255
    }

    function l(e) {
        for (let t = 0; t < e.length; t++) e[t] = o(e[t]);
        return e
    }
    n.isLE = 68 === new Uint8Array(new Uint32Array([0x11223344]).buffer)[0], n.swap8IfBE = n.isLE ? e => e : e => o(e), n.byteSwapIfBE = n.swap8IfBE, n.swap32IfBE = n.isLE ? e => e : l;
    let c = "function" == typeof Uint8Array.from([]).toHex && "function" == typeof Uint8Array.fromHex,
        h = Array.from({
            length: 256
        }, (e, t) => t.toString(16).padStart(2, "0"));

    function d(e) {
        return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : void 0
    }
    async function u(e, t, s) {
        let i = Date.now();
        for (let r = 0; r < e; r++) {
            s(r);
            let e = Date.now() - i;
            e >= 0 && e < t || (await (0, n.nextTick)(), i += e)
        }
    }

    function p(e) {
        if ("string" != typeof e) throw Error("string expected");
        return new Uint8Array(new TextEncoder().encode(e))
    }

    function f(e) {
        return "string" == typeof e && (e = p(e)), a(e), e
    }

    function g(e) {
        let t = t => e().update(f(t)).digest(),
            n = e();
        return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t
    }

    function m(e) {
        let t = (t, n) => e(n).update(f(t)).digest(),
            n = e({});
        return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = t => e(t), t
    }

    function y(e) {
        let t = (t, n) => e(n).update(f(t)).digest(),
            n = e({});
        return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = t => e(t), t
    }
    n.nextTick = async () => {}, n.Hash = class {}, n.wrapConstructor = g, n.wrapConstructorWithOpts = m, n.wrapXOFConstructorWithOpts = y
}, 732689, (e, t, n) => {
    "use strict";
    Object.defineProperty(n, "__esModule", {
        value: !0
    }), n.shake256 = n.shake128 = n.keccak_512 = n.keccak_384 = n.keccak_256 = n.keccak_224 = n.sha3_512 = n.sha3_384 = n.sha3_256 = n.sha3_224 = n.Keccak = void 0, n.keccakP = b;
    let s = e.r(405126),
        i = e.r(443829),
        r = BigInt(0),
        a = BigInt(1),
        o = BigInt(2),
        l = BigInt(7),
        c = BigInt(256),
        h = BigInt(113),
        d = [],
        u = [],
        p = [];
    for (let e = 0, t = a, n = 1, s = 0; e < 24; e++) {
        [n, s] = [s, (2 * n + 3 * s) % 5], d.push(2 * (5 * s + n)), u.push((e + 1) * (e + 2) / 2 % 64);
        let i = r;
        for (let e = 0; e < 7; e++)(t = (t << a ^ (t >> l) * h) % c) & o && (i ^= a << (a << BigInt(e)) - a);
        p.push(i)
    }
    let f = (0, s.split)(p, !0),
        g = f[0],
        m = f[1],
        y = (e, t, n) => n > 32 ? (0, s.rotlBH)(e, t, n) : (0, s.rotlSH)(e, t, n),
        _ = (e, t, n) => n > 32 ? (0, s.rotlBL)(e, t, n) : (0, s.rotlSL)(e, t, n);

    function b(e, t = 24) {
        let n = new Uint32Array(10);
        for (let s = 24 - t; s < 24; s++) {
            for (let t = 0; t < 10; t++) n[t] = e[t] ^ e[t + 10] ^ e[t + 20] ^ e[t + 30] ^ e[t + 40];
            for (let t = 0; t < 10; t += 2) {
                let s = (t + 8) % 10,
                    i = (t + 2) % 10,
                    r = n[i],
                    a = n[i + 1],
                    o = y(r, a, 1) ^ n[s],
                    l = _(r, a, 1) ^ n[s + 1];
                for (let n = 0; n < 50; n += 10) e[t + n] ^= o, e[t + n + 1] ^= l
            }
            let t = e[2],
                i = e[3];
            for (let n = 0; n < 24; n++) {
                let s = u[n],
                    r = y(t, i, s),
                    a = _(t, i, s),
                    o = d[n];
                t = e[o], i = e[o + 1], e[o] = r, e[o + 1] = a
            }
            for (let t = 0; t < 50; t += 10) {
                for (let s = 0; s < 10; s++) n[s] = e[t + s];
                for (let s = 0; s < 10; s++) e[t + s] ^= ~n[(s + 2) % 10] & n[(s + 4) % 10]
            }
            e[0] ^= g[s], e[1] ^= m[s]
        }(0, i.clean)(n)
    }
    class w extends i.Hash {
        constructor(e, t, n, s = !1, r = 24) {
            if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, (0, i.anumber)(n), !(0 < e && e < 200)) throw Error("only keccak-f1600 function is supported");
            this.state = new Uint8Array(200), this.state32 = (0, i.u32)(this.state)
        }
        clone() {
            return this._cloneInto()
        }
        keccak() {
            (0, i.swap32IfBE)(this.state32), b(this.state32, this.rounds), (0, i.swap32IfBE)(this.state32), this.posOut = 0, this.pos = 0
        }
        update(e) {
            (0, i.aexists)(this), e = (0, i.toBytes)(e), (0, i.abytes)(e);
            let {
                blockLen: t,
                state: n
            } = this, s = e.length;
            for (let i = 0; i < s;) {
                let r = Math.min(t - this.pos, s - i);
                for (let t = 0; t < r; t++) n[this.pos++] ^= e[i++];
                this.pos === t && this.keccak()
            }
            return this
        }
        finish() {
            if (this.finished) return;
            this.finished = !0;
            let {
                state: e,
                suffix: t,
                pos: n,
                blockLen: s
            } = this;
            e[n] ^= t, (128 & t) != 0 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak()
        }
        writeInto(e) {
            (0, i.aexists)(this, !1), (0, i.abytes)(e), this.finish();
            let t = this.state,
                {
                    blockLen: n
                } = this;
            for (let s = 0, i = e.length; s < i;) {
                this.posOut >= n && this.keccak();
                let r = Math.min(n - this.posOut, i - s);
                e.set(t.subarray(this.posOut, this.posOut + r), s), this.posOut += r, s += r
            }
            return e
        }
        xofInto(e) {
            if (!this.enableXOF) throw Error("XOF is not possible for this instance");
            return this.writeInto(e)
        }
        xof(e) {
            return (0, i.anumber)(e), this.xofInto(new Uint8Array(e))
        }
        digestInto(e) {
            if ((0, i.aoutput)(e, this), this.finished) throw Error("digest() was already called");
            return this.writeInto(e), this.destroy(), e
        }
        digest() {
            return this.digestInto(new Uint8Array(this.outputLen))
        }
        destroy() {
            this.destroyed = !0, (0, i.clean)(this.state)
        }
        _cloneInto(e) {
            let {
                blockLen: t,
                suffix: n,
                outputLen: s,
                rounds: i,
                enableXOF: r
            } = this;
            return e || (e = new w(t, n, s, r, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = n, e.outputLen = s, e.enableXOF = r, e.destroyed = this.destroyed, e
        }
    }
    n.Keccak = w;
    let v = (e, t, n) => (0, i.createHasher)(() => new w(t, e, n));
    n.sha3_224 = v(6, 144, 28), n.sha3_256 = v(6, 136, 32), n.sha3_384 = v(6, 104, 48), n.sha3_512 = v(6, 72, 64), n.keccak_224 = v(1, 144, 28), n.keccak_256 = v(1, 136, 32), n.keccak_384 = v(1, 104, 48), n.keccak_512 = v(1, 72, 64);
    let k = (e, t, n) => (0, i.createXOFer)((s = {}) => new w(t, e, void 0 === s.dkLen ? n : s.dkLen, !0));
    n.shake128 = k(31, 168, 16), n.shake256 = k(31, 136, 32)
}, 120117, (e, t, n) => {
    var s = e.i(93257);
    let {
        keccak_256: i
    } = e.r(732689);

    function r(e) {
        return s.Buffer.allocUnsafe(e).fill(0)
    }

    function a(e, t) {
        let n = e.toString(16);
        n.length % 2 != 0 && (n = "0" + n);
        let i = n.match(/.{1,2}/g).map(e => parseInt(e, 16));
        for (; i.length < t;) i.unshift(0);
        return s.Buffer.from(i)
    }

    function o(e, t, n) {
        let s = r(t);
        return (e = l(e), n) ? e.length < t ? (e.copy(s), s) : e.slice(0, t) : e.length < t ? (e.copy(s, t - e.length), s) : e.slice(-t)
    }

    function l(e) {
        if (!s.Buffer.isBuffer(e))
            if (Array.isArray(e)) e = s.Buffer.from(e);
            else if ("string" == typeof e) {
            var t;
            e = c(e) ? s.Buffer.from((t = h(e)).length % 2 ? "0" + t : t, "hex") : s.Buffer.from(e)
        } else if ("number" == typeof e) e = intToBuffer(e);
        else if (null == e) e = s.Buffer.allocUnsafe(0);
        else if ("bigint" == typeof e) e = a(e);
        else if (e.toArray) e = s.Buffer.from(e.toArray());
        else throw Error("invalid type");
        return e
    }

    function c(e) {
        return "string" == typeof e && e.match(/^0x[0-9A-Fa-f]*$/)
    }

    function h(e) {
        return "string" == typeof e && e.startsWith("0x") ? e.slice(2) : e
    }
    t.exports = {
        zeros: r,
        setLength: o,
        setLengthRight: function(e, t) {
            return o(e, t, !0)
        },
        isHexString: c,
        stripHexPrefix: h,
        toBuffer: l,
        bufferToHex: function(e) {
            return "0x" + (e = l(e)).toString("hex")
        },
        keccak: function(e, t) {
            if (e = l(e), t || (t = 256), 256 !== t) throw Error("unsupported");
            return s.Buffer.from(i(new Uint8Array(e)))
        },
        bitLengthFromBigInt: function(e) {
            return e.toString(2).length
        },
        bufferBEFromBigInt: a,
        twosFromBigInt: function(e, t) {
            return (e < 0 n ? (~e & (1 n << BigInt(t)) - 1 n) + 1 n : e) & (1 n << BigInt(t)) - 1 n
        }
    }
}, 768654, (e, t, n) => {
    var s = e.i(93257);
    let i = e.r(120117);

    function r(e) {
        if (e.startsWith("int[")) return "int256" + e.slice(3);
        if ("int" === e) return "int256";
        if (e.startsWith("uint[")) return "uint256" + e.slice(4);
        if ("uint" === e) return "uint256";
        if (e.startsWith("fixed[")) return "fixed128x128" + e.slice(5);
        else if ("fixed" === e) return "fixed128x128";
        else if (e.startsWith("ufixed[")) return "ufixed128x128" + e.slice(6);
        else if ("ufixed" === e) return "ufixed128x128";
        return e
    }

    function a(e) {
        return Number.parseInt(/^\D+(\d+)$/.exec(e)[1], 10)
    }

    function o(e) {
        var t = /^\D+(\d+)x(\d+)$/.exec(e);
        return [Number.parseInt(t[1], 10), Number.parseInt(t[2], 10)]
    }

    function l(e) {
        var t = e.match(/(.*)\[(.*?)\]$/);
        return t ? "" === t[2] ? "dynamic" : Number.parseInt(t[2], 10) : null
    }

    function c(e) {
        var t = typeof e;
        if ("string" === t || "number" === t) return BigInt(e);
        if ("bigint" === t) return e;
        throw Error("Argument is not a number")
    }

    function h(e, t) {
        if ("address" === e) return h("uint160", c(t));
        if ("bool" === e) return h("uint8", +!!t);
        if ("string" === e) return h("bytes", new s.Buffer(t, "utf8"));
        if ((p = e).lastIndexOf("]") === p.length - 1) {
            if (void 0 === t.length) throw Error("Not an array?");
            if ("dynamic" !== (n = l(e)) && 0 !== n && t.length > n) throw Error("Elements exceed array size: " + n);
            for (u in d = [], e = e.slice(0, e.lastIndexOf("[")), "string" == typeof t && (t = JSON.parse(t)), t) d.push(h(e, t[u]));
            if ("dynamic" === n) {
                var n, r, d, u, p, f = h("uint256", t.length);
                d.unshift(f)
            }
            return s.Buffer.concat(d)
        } else if ("bytes" === e) return t = new s.Buffer(t), d = s.Buffer.concat([h("uint256", t.length), t]), t.length % 32 != 0 && (d = s.Buffer.concat([d, i.zeros(32 - t.length % 32)])), d;
        else if (e.startsWith("bytes")) {
            if ((n = a(e)) < 1 || n > 32) throw Error("Invalid bytes<N> width: " + n);
            return i.setLengthRight(t, 32)
        } else if (e.startsWith("uint")) {
            if ((n = a(e)) % 8 || n < 8 || n > 256) throw Error("Invalid uint<N> width: " + n);
            r = c(t);
            let s = i.bitLengthFromBigInt(r);
            if (s > n) throw Error("Supplied uint exceeds width: " + n + " vs " + s);
            if (r < 0) throw Error("Supplied uint is negative");
            return i.bufferBEFromBigInt(r, 32)
        } else if (e.startsWith("int")) {
            if ((n = a(e)) % 8 || n < 8 || n > 256) throw Error("Invalid int<N> width: " + n);
            r = c(t);
            let s = i.bitLengthFromBigInt(r);
            if (s > n) throw Error("Supplied int exceeds width: " + n + " vs " + s);
            let o = i.twosFromBigInt(r, 256);
            return i.bufferBEFromBigInt(o, 32)
        } else if (e.startsWith("ufixed")) {
            if (n = o(e), (r = c(t)) < 0) throw Error("Supplied ufixed is negative");
            return h("uint256", r * BigInt(2) ** BigInt(n[1]))
        } else if (e.startsWith("fixed")) return n = o(e), h("int256", c(t) * BigInt(2) ** BigInt(n[1]));
        throw Error("Unsupported or invalid type: " + e)
    }

    function d(e, t) {
        if (e.length !== t.length) throw Error("Number of types are not matching the values");
        for (var n, o, l = [], h = 0; h < e.length; h++) {
            var d = r(e[h]),
                u = t[h];
            if ("bytes" === d) l.push(u);
            else if ("string" === d) l.push(new s.Buffer(u, "utf8"));
            else if ("bool" === d) l.push(new s.Buffer(u ? "01" : "00", "hex"));
            else if ("address" === d) l.push(i.setLength(u, 20));
            else if (d.startsWith("bytes")) {
                if ((n = a(d)) < 1 || n > 32) throw Error("Invalid bytes<N> width: " + n);
                l.push(i.setLengthRight(u, n))
            } else if (d.startsWith("uint")) {
                if ((n = a(d)) % 8 || n < 8 || n > 256) throw Error("Invalid uint<N> width: " + n);
                o = c(u);
                let e = i.bitLengthFromBigInt(o);
                if (e > n) throw Error("Supplied uint exceeds width: " + n + " vs " + e);
                l.push(i.bufferBEFromBigInt(o, n / 8))
            } else if (d.startsWith("int")) {
                if ((n = a(d)) % 8 || n < 8 || n > 256) throw Error("Invalid int<N> width: " + n);
                o = c(u);
                let e = i.bitLengthFromBigInt(o);
                if (e > n) throw Error("Supplied int exceeds width: " + n + " vs " + e);
                let t = i.twosFromBigInt(o, n);
                l.push(i.bufferBEFromBigInt(t, n / 8))
            } else throw Error("Unsupported or invalid type: " + d)
        }
        return s.Buffer.concat(l)
    }
    t.exports = {
        rawEncode: function(e, t) {
            var n = [],
                i = [],
                a = 32 * e.length;
            for (var o in e) {
                var c = r(e[o]),
                    d = h(c, t[o]);
                "string" === c || "bytes" === c || "dynamic" === l(c) ? (n.push(h("uint256", a)), i.push(d), a += d.length) : n.push(d)
            }
            return s.Buffer.concat(n.concat(i))
        },
        solidityPack: d,
        soliditySHA3: function(e, t) {
            return i.keccak(d(e, t))
        }
    }
}, 86986, (e, t, n) => {
    var s = e.i(93257);
    let i = e.r(120117),
        r = e.r(768654),
        a = {
            type: "object",
            properties: {
                types: {
                    type: "object",
                    additionalProperties: {
                        type: "array",
                        items: {
                            type: "object",
                            properties: {
                                name: {
                                    type: "string"
                                },
                                type: {
                                    type: "string"
                                }
                            },
                            required: ["name", "type"]
                        }
                    }
                },
                primaryType: {
                    type: "string"
                },
                domain: {
                    type: "object"
                },
                message: {
                    type: "object"
                }
            },
            required: ["types", "primaryType", "domain", "message"]
        },
        o = {
            encodeData(e, t, n, a = !0) {
                let o = ["bytes32"],
                    l = [this.hashType(e, n)];
                if (a) {
                    let c = (e, t, o) => {
                        if (void 0 !== n[t]) return ["bytes32", null == o ? "0x0000000000000000000000000000000000000000000000000000000000000000" : i.keccak(this.encodeData(t, o, n, a))];
                        if (void 0 === o) throw Error(`missing value for field ${e} of type ${t}`);
                        if ("bytes" === t) return ["bytes32", i.keccak(o)];
                        if ("string" === t) return "string" == typeof o && (o = s.Buffer.from(o, "utf8")), ["bytes32", i.keccak(o)];
                        if (t.lastIndexOf("]") === t.length - 1) {
                            let n = t.slice(0, t.lastIndexOf("[")),
                                s = o.map(t => c(e, n, t));
                            return ["bytes32", i.keccak(r.rawEncode(s.map(([e]) => e), s.map(([, e]) => e)))]
                        }
                        return [t, o]
                    };
                    for (let s of n[e]) {
                        let [e, n] = c(s.name, s.type, t[s.name]);
                        o.push(e), l.push(n)
                    }
                } else
                    for (let r of n[e]) {
                        let e = t[r.name];
                        if (void 0 !== e)
                            if ("bytes" === r.type) o.push("bytes32"), e = i.keccak(e), l.push(e);
                            else if ("string" === r.type) o.push("bytes32"), "string" == typeof e && (e = s.Buffer.from(e, "utf8")), e = i.keccak(e), l.push(e);
                        else if (void 0 !== n[r.type]) o.push("bytes32"), e = i.keccak(this.encodeData(r.type, e, n, a)), l.push(e);
                        else if (r.type.lastIndexOf("]") === r.type.length - 1) throw Error("Arrays currently unimplemented in encodeData");
                        else o.push(r.type), l.push(e)
                    }
                return r.rawEncode(o, l)
            },
            encodeType(e, t) {
                let n = "",
                    s = this.findTypeDependencies(e, t).filter(t => t !== e);
                for (let i of s = [e].concat(s.sort())) {
                    if (!t[i]) throw Error("No type definition specified: " + i);
                    n += i + "(" + t[i].map(({
                        name: e,
                        type: t
                    }) => t + " " + e).join(",") + ")"
                }
                return n
            },
            findTypeDependencies(e, t, n = []) {
                if (e = e.match(/^\w*/)[0], n.includes(e) || void 0 === t[e]) return n;
                for (let s of (n.push(e), t[e]))
                    for (let e of this.findTypeDependencies(s.type, t, n)) n.includes(e) || n.push(e);
                return n
            },
            hashStruct(e, t, n, s = !0) {
                return i.keccak(this.encodeData(e, t, n, s))
            },
            hashType(e, t) {
                return i.keccak(this.encodeType(e, t))
            },
            sanitizeData(e) {
                let t = {};
                for (let n in a.properties) e[n] && (t[n] = e[n]);
                return t.types && (t.types = Object.assign({
                    EIP712Domain: []
                }, t.types)), t
            },
            hash(e, t = !0) {
                let n = this.sanitizeData(e),
                    r = [s.Buffer.from("1901", "hex")];
                return r.push(this.hashStruct("EIP712Domain", n.domain, n.types, t)), "EIP712Domain" !== n.primaryType && r.push(this.hashStruct(n.primaryType, n.message, n.types, t)), i.keccak(s.Buffer.concat(r))
            }
        };
    t.exports = {
        TYPED_MESSAGE_SCHEMA: a,
        TypedDataUtils: o,
        hashForSignTypedDataLegacy: function(e) {
            return function(e) {
                let t = Error("Expect argument to be non-empty array");
                if ("object" != typeof e || !e.length) throw t;
                let n = e.map(function(e) {
                        return "bytes" === e.type ? i.toBuffer(e.value) : e.value
                    }),
                    s = e.map(function(e) {
                        return e.type
                    }),
                    a = e.map(function(e) {
                        if (!e.name) throw t;
                        return e.type + " " + e.name
                    });
                return r.soliditySHA3(["bytes32", "bytes32"], [r.soliditySHA3(Array(e.length).fill("string"), a), r.soliditySHA3(s, n)])
            }(e.data)
        },
        hashForSignTypedData_v3: function(e) {
            return o.hash(e.data, !1)
        },
        hashForSignTypedData_v4: function(e) {
            return o.hash(e.data)
        }
    }
}, 570899, e => {
    "use strict";
    let t;
    var n = e.i(637608),
        s = e.i(687e3);
    class i {
        constructor(e, t) {
            this.scope = e, this.module = t
        }
        storeObject(e, t) {
            this.setItem(e, JSON.stringify(t))
        }
        loadObject(e) {
            let t = this.getItem(e);
            return t ? JSON.parse(t) : void 0
        }
        setItem(e, t) {
            localStorage.setItem(this.scopedKey(e), t)
        }
        getItem(e) {
            return localStorage.getItem(this.scopedKey(e))
        }
        removeItem(e) {
            localStorage.removeItem(this.scopedKey(e))
        }
        clear() {
            let e = this.scopedKey(""),
                t = [];
            for (let n = 0; n < localStorage.length; n++) {
                let s = localStorage.key(n);
                "string" == typeof s && s.startsWith(e) && t.push(s)
            }
            t.forEach(e => localStorage.removeItem(e))
        }
        scopedKey(e) {
            return `-${this.scope}${this.module?`:${this.module}`:""}:${e}`
        }
        static clearAll() {
            new i("CBWSDK").clear(), new i("walletlink").clear()
        }
    }
    var r = e.i(93257);
    let a = -32602,
        o = -32603,
        l = 4001,
        c = 4100,
        h = 4200,
        d = 4900,
        u = {
            "-32700": {
                standard: "JSON RPC 2.0",
                message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
            },
            "-32600": {
                standard: "JSON RPC 2.0",
                message: "The JSON sent is not a valid Request object."
            },
            "-32601": {
                standard: "JSON RPC 2.0",
                message: "The method does not exist / is not available."
            },
            "-32602": {
                standard: "JSON RPC 2.0",
                message: "Invalid method parameter(s)."
            },
            "-32603": {
                standard: "JSON RPC 2.0",
                message: "Internal JSON-RPC error."
            },
            "-32000": {
                standard: "EIP-1474",
                message: "Invalid input."
            },
            "-32001": {
                standard: "EIP-1474",
                message: "Resource not found."
            },
            "-32002": {
                standard: "EIP-1474",
                message: "Resource unavailable."
            },
            "-32003": {
                standard: "EIP-1474",
                message: "Transaction rejected."
            },
            "-32004": {
                standard: "EIP-1474",
                message: "Method not supported."
            },
            "-32005": {
                standard: "EIP-1474",
                message: "Request limit exceeded."
            },
            4001: {
                standard: "EIP-1193",
                message: "User rejected the request."
            },
            4100: {
                standard: "EIP-1193",
                message: "The requested account and/or method has not been authorized by the user."
            },
            4200: {
                standard: "EIP-1193",
                message: "The requested method is not supported by this Ethereum provider."
            },
            4900: {
                standard: "EIP-1193",
                message: "The provider is disconnected from all chains."
            },
            4901: {
                standard: "EIP-1193",
                message: "The provider is disconnected from the specified chain."
            },
            4902: {
                standard: "EIP-3085",
                message: "Unrecognized chain ID."
            }
        },
        p = "Unspecified error message.";

    function f(e, t = p) {
        if (e && Number.isInteger(e)) {
            var n;
            let t = e.toString();
            if (m(u, t)) return u[t].message;
            if ((n = e) >= -32099 && n <= -32e3) return "Unspecified server error."
        }
        return t
    }

    function g(e) {
        return e && "object" == typeof e && !Array.isArray(e) ? Object.assign({}, e) : e
    }

    function m(e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }

    function y(e, t) {
        return "object" == typeof e && null !== e && t in e && "string" == typeof e[t]
    }
    let _ = e => E(a, e),
        b = e => E(o, e),
        w = e => x(l, e),
        v = e => x(c, e),
        k = e => x(h, e),
        I = e => x(d, e),
        C = e => {
            if (!e || "object" != typeof e || Array.isArray(e)) throw Error("Ethereum Provider custom errors must provide single object argument.");
            let {
                code: t,
                message: n,
                data: s
            } = e;
            if (!n || "string" != typeof n) throw Error('"message" must be a nonempty string');
            return new L(t, n, s)
        };

    function E(e, t) {
        let [n, s] = S(t);
        return new M(e, n || f(e), s)
    }

    function x(e, t) {
        let [n, s] = S(t);
        return new L(e, n || f(e), s)
    }

    function S(e) {
        if (e) {
            if ("string" == typeof e) return [e];
            else if ("object" == typeof e && !Array.isArray(e)) {
                let {
                    message: t,
                    data: n
                } = e;
                if (t && "string" != typeof t) throw Error("Must specify string message.");
                return [t || void 0, n]
            }
        }
        return []
    }
    class M extends Error {
        constructor(e, t, n) {
            if (!Number.isInteger(e)) throw Error('"code" must be an integer.');
            if (!t || "string" != typeof t) throw Error('"message" must be a nonempty string.');
            super(t), this.code = e, void 0 !== n && (this.data = n)
        }
    }
    class L extends M {
        constructor(e, t, n) {
            if (! function(e) {
                    return Number.isInteger(e) && e >= 1e3 && e <= 4999
                }(e)) throw Error('"code" must be an integer such that: 1000 <= code <= 4999');
            super(e, t, n)
        }
    }

    function A(e) {
        return Math.floor(e)
    }
    let D = /^[0-9]*$/,
        T = /^[a-f0-9]*$/;

    function N(e) {
        return P(crypto.getRandomValues(new Uint8Array(e)))
    }

    function P(e) {
        return [...e].map(e => e.toString(16).padStart(2, "0")).join("")
    }

    function O(e) {
        return new Uint8Array(e.match(/.{1,2}/g).map(e => Number.parseInt(e, 16)))
    }

    function R(e, t = !1) {
        let n = e.toString("hex");
        return t ? `0x${n}` : n
    }

    function j(e) {
        return R(z(e), !0)
    }

    function U(e) {
        return e.toString(10)
    }

    function H(e) {
        return `0x${BigInt(e).toString(16)}`
    }

    function W(e) {
        return e.startsWith("0x") || e.startsWith("0X")
    }

    function B(e) {
        return W(e) ? e.slice(2) : e
    }

    function q(e) {
        return W(e) ? `0x${e.slice(2)}` : `0x${e}`
    }

    function V(e) {
        if ("string" != typeof e) return !1;
        let t = B(e).toLowerCase();
        return T.test(t)
    }

    function Z(e, t = !1) {
        let n = function(e, t = !1) {
            if ("string" == typeof e) {
                let n = B(e).toLowerCase();
                if (T.test(n)) return t ? `0x${n}` : n
            }
            throw _(`"${String(e)}" is not a hexadecimal string`)
        }(e, !1);
        return n.length % 2 == 1 && (n = `0${n}`), t ? `0x${n}` : n
    }

    function K(e) {
        if ("string" == typeof e) {
            let t = B(e).toLowerCase();
            if (V(t) && 40 === t.length) return q(t)
        }
        throw _(`Invalid Ethereum address: ${String(e)}`)
    }

    function z(e) {
        if (r.Buffer.isBuffer(e)) return e;
        if ("string" == typeof e) {
            if (V(e)) {
                let t = Z(e, !1);
                return r.Buffer.from(t, "hex")
            }
            return r.Buffer.from(e, "utf8")
        }
        throw _(`Not binary data: ${String(e)}`)
    }

    function F(e) {
        if ("number" == typeof e && Number.isInteger(e)) return A(e);
        if ("string" == typeof e) {
            if (D.test(e)) return A(Number(e));
            if (V(e)) return A(Number(BigInt(Z(e, !0))))
        }
        throw _(`Not an integer: ${String(e)}`)
    }

    function $(e) {
        if (null !== e && ("bigint" == typeof e || function(e) {
                if (null == e || "function" != typeof e.constructor) return !1;
                let {
                    constructor: t
                } = e;
                return "function" == typeof t.config && "number" == typeof t.EUCLID
            }(e))) return BigInt(e.toString(10));
        if ("number" == typeof e) return BigInt(F(e));
        if ("string" == typeof e) {
            if (D.test(e)) return BigInt(e);
            if (V(e)) return BigInt(Z(e, !0))
        }
        throw _(`Not an integer: ${String(e)}`)
    }
    async function G() {
        return crypto.subtle.generateKey({
            name: "ECDH",
            namedCurve: "P-256"
        }, !0, ["deriveKey"])
    }
    async function J(e, t) {
        return crypto.subtle.deriveKey({
            name: "ECDH",
            public: t
        }, e, {
            name: "AES-GCM",
            length: 256
        }, !1, ["encrypt", "decrypt"])
    }
    async function Y(e, t) {
        let n = crypto.getRandomValues(new Uint8Array(12)),
            s = await crypto.subtle.encrypt({
                name: "AES-GCM",
                iv: n
            }, e, new TextEncoder().encode(t));
        return {
            iv: n,
            cipherText: s
        }
    }
    async function Q(e, {
        iv: t,
        cipherText: n
    }) {
        let s = await crypto.subtle.decrypt({
            name: "AES-GCM",
            iv: t
        }, e, n);
        return new TextDecoder().decode(s)
    }

    function X(e) {
        switch (e) {
            case "public":
                return "spki";
            case "private":
                return "pkcs8"
        }
    }
    async function ee(e, t) {
        let n = X(e);
        return P(new Uint8Array(await crypto.subtle.exportKey(n, t)))
    }
    async function et(e, t) {
        let n = X(e),
            s = O(t).buffer;
        return await crypto.subtle.importKey(n, new Uint8Array(s), {
            name: "ECDH",
            namedCurve: "P-256"
        }, !0, "private" === e ? ["deriveKey"] : [])
    }
    async function en(e, t) {
        return Y(t, JSON.stringify(e, (e, t) => t instanceof Error ? Object.assign(Object.assign({}, t.code ? {
            code: t.code
        } : {}), {
            message: t.message
        }) : t))
    }
    async function es(e, t) {
        return JSON.parse(await Q(t, e))
    }
    let ei = {
            storageKey: "ownPrivateKey",
            keyType: "private"
        },
        er = {
            storageKey: "ownPublicKey",
            keyType: "public"
        },
        ea = {
            storageKey: "peerPublicKey",
            keyType: "public"
        };
    class eo {
        constructor() {
            this.storage = new i("CBWSDK", "SCWKeyManager"), this.ownPrivateKey = null, this.ownPublicKey = null, this.peerPublicKey = null, this.sharedSecret = null
        }
        async getOwnPublicKey() {
            return await this.loadKeysIfNeeded(), this.ownPublicKey
        }
        async getSharedSecret() {
            return await this.loadKeysIfNeeded(), this.sharedSecret
        }
        async setPeerPublicKey(e) {
            this.sharedSecret = null, this.peerPublicKey = e, await this.storeKey(ea, e), await this.loadKeysIfNeeded()
        }
        async clear() {
            this.ownPrivateKey = null, this.ownPublicKey = null, this.peerPublicKey = null, this.sharedSecret = null, this.storage.removeItem(er.storageKey), this.storage.removeItem(ei.storageKey), this.storage.removeItem(ea.storageKey)
        }
        async generateKeyPair() {
            let e = await G();
            this.ownPrivateKey = e.privateKey, this.ownPublicKey = e.publicKey, await this.storeKey(ei, e.privateKey), await this.storeKey(er, e.publicKey)
        }
        async loadKeysIfNeeded() {
            null === this.ownPrivateKey && (this.ownPrivateKey = await this.loadKey(ei)), null === this.ownPublicKey && (this.ownPublicKey = await this.loadKey(er)), (null === this.ownPrivateKey || null === this.ownPublicKey) && await this.generateKeyPair(), null === this.peerPublicKey && (this.peerPublicKey = await this.loadKey(ea)), null === this.sharedSecret && null !== this.ownPrivateKey && null !== this.peerPublicKey && (this.sharedSecret = await J(this.ownPrivateKey, this.peerPublicKey))
        }
        async loadKey(e) {
            let t = this.storage.getItem(e.storageKey);
            return t ? et(e.keyType, t) : null
        }
        async storeKey(e, t) {
            let n = await ee(e.keyType, t);
            this.storage.setItem(e.storageKey, n)
        }
    }
    var el = e.i(571333);
    let ec = "4.3.7",
        eh = "@coinbase/wallet-sdk";
    async function ed(e, t) {
        let n = Object.assign(Object.assign({}, e), {
                jsonrpc: "2.0",
                id: crypto.randomUUID()
            }),
            s = await window.fetch(t, {
                method: "POST",
                body: JSON.stringify(n),
                mode: "cors",
                headers: {
                    "Content-Type": "application/json",
                    "X-Cbw-Sdk-Version": ec,
                    "X-Cbw-Sdk-Platform": eh
                }
            }),
            {
                result: i,
                error: r
            } = await s.json();
        if (r) throw r;
        return i
    }

    function eu({
        metadata: e,
        preference: t
    }) {
        var n, s;
        let {
            appName: i,
            appLogoUrl: r,
            appChainIds: a
        } = e;
        if ("smartWalletOnly" !== t.options) {
            let e = globalThis.coinbaseWalletExtension;
            if (e) return null == (n = e.setAppInfo) || n.call(e, i, r, a, t), e
        }
        let o = function() {
            var e, t;
            try {
                let n = globalThis;
                return null != (t = null == (e = n.top) ? void 0 : e.ethereum) ? t : n.ethereum
            } catch (e) {
                return
            }
        }();
        if (null == o ? void 0 : o.isCoinbaseBrowser) return null == (s = o.setAppInfo) || s.call(o, i, r, a, t), o
    }
    let ep = "accounts",
        ef = "activeChain",
        eg = "availableChains",
        em = "walletCapabilities";
    class ey {
        constructor(e) {
            var t, n, s;
            this.metadata = e.metadata, this.communicator = e.communicator, this.callback = e.callback, this.keyManager = new eo, this.storage = new i("CBWSDK", "SCWStateManager"), this.accounts = null != (t = this.storage.loadObject(ep)) ? t : [], this.chain = this.storage.loadObject(ef) || {
                id: null != (s = null == (n = e.metadata.appChainIds) ? void 0 : n[0]) ? s : 1
            }, this.handshake = this.handshake.bind(this), this.request = this.request.bind(this), this.createRequestMessage = this.createRequestMessage.bind(this), this.decryptResponseMessage = this.decryptResponseMessage.bind(this)
        }
        async handshake(e) {
            var t, n, s, i;
            await (null == (n = (t = this.communicator).waitForPopupLoaded) ? void 0 : n.call(t));
            let r = await this.createRequestMessage({
                    handshake: {
                        method: e.method,
                        params: Object.assign({}, this.metadata, null != (s = e.params) ? s : {})
                    }
                }),
                a = await this.communicator.postRequestAndWaitForResponse(r);
            if ("failure" in a.content) throw a.content.failure;
            let o = await et("public", a.sender);
            await this.keyManager.setPeerPublicKey(o);
            let l = (await this.decryptResponseMessage(a)).result;
            if ("error" in l) throw l.error;
            if ("eth_requestAccounts" === e.method) {
                let e = l.value;
                this.accounts = e, this.storage.storeObject(ep, e), null == (i = this.callback) || i.call(this, "accountsChanged", e)
            }
        }
        async request(e) {
            var t;
            if (0 === this.accounts.length)
                if ("wallet_sendCalls" === e.method) return this.sendRequestToPopup(e);
                else throw v();
            switch (e.method) {
                case "eth_requestAccounts":
                    return null == (t = this.callback) || t.call(this, "connect", {
                        chainId: H(this.chain.id)
                    }), this.accounts;
                case "eth_accounts":
                    return this.accounts;
                case "eth_coinbase":
                    return this.accounts[0];
                case "net_version":
                    return this.chain.id;
                case "eth_chainId":
                    return H(this.chain.id);
                case "wallet_getCapabilities":
                    return this.handleGetCapabilitiesRequest(e);
                case "wallet_switchEthereumChain":
                    return this.handleSwitchChainRequest(e);
                case "eth_ecRecover":
                case "personal_sign":
                case "wallet_sign":
                case "personal_ecRecover":
                case "eth_signTransaction":
                case "eth_sendTransaction":
                case "eth_signTypedData_v1":
                case "eth_signTypedData_v3":
                case "eth_signTypedData_v4":
                case "eth_signTypedData":
                case "wallet_addEthereumChain":
                case "wallet_watchAsset":
                case "wallet_sendCalls":
                case "wallet_showCallsStatus":
                case "wallet_grantPermissions":
                    return this.sendRequestToPopup(e);
                default:
                    if (!this.chain.rpcUrl) throw b("No RPC URL set for chain");
                    return ed(e, this.chain.rpcUrl)
            }
        }
        async sendRequestToPopup(e) {
            var t, n;
            await (null == (n = (t = this.communicator).waitForPopupLoaded) ? void 0 : n.call(t));
            let s = await this.sendEncryptedRequest(e),
                i = (await this.decryptResponseMessage(s)).result;
            if ("error" in i) throw i.error;
            return i.value
        }
        async cleanup() {
            var e, t;
            this.storage.clear(), await this.keyManager.clear(), this.accounts = [], this.chain = {
                id: null != (t = null == (e = this.metadata.appChainIds) ? void 0 : e[0]) ? t : 1
            }
        }
        async handleSwitchChainRequest(e) {
            var t;
            let n = e.params;
            if (!n || !(null == (t = n[0]) ? void 0 : t.chainId)) throw _();
            let s = F(n[0].chainId);
            if (this.updateChain(s)) return null;
            let i = await this.sendRequestToPopup(e);
            return null === i && this.updateChain(s), i
        }
        async handleGetCapabilitiesRequest(e) {
            var t = e.params;
            if (!t || !Array.isArray(t) || 1 !== t.length && 2 !== t.length || "string" != typeof t[0] || !(0, el.isAddress)(t[0])) throw _();
            if (2 === t.length) {
                if (!Array.isArray(t[1])) throw _();
                for (let e of t[1])
                    if ("string" != typeof e || !e.startsWith("0x")) throw _()
            }
            let i = e.params[0],
                r = e.params[1];
            if (!this.accounts.some(e => (0, s.isAddressEqual)(e, i))) throw v("no active account found");
            let a = this.storage.loadObject(em);
            if (!a) return {};
            if (!r || 0 === r.length) return a;
            let o = new Set(r.map(e => (0, n.hexToNumber)(e)));
            return Object.fromEntries(Object.entries(a).filter(([e]) => {
                try {
                    let t = (0, n.hexToNumber)(e);
                    return o.has(t)
                } catch (e) {
                    return !1
                }
            }))
        }
        async sendEncryptedRequest(e) {
            let t = await this.keyManager.getSharedSecret();
            if (!t) throw v("No valid session found, try requestAccounts before other methods");
            let n = await en({
                    action: e,
                    chainId: this.chain.id
                }, t),
                s = await this.createRequestMessage({
                    encrypted: n
                });
            return this.communicator.postRequestAndWaitForResponse(s)
        }
        async createRequestMessage(e) {
            let t = await ee("public", await this.keyManager.getOwnPublicKey());
            return {
                id: crypto.randomUUID(),
                sender: t,
                content: e,
                timestamp: new Date
            }
        }
        async decryptResponseMessage(e) {
            var t, n;
            let s = e.content;
            if ("failure" in s) throw s.failure;
            let i = await this.keyManager.getSharedSecret();
            if (!i) throw v("Invalid session");
            let r = await es(s.encrypted, i),
                a = null == (t = r.data) ? void 0 : t.chains;
            if (a) {
                let e = Object.entries(a).map(([e, t]) => ({
                    id: Number(e),
                    rpcUrl: t
                }));
                this.storage.storeObject(eg, e), this.updateChain(this.chain.id, e)
            }
            let o = null == (n = r.data) ? void 0 : n.capabilities;
            return o && this.storage.storeObject(em, o), r
        }
        updateChain(e, t) {
            var n;
            let s = null != t ? t : this.storage.loadObject(eg),
                i = null == s ? void 0 : s.find(t => t.id === e);
            return !!i && (i !== this.chain && (this.chain = i, this.storage.storeObject(ef, i), null == (n = this.callback) || n.call(this, "chainChanged", H(i.id))), !0)
        }
    }
    var e_ = e.i(86986);
    let eb = "Addresses";

    function ew(e) {
        return void 0 !== e.errorMessage
    }
    class ev {
        constructor(e) {
            this.secret = e
        }
        async encrypt(e) {
            let t = this.secret;
            if (64 !== t.length) throw Error("secret must be 256 bits");
            let n = crypto.getRandomValues(new Uint8Array(12)),
                s = await crypto.subtle.importKey("raw", O(t), {
                    name: "aes-gcm"
                }, !1, ["encrypt", "decrypt"]),
                i = new TextEncoder,
                r = await window.crypto.subtle.encrypt({
                    name: "AES-GCM",
                    iv: n
                }, s, i.encode(e)),
                a = r.slice(r.byteLength - 16),
                o = r.slice(0, r.byteLength - 16),
                l = new Uint8Array(a),
                c = new Uint8Array(o);
            return P(new Uint8Array([...n, ...l, ...c]))
        }
        async decrypt(e) {
            let t = this.secret;
            if (64 !== t.length) throw Error("secret must be 256 bits");
            return new Promise((n, s) => {
                !async function() {
                    let i = await crypto.subtle.importKey("raw", O(t), {
                            name: "aes-gcm"
                        }, !1, ["encrypt", "decrypt"]),
                        r = O(e),
                        a = r.slice(0, 12),
                        o = r.slice(12, 28),
                        l = new Uint8Array([...r.slice(28), ...o]),
                        c = {
                            name: "AES-GCM",
                            iv: new Uint8Array(a)
                        };
                    try {
                        let e = await window.crypto.subtle.decrypt(c, i, l),
                            t = new TextDecoder;
                        n(t.decode(e))
                    } catch (e) {
                        s(e)
                    }
                }()
            })
        }
    }
    class ek {
        constructor(e, t, n) {
            this.linkAPIUrl = e, this.sessionId = t;
            const s = `${t}:${n}`;
            this.auth = `Basic ${btoa(s)}`
        }
        async markUnseenEventsAsSeen(e) {
            return Promise.all(e.map(e => fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`, {
                method: "POST",
                headers: {
                    Authorization: this.auth
                }
            }))).catch(e => console.error("Unabled to mark event as failed:", e))
        }
        async fetchUnseenEvents() {
            var e;
            let t = await fetch(`${this.linkAPIUrl}/events?unseen=true`, {
                headers: {
                    Authorization: this.auth
                }
            });
            if (t.ok) {
                let {
                    events: n,
                    error: s
                } = await t.json();
                if (s) throw Error(`Check unseen events failed: ${s}`);
                let i = null != (e = null == n ? void 0 : n.filter(e => "Web3Response" === e.event).map(e => ({
                    type: "Event",
                    sessionId: this.sessionId,
                    eventId: e.id,
                    event: e.event,
                    data: e.data
                }))) ? e : [];
                return this.markUnseenEventsAsSeen(i), i
            }
            throw Error(`Check unseen events failed: ${t.status}`)
        }
    }(eO = eR || (eR = {}))[eO.DISCONNECTED = 0] = "DISCONNECTED", eO[eO.CONNECTING = 1] = "CONNECTING", eO[eO.CONNECTED = 2] = "CONNECTED";
    class eI {
        setConnectionStateListener(e) {
            this.connectionStateListener = e
        }
        setIncomingDataListener(e) {
            this.incomingDataListener = e
        }
        constructor(e, t = WebSocket) {
            this.WebSocketClass = t, this.webSocket = null, this.isDisconnecting = !1, this.url = e.replace(/^http/, "ws"), this.instanceId = eI.instanceCounter++, eI.activeInstances.add(this.instanceId)
        }
        async connect() {
            if (this.webSocket) throw Error("webSocket object is not null");
            if (this.isDisconnecting) throw Error("WebSocket is disconnecting, cannot reconnect on same instance");
            return new Promise((e, t) => {
                var n;
                let s;
                try {
                    this.webSocket = s = new this.WebSocketClass(this.url)
                } catch (e) {
                    t(e);
                    return
                }
                null == (n = this.connectionStateListener) || n.call(this, eR.CONNECTING), s.onclose = e => {
                    var n;
                    this.clearWebSocket(), s.readyState !== WebSocket.OPEN && t(Error(`websocket error ${e.code}: ${e.reason}`)), null == (n = this.connectionStateListener) || n.call(this, eR.DISCONNECTED)
                }, s.onopen = t => {
                    var n;
                    e(), null == (n = this.connectionStateListener) || n.call(this, eR.CONNECTED), eI.pendingData.length > 0 && ([...eI.pendingData].forEach(e => this.sendData(e)), eI.pendingData = [])
                }, s.onmessage = e => {
                    var t, n;
                    if ("h" === e.data) null == (t = this.incomingDataListener) || t.call(this, {
                        type: "Heartbeat"
                    });
                    else try {
                        let t = JSON.parse(e.data);
                        null == (n = this.incomingDataListener) || n.call(this, t)
                    } catch (e) {}
                }
            })
        }
        disconnect() {
            var e;
            let {
                webSocket: t
            } = this;
            if (t) {
                this.isDisconnecting = !0, this.clearWebSocket(), null == (e = this.connectionStateListener) || e.call(this, eR.DISCONNECTED), this.connectionStateListener = void 0, this.incomingDataListener = void 0;
                try {
                    t.close()
                } catch (e) {}
            }
        }
        sendData(e) {
            let {
                webSocket: t
            } = this;
            if (!t) {
                eI.pendingData.push(e), this.isDisconnecting || this.connect();
                return
            }
            t.readyState !== WebSocket.OPEN ? eI.pendingData.push(e) : t.send(e)
        }
        clearWebSocket() {
            let {
                webSocket: e
            } = this;
            e && (this.webSocket = null, e.onclose = null, e.onerror = null, e.onmessage = null, e.onopen = null)
        }
        cleanup() {
            eI.activeInstances.delete(this.instanceId)
        }
    }
    eI.instanceCounter = 0, eI.activeInstances = new Set, eI.pendingData = [];
    class eC {
        constructor({
            session: e,
            linkAPIUrl: t,
            listener: n
        }) {
            this.destroyed = !1, this.lastHeartbeatResponse = 0, this.nextReqId = A(1), this.reconnectAttempts = 0, this.isReconnecting = !1, this._connected = !1, this._linked = !1, this.requestResolutions = new Map, this.handleSessionMetadataUpdated = e => {
                e && new Map([
                    ["__destroyed", this.handleDestroyed],
                    ["EthereumAddress", this.handleAccountUpdated],
                    ["WalletUsername", this.handleWalletUsernameUpdated],
                    ["AppVersion", this.handleAppVersionUpdated],
                    ["ChainId", t => e.JsonRpcUrl && this.handleChainUpdated(t, e.JsonRpcUrl)]
                ]).forEach((t, n) => {
                    let s = e[n];
                    void 0 !== s && t(s)
                })
            }, this.handleDestroyed = e => {
                var t;
                "1" === e && (null == (t = this.listener) || t.resetAndReload())
            }, this.handleAccountUpdated = async e => {
                var t;
                try {
                    let n = await this.cipher.decrypt(e);
                    null == (t = this.listener) || t.accountUpdated(n)
                } catch (e) {}
            }, this.handleMetadataUpdated = async (e, t) => {
                var n;
                try {
                    let s = await this.cipher.decrypt(t);
                    null == (n = this.listener) || n.metadataUpdated(e, s)
                } catch (e) {}
            }, this.handleWalletUsernameUpdated = async e => {
                this.handleMetadataUpdated("walletUsername", e)
            }, this.handleAppVersionUpdated = async e => {
                this.handleMetadataUpdated("AppVersion", e)
            }, this.handleChainUpdated = async (e, t) => {
                var n;
                try {
                    let s = await this.cipher.decrypt(e),
                        i = await this.cipher.decrypt(t);
                    null == (n = this.listener) || n.chainUpdated(s, i)
                } catch (e) {}
            }, this.session = e, this.cipher = new ev(e.secret), this.listener = n, this.linkAPIUrl = t, this.WebSocketClass = WebSocket;
            const s = this.createWebSocket();
            this.ws = s, this.http = new ek(t, e.id, e.key), this.setupVisibilityChangeHandler()
        }
        createWebSocket() {
            let e = new eI(`${this.linkAPIUrl}/rpc`, this.WebSocketClass);
            return this.activeWsInstance = e, e.setConnectionStateListener(async t => {
                if (e !== this.activeWsInstance) return;
                let n = !1;
                switch (t) {
                    case eR.DISCONNECTED:
                        this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = void 0), this.lastHeartbeatResponse = 0, n = !1, this.destroyed || (async () => {
                            if (this.isReconnecting) return;
                            this.isReconnecting = !0;
                            let t = 3e3 * (0 !== this.reconnectAttempts);
                            await new Promise(e => setTimeout(e, t)), this.destroyed || e !== this.activeWsInstance ? this.isReconnecting = !1 : (this.reconnectAttempts++, "cleanup" in this.ws && "function" == typeof this.ws.cleanup && this.ws.cleanup(), this.ws = this.createWebSocket(), this.ws.connect().catch(() => {}).finally(() => {
                                this.isReconnecting = !1
                            }))
                        })();
                        break;
                    case eR.CONNECTED:
                        this.reconnectAttempts = 0;
                        try {
                            n = await this.handleConnected(), this.fetchUnseenEventsAPI().catch(() => {})
                        } catch (e) {
                            break
                        }
                        this.connected = n, this.updateLastHeartbeat(), this.heartbeatIntervalId && clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = window.setInterval(() => {
                            this.heartbeat()
                        }, 1e4), setTimeout(() => {
                            this.heartbeat()
                        }, 100);
                    case eR.CONNECTING:
                }
                t !== eR.CONNECTED && (this.connected = n)
            }), e.setIncomingDataListener(e => {
                var t;
                switch (e.type) {
                    case "Heartbeat":
                        this.updateLastHeartbeat();
                        return;
                    case "IsLinkedOK":
                    case "Linked":
                        {
                            let t = "IsLinkedOK" === e.type ? e.linked : void 0;this.linked = t || e.onlineGuests > 0;
                            break
                        }
                    case "GetSessionConfigOK":
                    case "SessionConfigUpdated":
                        this.handleSessionMetadataUpdated(e.metadata);
                        break;
                    case "Event":
                        this.handleIncomingEvent(e)
                }
                void 0 !== e.id && (null == (t = this.requestResolutions.get(e.id)) || t(e))
            }), e
        }
        setupVisibilityChangeHandler() {
            this.visibilityChangeHandler = () => {
                document.hidden || this.destroyed || (this.connected ? this.heartbeat() : this.reconnectWithFreshWebSocket())
            }, this.focusHandler = () => {
                this.destroyed || this.connected || this.reconnectWithFreshWebSocket()
            }, document.addEventListener("visibilitychange", this.visibilityChangeHandler), window.addEventListener("focus", this.focusHandler), window.addEventListener("pageshow", e => {
                e.persisted && this.focusHandler && this.focusHandler()
            })
        }
        reconnectWithFreshWebSocket() {
            if (this.destroyed) return;
            let e = this.ws;
            this.activeWsInstance = void 0, e.disconnect(), "cleanup" in e && "function" == typeof e.cleanup && e.cleanup(), this.ws = this.createWebSocket(), this.ws.connect().catch(() => {})
        }
        connect() {
            if (this.destroyed) throw Error("instance is destroyed");
            this.ws.connect()
        }
        async destroy() {
            this.destroyed || (await this.makeRequest({
                type: "SetSessionConfig",
                id: A(this.nextReqId++),
                sessionId: this.session.id,
                metadata: {
                    __destroyed: "1"
                }
            }, {
                timeout: 1e3
            }), this.destroyed = !0, this.activeWsInstance = void 0, this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = void 0), this.visibilityChangeHandler && document.removeEventListener("visibilitychange", this.visibilityChangeHandler), this.focusHandler && window.removeEventListener("focus", this.focusHandler), this.ws.disconnect(), "cleanup" in this.ws && "function" == typeof this.ws.cleanup && this.ws.cleanup(), this.listener = void 0)
        }
        get connected() {
            return this._connected
        }
        set connected(e) {
            this._connected = e
        }
        get linked() {
            return this._linked
        }
        set linked(e) {
            var t, n;
            this._linked = e, e && (null == (t = this.onceLinked) || t.call(this)), null == (n = this.listener) || n.linkedUpdated(e)
        }
        setOnceLinked(e) {
            return new Promise(t => {
                this.linked ? e().then(t) : this.onceLinked = () => {
                    e().then(t), this.onceLinked = void 0
                }
            })
        }
        async handleIncomingEvent(e) {
            var t;
            if ("Event" === e.type && "Web3Response" === e.event) try {
                let n = await this.cipher.decrypt(e.data),
                    s = JSON.parse(n);
                if ("WEB3_RESPONSE" !== s.type) return;
                null == (t = this.listener) || t.handleWeb3ResponseMessage(s.id, s.response)
            } catch (e) {}
        }
        async checkUnseenEvents() {
            await new Promise(e => setTimeout(e, 250));
            try {
                await this.fetchUnseenEventsAPI()
            } catch (e) {
                console.error("Unable to check for unseen events", e)
            }
        }
        async fetchUnseenEventsAPI() {
            try {
                (await this.http.fetchUnseenEvents()).forEach(e => {
                    this.handleIncomingEvent(e)
                })
            } catch (e) {}
        }
        async publishEvent(e, t, n = !1) {
            let s = await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({}, t), {
                    origin: location.origin,
                    location: location.href,
                    relaySource: "coinbaseWalletExtension" in window && window.coinbaseWalletExtension ? "injected_sdk" : "sdk"
                }))),
                i = {
                    type: "PublishEvent",
                    id: A(this.nextReqId++),
                    sessionId: this.session.id,
                    event: e,
                    data: s,
                    callWebhook: n
                };
            return this.setOnceLinked(async () => {
                let e = await this.makeRequest(i);
                if ("Fail" === e.type) throw Error(e.error || "failed to publish event");
                return e.eventId
            })
        }
        sendData(e) {
            this.ws.sendData(JSON.stringify(e))
        }
        updateLastHeartbeat() {
            this.lastHeartbeatResponse = Date.now()
        }
        heartbeat() {
            if (Date.now() - this.lastHeartbeatResponse > 2e4) return void this.ws.disconnect();
            if (this.connected) try {
                this.ws.sendData("h")
            } catch (e) {}
        }
        async makeRequest(e, t = {
            timeout: 6e4
        }) {
            let n, s = e.id;
            return this.sendData(e), Promise.race([new Promise((e, i) => {
                n = window.setTimeout(() => {
                    i(Error(`request ${s} timed out`))
                }, t.timeout)
            }), new Promise(e => {
                this.requestResolutions.set(s, t => {
                    clearTimeout(n), e(t), this.requestResolutions.delete(s)
                })
            })])
        }
        async handleConnected() {
            return "Fail" !== (await this.makeRequest({
                type: "HostSession",
                id: A(this.nextReqId++),
                sessionId: this.session.id,
                sessionKey: this.session.key
            })).type && (this.sendData({
                type: "IsLinked",
                id: A(this.nextReqId++),
                sessionId: this.session.id
            }), this.sendData({
                type: "GetSessionConfig",
                id: A(this.nextReqId++),
                sessionId: this.session.id
            }), !0)
        }
    }
    class eE {
        constructor() {
            this._nextRequestId = 0, this.callbacks = new Map
        }
        makeRequestId() {
            this._nextRequestId = (this._nextRequestId + 1) % 0x7fffffff;
            let e = this._nextRequestId,
                t = q(e.toString(16));
            return this.callbacks.get(t) && this.callbacks.delete(t), e
        }
    }
    var ex = e.i(281851),
        eS = e.i(354955);
    let eM = "session:id",
        eL = "session:secret",
        eA = "session:linked";
    class eD {
        constructor(e, t, n, s = !1) {
            this.storage = e, this.id = t, this.secret = n, this.key = (0, eS.bytesToHex)((0, ex.sha256)(`${t}, ${n} WalletLink`)), this._linked = !!s
        }
        static create(e) {
            return new eD(e, N(16), N(32)).save()
        }
        static load(e) {
            let t = e.getItem(eM),
                n = e.getItem(eA),
                s = e.getItem(eL);
            return t && s ? new eD(e, t, s, "1" === n) : null
        }
        get linked() {
            return this._linked
        }
        set linked(e) {
            this._linked = e, this.persistLinked()
        }
        save() {
            return this.storage.setItem(eM, this.id), this.storage.setItem(eL, this.secret), this.persistLinked(), this
        }
        persistLinked() {
            this.storage.setItem(eA, this._linked ? "1" : "0")
        }
    }

    function eT() {
        var e, t;
        return null != (t = null == (e = null == window ? void 0 : window.matchMedia) ? void 0 : e.call(window, "(prefers-color-scheme: dark)").matches) && t
    }

    function eN() {
        let e = document.createElement("style");
        e.type = "text/css", e.appendChild(document.createTextNode('@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')), document.documentElement.appendChild(e)
    }

    function eP() {
        for (var e, t, n = 0, s = ""; n < arguments.length;)(e = arguments[n++]) && (t = function e(t) {
            var n, s, i = "";
            if ("string" == typeof t || "number" == typeof t) i += t;
            else if ("object" == typeof t)
                if (Array.isArray(t))
                    for (n = 0; n < t.length; n++) t[n] && (s = e(t[n])) && (i && (i += " "), i += s);
                else
                    for (n in t) t[n] && (i && (i += " "), i += n);
            return i
        }(e)) && (s && (s += " "), s += t);
        return s
    }
    var eO, eR, ej, eU, eH, eW, eB, eq, eV, eZ, eK, ez, eF = {},
        e$ = [],
        eG = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,
        eJ = Array.isArray;

    function eY(e, t) {
        for (var n in t) e[n] = t[n];
        return e
    }

    function eQ(e) {
        e && e.parentNode && e.parentNode.removeChild(e)
    }

    function eX(e, t, n) {
        var s, i, r, a = {};
        for (r in t) "key" == r ? s = t[r] : "ref" == r ? i = t[r] : a[r] = t[r];
        if (arguments.length > 2 && (a.children = arguments.length > 3 ? ej.call(arguments, 2) : n), "function" == typeof e && null != e.defaultProps)
            for (r in e.defaultProps) void 0 === a[r] && (a[r] = e.defaultProps[r]);
        return e0(e, a, s, i, null)
    }

    function e0(e, t, n, s, i) {
        var r = {
            type: e,
            props: t,
            key: n,
            ref: s,
            __k: null,
            __: null,
            __b: 0,
            __e: null,
            __d: void 0,
            __c: null,
            constructor: void 0,
            __v: null == i ? ++eH : i,
            __i: -1,
            __u: 0
        };
        return null == i && null != eU.vnode && eU.vnode(r), r
    }

    function e1(e) {
        return e.children
    }

    function e2(e, t) {
        this.props = e, this.context = t
    }

    function e3(e, t) {
        if (null == t) return e.__ ? e3(e.__, e.__i + 1) : null;
        for (var n; t < e.__k.length; t++)
            if (null != (n = e.__k[t]) && null != n.__e) return n.__e;
        return "function" == typeof e.type ? e3(e) : null
    }

    function e5(e) {
        (!e.__d && (e.__d = !0) && eW.push(e) && !e4.__r++ || eB !== eU.debounceRendering) && ((eB = eU.debounceRendering) || eq)(e4)
    }

    function e4() {
        var e, t, n, s, i, r, a, o;
        for (eW.sort(eV); e = eW.shift();) e.__d && (t = eW.length, s = void 0, r = (i = (n = e).__v).__e, a = [], o = [], n.__P && ((s = eY({}, i)).__v = i.__v + 1, eU.vnode && eU.vnode(s), te(n.__P, s, i, n.__n, n.__P.namespaceURI, 32 & i.__u ? [r] : null, a, null == r ? e3(i) : r, !!(32 & i.__u), o), s.__v = i.__v, s.__.__k[s.__i] = s, tt(a, s, o), s.__e != r && function e(t) {
            var n, s;
            if (null != (t = t.__) && null != t.__c) {
                for (t.__e = t.__c.base = null, n = 0; n < t.__k.length; n++)
                    if (null != (s = t.__k[n]) && null != s.__e) {
                        t.__e = t.__c.base = s.__e;
                        break
                    }
                return e(t)
            }
        }(s)), eW.length > t && eW.sort(eV));
        e4.__r = 0
    }

    function e8(e, t, n, s, i, r, a, o, l, c, h) {
        var d, u, p, f, g, m = s && s.__k || e$,
            y = t.length;
        for (n.__d = l, function(e, t, n) {
                var s, i, r, a, o, l = t.length,
                    c = n.length,
                    h = c,
                    d = 0;
                for (e.__k = [], s = 0; s < l; s++) null != (i = t[s]) && "boolean" != typeof i && "function" != typeof i ? (a = s + d, (i = e.__k[s] = "string" == typeof i || "number" == typeof i || "bigint" == typeof i || i.constructor == String ? e0(null, i, null, null, null) : eJ(i) ? e0(e1, {
                    children: i
                }, null, null, null) : void 0 === i.constructor && i.__b > 0 ? e0(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i).__ = e, i.__b = e.__b + 1, r = null, -1 !== (o = i.__i = function(e, t, n, s) {
                    var i = e.key,
                        r = e.type,
                        a = n - 1,
                        o = n + 1,
                        l = t[n];
                    if (null === l || l && i == l.key && r === l.type && 0 == (131072 & l.__u)) return n;
                    if (s > +(null != l && 0 == (131072 & l.__u)))
                        for (; a >= 0 || o < t.length;) {
                            if (a >= 0) {
                                if ((l = t[a]) && 0 == (131072 & l.__u) && i == l.key && r === l.type) return a;
                                a--
                            }
                            if (o < t.length) {
                                if ((l = t[o]) && 0 == (131072 & l.__u) && i == l.key && r === l.type) return o;
                                o++
                            }
                        }
                    return -1
                }(i, n, a, h)) && (h--, (r = n[o]) && (r.__u |= 131072)), null == r || null === r.__v ? (-1 == o && d--, "function" != typeof i.type && (i.__u |= 65536)) : o !== a && (o == a - 1 ? d-- : o == a + 1 ? d++ : (o > a ? d-- : d++, i.__u |= 65536))) : i = e.__k[s] = null;
                if (h)
                    for (s = 0; s < c; s++) null != (r = n[s]) && 0 == (131072 & r.__u) && (r.__e == e.__d && (e.__d = e3(r)), function e(t, n, s) {
                        var i, r;
                        if (eU.unmount && eU.unmount(t), (i = t.ref) && (i.current && i.current !== t.__e || tn(i, null, n)), null != (i = t.__c)) {
                            if (i.componentWillUnmount) try {
                                i.componentWillUnmount()
                            } catch (e) {
                                eU.__e(e, n)
                            }
                            i.base = i.__P = null
                        }
                        if (i = t.__k)
                            for (r = 0; r < i.length; r++) i[r] && e(i[r], n, s || "function" != typeof t.type);
                        s || eQ(t.__e), t.__c = t.__ = t.__e = t.__d = void 0
                    }(r, r))
            }(n, t, m), l = n.__d, d = 0; d < y; d++) null != (p = n.__k[d]) && (u = -1 === p.__i ? eF : m[p.__i] || eF, p.__i = d, te(e, p, u, i, r, a, o, l, c, h), f = p.__e, p.ref && u.ref != p.ref && (u.ref && tn(u.ref, null, p), h.push(p.ref, p.__c || f, p)), null == g && null != f && (g = f), 65536 & p.__u || u.__k === p.__k ? l = function e(t, n, s) {
            var i, r;
            if ("function" == typeof t.type) {
                for (i = t.__k, r = 0; i && r < i.length; r++) i[r] && (i[r].__ = t, n = e(i[r], n, s));
                return n
            }
            t.__e != n && (n && t.type && !s.contains(n) && (n = e3(t)), s.insertBefore(t.__e, n || null), n = t.__e);
            do n = n && n.nextSibling; while (null != n && 8 === n.nodeType) return n
        }(p, l, e) : "function" == typeof p.type && void 0 !== p.__d ? l = p.__d : f && (l = f.nextSibling), p.__d = void 0, p.__u &= -196609);
        n.__d = l, n.__e = g
    }

    function e6(e, t, n) {
        "-" === t[0] ? e.setProperty(t, null == n ? "" : n) : e[t] = null == n ? "" : "number" != typeof n || eG.test(t) ? n : n + "px"
    }

    function e7(e, t, n, s, i) {
        var r;
        e: if ("style" === t)
            if ("string" == typeof n) e.style.cssText = n;
            else {
                if ("string" == typeof s && (e.style.cssText = s = ""), s)
                    for (t in s) n && t in n || e6(e.style, t, "");
                if (n)
                    for (t in n) s && n[t] === s[t] || e6(e.style, t, n[t])
            }
        else if ("o" === t[0] && "n" === t[1]) r = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in e || "onFocusOut" === t || "onFocusIn" === t ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = n, n ? s ? n.u = s.u : (n.u = eZ, e.addEventListener(t, r ? ez : eK, r)) : e.removeEventListener(t, r ? ez : eK, r);
        else {
            if ("http://www.w3.org/2000/svg" == i) t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
            else if ("width" != t && "height" != t && "href" != t && "list" != t && "form" != t && "tabIndex" != t && "download" != t && "rowSpan" != t && "colSpan" != t && "role" != t && "popover" != t && t in e) try {
                e[t] = null == n ? "" : n;
                break e
            } catch (e) {}
            "function" == typeof n || (null == n || !1 === n && "-" !== t[4] ? e.removeAttribute(t) : e.setAttribute(t, "popover" == t && 1 == n ? "" : n))
        }
    }

    function e9(e) {
        return function(t) {
            if (this.l) {
                var n = this.l[t.type + e];
                if (null == t.t) t.t = eZ++;
                else if (t.t < n.u) return;
                return n(eU.event ? eU.event(t) : t)
            }
        }
    }

    function te(e, t, n, s, i, r, a, o, l, c) {
        var h, d, u, p, f, g, m, y, _, b, w, v, k, I, C, E, x = t.type;
        if (void 0 !== t.constructor) return null;
        128 & n.__u && (l = !!(32 & n.__u), r = [o = t.__e = n.__e]), (h = eU.__b) && h(t);
        e: if ("function" == typeof x) try {
            if (y = t.props, _ = "prototype" in x && x.prototype.render, b = (h = x.contextType) && s[h.__c], w = h ? b ? b.props.value : h.__ : s, n.__c ? m = (d = t.__c = n.__c).__ = d.__E : (_ ? t.__c = d = new x(y, w) : (t.__c = d = new e2(y, w), d.constructor = x, d.render = ts), b && b.sub(d), d.props = y, d.state || (d.state = {}), d.context = w, d.__n = s, u = d.__d = !0, d.__h = [], d._sb = []), _ && null == d.__s && (d.__s = d.state), _ && null != x.getDerivedStateFromProps && (d.__s == d.state && (d.__s = eY({}, d.__s)), eY(d.__s, x.getDerivedStateFromProps(y, d.__s))), p = d.props, f = d.state, d.__v = t, u) _ && null == x.getDerivedStateFromProps && null != d.componentWillMount && d.componentWillMount(), _ && null != d.componentDidMount && d.__h.push(d.componentDidMount);
            else {
                if (_ && null == x.getDerivedStateFromProps && y !== p && null != d.componentWillReceiveProps && d.componentWillReceiveProps(y, w), !d.__e && (null != d.shouldComponentUpdate && !1 === d.shouldComponentUpdate(y, d.__s, w) || t.__v === n.__v)) {
                    for (t.__v !== n.__v && (d.props = y, d.state = d.__s, d.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
                            e && (e.__ = t)
                        }), v = 0; v < d._sb.length; v++) d.__h.push(d._sb[v]);
                    d._sb = [], d.__h.length && a.push(d);
                    break e
                }
                null != d.componentWillUpdate && d.componentWillUpdate(y, d.__s, w), _ && null != d.componentDidUpdate && d.__h.push(function() {
                    d.componentDidUpdate(p, f, g)
                })
            }
            if (d.context = w, d.props = y, d.__P = e, d.__e = !1, k = eU.__r, I = 0, _) {
                for (d.state = d.__s, d.__d = !1, k && k(t), h = d.render(d.props, d.state, d.context), C = 0; C < d._sb.length; C++) d.__h.push(d._sb[C]);
                d._sb = []
            } else
                do d.__d = !1, k && k(t), h = d.render(d.props, d.state, d.context), d.state = d.__s; while (d.__d && ++I < 25) d.state = d.__s, null != d.getChildContext && (s = eY(eY({}, s), d.getChildContext())), _ && !u && null != d.getSnapshotBeforeUpdate && (g = d.getSnapshotBeforeUpdate(p, f)), e8(e, eJ(E = null != h && h.type === e1 && null == h.key ? h.props.children : h) ? E : [E], t, n, s, i, r, a, o, l, c), d.base = t.__e, t.__u &= -161, d.__h.length && a.push(d), m && (d.__E = d.__ = null)
        } catch (e) {
            if (t.__v = null, l || null != r) {
                for (t.__u |= l ? 160 : 32; o && 8 === o.nodeType && o.nextSibling;) o = o.nextSibling;
                r[r.indexOf(o)] = null, t.__e = o
            } else t.__e = n.__e, t.__k = n.__k;
            eU.__e(e, t, n)
        } else null == r && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = function(e, t, n, s, i, r, a, o, l) {
            var c, h, d, u, p, f, g, m = n.props,
                y = t.props,
                _ = t.type;
            if ("svg" === _ ? i = "http://www.w3.org/2000/svg" : "math" === _ ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), null != r) {
                for (c = 0; c < r.length; c++)
                    if ((p = r[c]) && "setAttribute" in p == !!_ && (_ ? p.localName === _ : 3 === p.nodeType)) {
                        e = p, r[c] = null;
                        break
                    }
            }
            if (null == e) {
                if (null === _) return document.createTextNode(y);
                e = document.createElementNS(i, _, y.is && y), o && (eU.__m && eU.__m(t, r), o = !1), r = null
            }
            if (null === _) m === y || o && e.data === y || (e.data = y);
            else {
                if (r = r && ej.call(e.childNodes), m = n.props || eF, !o && null != r)
                    for (m = {}, c = 0; c < e.attributes.length; c++) m[(p = e.attributes[c]).name] = p.value;
                for (c in m)
                    if (p = m[c], "children" == c);
                    else if ("dangerouslySetInnerHTML" == c) d = p;
                else if (!(c in y)) {
                    if ("value" == c && "defaultValue" in y || "checked" == c && "defaultChecked" in y) continue;
                    e7(e, c, null, p, i)
                }
                for (c in y) p = y[c], "children" == c ? u = p : "dangerouslySetInnerHTML" == c ? h = p : "value" == c ? f = p : "checked" == c ? g = p : o && "function" != typeof p || m[c] === p || e7(e, c, p, m[c], i);
                if (h) o || d && (h.__html === d.__html || h.__html === e.innerHTML) || (e.innerHTML = h.__html), t.__k = [];
                else if (d && (e.innerHTML = ""), e8(e, eJ(u) ? u : [u], t, n, s, "foreignObject" === _ ? "http://www.w3.org/1999/xhtml" : i, r, a, r ? r[0] : n.__k && e3(n, 0), o, l), null != r)
                    for (c = r.length; c--;) eQ(r[c]);
                o || (c = "value", "progress" === _ && null == f ? e.removeAttribute("value") : void 0 === f || f === e[c] && ("progress" !== _ || f) && ("option" !== _ || f === m[c]) || e7(e, c, f, m[c], i), c = "checked", void 0 !== g && g !== e[c] && e7(e, c, g, m[c], i))
            }
            return e
        }(n.__e, t, n, s, i, r, a, l, c);
        (h = eU.diffed) && h(t)
    }

    function tt(e, t, n) {
        t.__d = void 0;
        for (var s = 0; s < n.length; s++) tn(n[s], n[++s], n[++s]);
        eU.__c && eU.__c(t, e), e.some(function(t) {
            try {
                e = t.__h, t.__h = [], e.some(function(e) {
                    e.call(t)
                })
            } catch (e) {
                eU.__e(e, t.__v)
            }
        })
    }

    function tn(e, t, n) {
        try {
            if ("function" == typeof e) {
                var s = "function" == typeof e.__u;
                s && e.__u(), s && null == t || (e.__u = e(t))
            } else e.current = t
        } catch (e) {
            eU.__e(e, n)
        }
    }

    function ts(e, t, n) {
        return this.constructor(e, n)
    }

    function ti(e, t, n) {
        var s, i, r, a;
        eU.__ && eU.__(e, t), i = (s = "function" == typeof n) ? null : n && n.__k || t.__k, r = [], a = [], te(t, e = (!s && n || t).__k = eX(e1, null, [e]), i || eF, eF, t.namespaceURI, !s && n ? [n] : i ? null : t.firstChild ? ej.call(t.childNodes) : null, r, !s && n ? n : i ? i.__e : t.firstChild, s, a), tt(r, e, a)
    }
    ej = e$.slice, eU = {
        __e: function(e, t, n, s) {
            for (var i, r, a; t = t.__;)
                if ((i = t.__c) && !i.__) try {
                    if ((r = i.constructor) && null != r.getDerivedStateFromError && (i.setState(r.getDerivedStateFromError(e)), a = i.__d), null != i.componentDidCatch && (i.componentDidCatch(e, s || {}), a = i.__d), a) return i.__E = i
                } catch (t) {
                    e = t
                }
            throw e
        }
    }, eH = 0, e2.prototype.setState = function(e, t) {
        var n;
        n = null != this.__s && this.__s !== this.state ? this.__s : this.__s = eY({}, this.state), "function" == typeof e && (e = e(eY({}, n), this.props)), e && eY(n, e), null != e && this.__v && (t && this._sb.push(t), e5(this))
    }, e2.prototype.forceUpdate = function(e) {
        this.__v && (this.__e = !0, e && this.__h.push(e), e5(this))
    }, e2.prototype.render = e1, eW = [], eq = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, eV = function(e, t) {
        return e.__v.__b - t.__v.__b
    }, e4.__r = 0, eZ = 0, eK = e9(!1), ez = e9(!0);
    var tr, ta, to, tl, tc = 0,
        th = [],
        td = eU,
        tu = td.__b,
        tp = td.__r,
        tf = td.diffed,
        tg = td.__c,
        tm = td.unmount,
        ty = td.__;

    function t_(e, t) {
        td.__h && td.__h(ta, e, tc || t), tc = 0;
        var n = ta.__H || (ta.__H = {
            __: [],
            __h: []
        });
        return e >= n.__.length && n.__.push({}), n.__[e]
    }

    function tb(e, t, n) {
        var s = t_(tr++, 2);
        if (s.t = e, !s.__c && (s.__ = [n ? n(t) : tC(void 0, t), function(e) {
                var t = s.__N ? s.__N[0] : s.__[0],
                    n = s.t(t, e);
                t !== n && (s.__N = [n, s.__[1]], s.__c.setState({}))
            }], s.__c = ta, !ta.u)) {
            var i = function(e, t, n) {
                if (!s.__c.__H) return !0;
                var i = s.__c.__H.__.filter(function(e) {
                    return !!e.__c
                });
                if (i.every(function(e) {
                        return !e.__N
                    })) return !r || r.call(this, e, t, n);
                var a = !1;
                return i.forEach(function(e) {
                    if (e.__N) {
                        var t = e.__[0];
                        e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (a = !0)
                    }
                }), !(!a && s.__c.props === e) && (!r || r.call(this, e, t, n))
            };
            ta.u = !0;
            var r = ta.shouldComponentUpdate,
                a = ta.componentWillUpdate;
            ta.componentWillUpdate = function(e, t, n) {
                if (this.__e) {
                    var s = r;
                    r = void 0, i(e, t, n), r = s
                }
                a && a.call(this, e, t, n)
            }, ta.shouldComponentUpdate = i
        }
        return s.__N || s.__
    }

    function tw() {
        for (var e; e = th.shift();)
            if (e.__P && e.__H) try {
                e.__H.__h.forEach(tk), e.__H.__h.forEach(tI), e.__H.__h = []
            } catch (t) {
                e.__H.__h = [], td.__e(t, e.__v)
            }
    }
    td.__b = function(e) {
        ta = null, tu && tu(e)
    }, td.__ = function(e, t) {
        e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ty && ty(e, t)
    }, td.__r = function(e) {
        tp && tp(e), tr = 0;
        var t = (ta = e.__c).__H;
        t && (to === ta ? (t.__h = [], ta.__h = [], t.__.forEach(function(e) {
            e.__N && (e.__ = e.__N), e.i = e.__N = void 0
        })) : (t.__h.forEach(tk), t.__h.forEach(tI), t.__h = [], tr = 0)), to = ta
    }, td.diffed = function(e) {
        tf && tf(e);
        var t = e.__c;
        t && t.__H && (t.__H.__h.length && (1 !== th.push(t) && tl === td.requestAnimationFrame || ((tl = td.requestAnimationFrame) || function(e) {
            var t, n = function() {
                    clearTimeout(s), tv && cancelAnimationFrame(t), setTimeout(e)
                },
                s = setTimeout(n, 100);
            tv && (t = requestAnimationFrame(n))
        })(tw)), t.__H.__.forEach(function(e) {
            e.i && (e.__H = e.i), e.i = void 0
        })), to = ta = null
    }, td.__c = function(e, t) {
        t.some(function(e) {
            try {
                e.__h.forEach(tk), e.__h = e.__h.filter(function(e) {
                    return !e.__ || tI(e)
                })
            } catch (n) {
                t.some(function(e) {
                    e.__h && (e.__h = [])
                }), t = [], td.__e(n, e.__v)
            }
        }), tg && tg(e, t)
    }, td.unmount = function(e) {
        tm && tm(e);
        var t, n = e.__c;
        n && n.__H && (n.__H.__.forEach(function(e) {
            try {
                tk(e)
            } catch (e) {
                t = e
            }
        }), n.__H = void 0, t && td.__e(t, n.__v))
    };
    var tv = "function" == typeof requestAnimationFrame;

    function tk(e) {
        var t = ta,
            n = e.__c;
        "function" == typeof n && (e.__c = void 0, n()), ta = t
    }

    function tI(e) {
        var t = ta;
        e.__c = e.__(), ta = t
    }

    function tC(e, t) {
        return "function" == typeof t ? t(e) : t
    }
    class tE {
        constructor() {
            this.items = new Map, this.nextItemKey = 0, this.root = null, this.darkMode = eT()
        }
        attach(e) {
            this.root = document.createElement("div"), this.root.className = "-cbwsdk-snackbar-root", e.appendChild(this.root), this.render()
        }
        presentItem(e) {
            let t = this.nextItemKey++;
            return this.items.set(t, e), this.render(), () => {
                this.items.delete(t), this.render()
            }
        }
        clear() {
            this.items.clear(), this.render()
        }
        render() {
            this.root && ti(eX("div", null, eX(tx, {
                darkMode: this.darkMode
            }, Array.from(this.items.entries()).map(([e, t]) => eX(tS, Object.assign({}, t, {
                key: e
            }))))), this.root)
        }
    }
    let tx = e => eX("div", {
            class: eP("-cbwsdk-snackbar-container")
        }, eX("style", null, ".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"), eX("div", {
            class: "-cbwsdk-snackbar"
        }, e.children)),
        tS = ({
            autoExpand: e,
            message: t,
            menuItems: n
        }) => {
            var s, i, r, a;
            let [o, l] = (tc = 1, tb(tC, !0)), [c, h] = (tc = 1, tb(tC, null != e && e));
            return s = () => {
                let e = [window.setTimeout(() => {
                    l(!1)
                }, 1), window.setTimeout(() => {
                    h(!0)
                }, 1e4)];
                return () => {
                    e.forEach(window.clearTimeout)
                }
            }, i = t_(tr++, 3), !td.__s && (r = i.__H, a = void 0, !r || r.length !== a.length || a.some(function(e, t) {
                return e !== r[t]
            })) && (i.__ = s, i.i = void 0, ta.__H.__h.push(i)), eX("div", {
                class: eP("-cbwsdk-snackbar-instance", o && "-cbwsdk-snackbar-instance-hidden", c && "-cbwsdk-snackbar-instance-expanded")
            }, eX("div", {
                class: "-cbwsdk-snackbar-instance-header",
                onClick: () => {
                    h(!c)
                }
            }, eX("img", {
                src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",
                class: "-cbwsdk-snackbar-instance-header-cblogo"
            }), " ", eX("div", {
                class: "-cbwsdk-snackbar-instance-header-message"
            }, t), eX("div", {
                class: "-gear-container"
            }, !c && eX("svg", {
                width: "24",
                height: "24",
                viewBox: "0 0 24 24",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg"
            }, eX("circle", {
                cx: "12",
                cy: "12",
                r: "12",
                fill: "#F5F7F8"
            })), eX("img", {
                src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",
                class: "-gear-icon",
                title: "Expand"
            }))), n && n.length > 0 && eX("div", {
                class: "-cbwsdk-snackbar-instance-menu"
            }, n.map((e, t) => eX("div", {
                class: eP("-cbwsdk-snackbar-instance-menu-item", e.isRed && "-cbwsdk-snackbar-instance-menu-item-is-red"),
                onClick: e.onClick,
                key: t
            }, eX("svg", {
                width: e.svgWidth,
                height: e.svgHeight,
                viewBox: "0 0 10 11",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg"
            }, eX("path", {
                "fill-rule": e.defaultFillRule,
                "clip-rule": e.defaultClipRule,
                d: e.path,
                fill: "#AAAAAA"
            })), eX("span", {
                class: eP("-cbwsdk-snackbar-instance-menu-item-info", e.isRed && "-cbwsdk-snackbar-instance-menu-item-info-is-red")
            }, e.info)))))
        },
        tM = "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z";
    class tL {
        constructor() {
            this.attached = !1, this.snackbar = new tE
        }
        attach() {
            if (this.attached) throw Error("Coinbase Wallet SDK UI is already attached");
            let e = document.documentElement,
                t = document.createElement("div");
            t.className = "-cbwsdk-css-reset", e.appendChild(t), this.snackbar.attach(t), this.attached = !0, eN()
        }
        showConnecting(e) {
            let t;
            return t = e.isUnlinkedErrorState ? {
                autoExpand: !0,
                message: "Connection lost",
                menuItems: [{
                    isRed: !1,
                    info: "Reset connection",
                    svgWidth: "10",
                    svgHeight: "11",
                    path: "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",
                    defaultFillRule: "evenodd",
                    defaultClipRule: "evenodd",
                    onClick: e.onResetConnection
                }]
            } : {
                message: "Confirm on phone",
                menuItems: [{
                    isRed: !0,
                    info: "Cancel transaction",
                    svgWidth: "11",
                    svgHeight: "11",
                    path: "M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",
                    defaultFillRule: "inherit",
                    defaultClipRule: "inherit",
                    onClick: e.onCancel
                }, {
                    isRed: !1,
                    info: "Reset connection",
                    svgWidth: "10",
                    svgHeight: "11",
                    path: tM,
                    defaultFillRule: "evenodd",
                    defaultClipRule: "evenodd",
                    onClick: e.onResetConnection
                }]
            }, this.snackbar.presentItem(t)
        }
    }
    class tA {
        constructor() {
            this.root = null, this.darkMode = eT()
        }
        attach() {
            let e = document.documentElement;
            this.root = document.createElement("div"), this.root.className = "-cbwsdk-css-reset", e.appendChild(this.root), eN()
        }
        present(e) {
            this.render(e)
        }
        clear() {
            this.render(null)
        }
        render(e) {
            !this.root || (ti(null, this.root), e && ti(eX(tD, Object.assign({}, e, {
                onDismiss: () => {
                    this.clear()
                },
                darkMode: this.darkMode
            })), this.root))
        }
    }
    let tD = ({
            title: e,
            buttonText: t,
            darkMode: n,
            onButtonClick: s,
            onDismiss: i
        }) => eX(tx, {
            darkMode: n
        }, eX("div", {
            class: "-cbwsdk-redirect-dialog"
        }, eX("style", null, ".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"), eX("div", {
            class: "-cbwsdk-redirect-dialog-backdrop",
            onClick: i
        }), eX("div", {
            class: eP("-cbwsdk-redirect-dialog-box", n ? "dark" : "light")
        }, eX("p", null, e), eX("button", {
            onClick: s
        }, t)))),
        tT = "https://www.walletlink.org";
    class tN {
        constructor() {
            this.attached = !1, this.redirectDialog = new tA
        }
        attach() {
            if (this.attached) throw Error("Coinbase Wallet SDK UI is already attached");
            this.redirectDialog.attach(), this.attached = !0
        }
        redirectToCoinbaseWallet(e) {
            let t = new URL("https://go.cb-w.com/walletlink");
            t.searchParams.append("redirect_url", function() {
                try {
                    if (function() {
                            try {
                                return null !== window.frameElement
                            } catch (e) {
                                return !1
                            }
                        }() && window.top) return window.top.location;
                    return window.location
                } catch (e) {
                    return window.location
                }
            }().href), e && t.searchParams.append("wl_url", e);
            let n = document.createElement("a");
            n.target = "cbw-opener", n.href = t.href, n.rel = "noreferrer noopener", n.click()
        }
        openCoinbaseWalletDeeplink(e) {
            this.redirectToCoinbaseWallet(e), setTimeout(() => {
                this.redirectDialog.present({
                    title: "Redirecting to Coinbase Wallet...",
                    buttonText: "Open",
                    onButtonClick: () => {
                        this.redirectToCoinbaseWallet(e)
                    }
                })
            }, 99)
        }
        showConnecting(e) {
            return () => {
                this.redirectDialog.clear()
            }
        }
    }
    class tP {
        constructor(e) {
            this.chainCallbackParams = {
                chainId: "",
                jsonRpcUrl: ""
            }, this.isMobileWeb = function() {
                var e;
                return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null == (e = null == window ? void 0 : window.navigator) ? void 0 : e.userAgent)
            }(), this.linkedUpdated = e => {
                this.isLinked = e;
                let t = this.storage.getItem(eb);
                if (e && (this._session.linked = e), this.isUnlinkedErrorState = !1, t) {
                    let n = t.split(" "),
                        s = "true" === this.storage.getItem("IsStandaloneSigning");
                    "" === n[0] || e || !this._session.linked || s || (this.isUnlinkedErrorState = !0)
                }
            }, this.metadataUpdated = (e, t) => {
                this.storage.setItem(e, t)
            }, this.chainUpdated = (e, t) => {
                (this.chainCallbackParams.chainId !== e || this.chainCallbackParams.jsonRpcUrl !== t) && (this.chainCallbackParams = {
                    chainId: e,
                    jsonRpcUrl: t
                }, this.chainCallback && this.chainCallback(t, Number.parseInt(e, 10)))
            }, this.accountUpdated = e => {
                this.accountsCallback && this.accountsCallback([e]), tP.accountRequestCallbackIds.size > 0 && (Array.from(tP.accountRequestCallbackIds.values()).forEach(t => {
                    this.invokeCallback(t, {
                        method: "requestEthereumAccounts",
                        result: [e]
                    })
                }), tP.accountRequestCallbackIds.clear())
            }, this.resetAndReload = this.resetAndReload.bind(this), this.linkAPIUrl = e.linkAPIUrl, this.storage = e.storage, this.metadata = e.metadata, this.accountsCallback = e.accountsCallback, this.chainCallback = e.chainCallback;
            const {
                session: t,
                ui: n,
                connection: s
            } = this.subscribe();
            this._session = t, this.connection = s, this.relayEventManager = new eE, this.ui = n, this.ui.attach()
        }
        subscribe() {
            let e = eD.load(this.storage) || eD.create(this.storage),
                {
                    linkAPIUrl: t
                } = this,
                n = new eC({
                    session: e,
                    linkAPIUrl: t,
                    listener: this
                }),
                s = this.isMobileWeb ? new tN : new tL;
            return n.connect(), {
                session: e,
                ui: s,
                connection: n
            }
        }
        resetAndReload() {
            this.connection.destroy().then(() => {
                let e = eD.load(this.storage);
                (null == e ? void 0 : e.id) === this._session.id && i.clearAll(), document.location.reload()
            }).catch(e => {})
        }
        signEthereumTransaction(e) {
            return this.sendRequest({
                method: "signEthereumTransaction",
                params: {
                    fromAddress: e.fromAddress,
                    toAddress: e.toAddress,
                    weiValue: U(e.weiValue),
                    data: R(e.data, !0),
                    nonce: e.nonce,
                    gasPriceInWei: e.gasPriceInWei ? U(e.gasPriceInWei) : null,
                    maxFeePerGas: e.gasPriceInWei ? U(e.gasPriceInWei) : null,
                    maxPriorityFeePerGas: e.gasPriceInWei ? U(e.gasPriceInWei) : null,
                    gasLimit: e.gasLimit ? U(e.gasLimit) : null,
                    chainId: e.chainId,
                    shouldSubmit: !1
                }
            })
        }
        signAndSubmitEthereumTransaction(e) {
            return this.sendRequest({
                method: "signEthereumTransaction",
                params: {
                    fromAddress: e.fromAddress,
                    toAddress: e.toAddress,
                    weiValue: U(e.weiValue),
                    data: R(e.data, !0),
                    nonce: e.nonce,
                    gasPriceInWei: e.gasPriceInWei ? U(e.gasPriceInWei) : null,
                    maxFeePerGas: e.maxFeePerGas ? U(e.maxFeePerGas) : null,
                    maxPriorityFeePerGas: e.maxPriorityFeePerGas ? U(e.maxPriorityFeePerGas) : null,
                    gasLimit: e.gasLimit ? U(e.gasLimit) : null,
                    chainId: e.chainId,
                    shouldSubmit: !0
                }
            })
        }
        submitEthereumTransaction(e, t) {
            return this.sendRequest({
                method: "submitEthereumTransaction",
                params: {
                    signedTransaction: R(e, !0),
                    chainId: t
                }
            })
        }
        getWalletLinkSession() {
            return this._session
        }
        sendRequest(e) {
            let t = null,
                n = N(8),
                s = s => {
                    this.publishWeb3RequestCanceledEvent(n), this.handleErrorResponse(n, e.method, s), null == t || t()
                };
            return new Promise((i, r) => {
                t = this.ui.showConnecting({
                    isUnlinkedErrorState: this.isUnlinkedErrorState,
                    onCancel: s,
                    onResetConnection: this.resetAndReload
                }), this.relayEventManager.callbacks.set(n, e => {
                    if (null == t || t(), ew(e)) return r(Error(e.errorMessage));
                    i(e)
                }), this.publishWeb3RequestEvent(n, e)
            })
        }
        publishWeb3RequestEvent(e, t) {
            let n = {
                type: "WEB3_REQUEST",
                id: e,
                request: t
            };
            this.publishEvent("Web3Request", n, !0).then(e => {}).catch(e => {
                this.handleWeb3ResponseMessage(n.id, {
                    method: t.method,
                    errorMessage: e.message
                })
            }), this.isMobileWeb && this.openCoinbaseWalletDeeplink(t.method)
        }
        openCoinbaseWalletDeeplink(e) {
            if (this.ui instanceof tN) switch (e) {
                case "requestEthereumAccounts":
                case "switchEthereumChain":
                    return;
                default:
                    window.addEventListener("blur", () => {
                        window.addEventListener("focus", () => {
                            this.connection.checkUnseenEvents()
                        }, {
                            once: !0
                        })
                    }, {
                        once: !0
                    }), this.ui.openCoinbaseWalletDeeplink()
            }
        }
        publishWeb3RequestCanceledEvent(e) {
            this.publishEvent("Web3RequestCanceled", {
                type: "WEB3_REQUEST_CANCELED",
                id: e
            }, !1).then()
        }
        publishEvent(e, t, n) {
            return this.connection.publishEvent(e, t, n)
        }
        handleWeb3ResponseMessage(e, t) {
            if ("requestEthereumAccounts" === t.method) {
                tP.accountRequestCallbackIds.forEach(e => this.invokeCallback(e, t)), tP.accountRequestCallbackIds.clear();
                return
            }
            this.invokeCallback(e, t)
        }
        handleErrorResponse(e, t, n) {
            var s;
            let i = null != (s = null == n ? void 0 : n.message) ? s : "Unspecified error message.";
            this.handleWeb3ResponseMessage(e, {
                method: t,
                errorMessage: i
            })
        }
        invokeCallback(e, t) {
            let n = this.relayEventManager.callbacks.get(e);
            n && (n(t), this.relayEventManager.callbacks.delete(e))
        }
        requestEthereumAccounts() {
            let {
                appName: e,
                appLogoUrl: t
            } = this.metadata, n = {
                method: "requestEthereumAccounts",
                params: {
                    appName: e,
                    appLogoUrl: t
                }
            }, s = N(8);
            return new Promise((e, t) => {
                this.relayEventManager.callbacks.set(s, n => {
                    if (ew(n)) return t(Error(n.errorMessage));
                    e(n)
                }), tP.accountRequestCallbackIds.add(s), this.publishWeb3RequestEvent(s, n)
            })
        }
        watchAsset(e, t, n, s, i, r) {
            let a = {
                    method: "watchAsset",
                    params: {
                        type: e,
                        options: {
                            address: t,
                            symbol: n,
                            decimals: s,
                            image: i
                        },
                        chainId: r
                    }
                },
                o = null,
                l = N(8),
                c = e => {
                    this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, e), null == o || o()
                };
            return o = this.ui.showConnecting({
                isUnlinkedErrorState: this.isUnlinkedErrorState,
                onCancel: c,
                onResetConnection: this.resetAndReload
            }), new Promise((e, t) => {
                this.relayEventManager.callbacks.set(l, n => {
                    if (null == o || o(), ew(n)) return t(Error(n.errorMessage));
                    e(n)
                }), this.publishWeb3RequestEvent(l, a)
            })
        }
        addEthereumChain(e, t, n, s, i, r) {
            let a = {
                    method: "addEthereumChain",
                    params: {
                        chainId: e,
                        rpcUrls: t,
                        blockExplorerUrls: s,
                        chainName: i,
                        iconUrls: n,
                        nativeCurrency: r
                    }
                },
                o = null,
                l = N(8),
                c = e => {
                    this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, e), null == o || o()
                };
            return o = this.ui.showConnecting({
                isUnlinkedErrorState: this.isUnlinkedErrorState,
                onCancel: c,
                onResetConnection: this.resetAndReload
            }), new Promise((e, t) => {
                this.relayEventManager.callbacks.set(l, n => {
                    if (null == o || o(), ew(n)) return t(Error(n.errorMessage));
                    e(n)
                }), this.publishWeb3RequestEvent(l, a)
            })
        }
        switchEthereumChain(e, t) {
            let n = {
                    method: "switchEthereumChain",
                    params: Object.assign({
                        chainId: e
                    }, {
                        address: t
                    })
                },
                s = null,
                i = N(8),
                r = e => {
                    this.publishWeb3RequestCanceledEvent(i), this.handleErrorResponse(i, n.method, e), null == s || s()
                };
            return s = this.ui.showConnecting({
                isUnlinkedErrorState: this.isUnlinkedErrorState,
                onCancel: r,
                onResetConnection: this.resetAndReload
            }), new Promise((e, t) => {
                this.relayEventManager.callbacks.set(i, n => (null == s || s(), ew(n) && n.errorCode) ? t(C({
                    code: n.errorCode,
                    message: "Unrecognized chain ID. Try adding the chain using addEthereumChain first."
                })) : ew(n) ? t(Error(n.errorMessage)) : void e(n)), this.publishWeb3RequestEvent(i, n)
            })
        }
    }
    tP.accountRequestCallbackIds = new Set;
    let tO = "DefaultChainId",
        tR = "DefaultJsonRpcUrl";
    class tj {
        constructor(e) {
            this._relay = null, this._addresses = [], this.metadata = e.metadata, this._storage = new i("walletlink", tT), this.callback = e.callback || null;
            const t = this._storage.getItem(eb);
            if (t) {
                const e = t.split(" ");
                "" !== e[0] && (this._addresses = e.map(e => K(e)))
            }
            this.initializeRelay()
        }
        getSession() {
            let {
                id: e,
                secret: t
            } = this.initializeRelay().getWalletLinkSession();
            return {
                id: e,
                secret: t
            }
        }
        async handshake() {
            await this._eth_requestAccounts()
        }
        get selectedAddress() {
            return this._addresses[0] || void 0
        }
        get jsonRpcUrl() {
            var e;
            return null != (e = this._storage.getItem(tR)) ? e : void 0
        }
        set jsonRpcUrl(e) {
            this._storage.setItem(tR, e)
        }
        updateProviderInfo(e, t) {
            var n;
            this.jsonRpcUrl = e;
            let s = this.getChainId();
            this._storage.setItem(tO, t.toString(10)), F(t) !== s && (null == (n = this.callback) || n.call(this, "chainChanged", H(t)))
        }
        async watchAsset(e) {
            let t = Array.isArray(e) ? e[0] : e;
            if (!t.type) throw _("Type is required");
            if ((null == t ? void 0 : t.type) !== "ERC20") throw _(`Asset of type '${t.type}' is not supported`);
            if (!(null == t ? void 0 : t.options)) throw _("Options are required");
            if (!(null == t ? void 0 : t.options.address)) throw _("Address is required");
            let n = this.getChainId(),
                {
                    address: s,
                    symbol: i,
                    image: r,
                    decimals: a
                } = t.options,
                o = this.initializeRelay(),
                l = await o.watchAsset(t.type, s, i, a, r, null == n ? void 0 : n.toString());
            return !ew(l) && !!l.result
        }
        async addEthereumChain(e) {
            var t, n;
            let s = e[0];
            if ((null == (t = s.rpcUrls) ? void 0 : t.length) === 0) throw _("please pass in at least 1 rpcUrl");
            if (!s.chainName || "" === s.chainName.trim()) throw _("chainName is a required field");
            if (!s.nativeCurrency) throw _("nativeCurrency is a required field");
            let i = Number.parseInt(s.chainId, 16);
            if (i === this.getChainId()) return !1;
            let r = this.initializeRelay(),
                {
                    rpcUrls: a = [],
                    blockExplorerUrls: o = [],
                    chainName: l,
                    iconUrls: c = [],
                    nativeCurrency: h
                } = s,
                d = await r.addEthereumChain(i.toString(), a, c, o, l, h);
            if (ew(d)) return !1;
            if ((null == (n = d.result) ? void 0 : n.isApproved) === !0) return this.updateProviderInfo(a[0], i), null;
            throw b("unable to add ethereum chain")
        }
        async switchEthereumChain(e) {
            let t = Number.parseInt(e[0].chainId, 16),
                n = this.initializeRelay(),
                s = await n.switchEthereumChain(t.toString(10), this.selectedAddress || void 0);
            if (ew(s)) throw s;
            let i = s.result;
            return i.isApproved && i.rpcUrl.length > 0 && this.updateProviderInfo(i.rpcUrl, t), null
        }
        async cleanup() {
            this.callback = null, this._relay && this._relay.resetAndReload(), this._storage.clear()
        }
        _setAddresses(e, t) {
            var n;
            if (!Array.isArray(e)) throw Error("addresses is not an array");
            let s = e.map(e => K(e));
            JSON.stringify(s) !== JSON.stringify(this._addresses) && (this._addresses = s, null == (n = this.callback) || n.call(this, "accountsChanged", s), this._storage.setItem(eb, s.join(" ")))
        }
        async request(e) {
            let t = e.params || [];
            switch (e.method) {
                case "eth_accounts":
                    return [...this._addresses];
                case "eth_coinbase":
                    return this.selectedAddress || null;
                case "net_version":
                    return this.getChainId().toString(10);
                case "eth_chainId":
                    return H(this.getChainId());
                case "eth_requestAccounts":
                    return this._eth_requestAccounts();
                case "eth_ecRecover":
                case "personal_ecRecover":
                    return this.ecRecover(e);
                case "personal_sign":
                    return this.personalSign(e);
                case "eth_signTransaction":
                    return this._eth_signTransaction(t);
                case "eth_sendRawTransaction":
                    return this._eth_sendRawTransaction(t);
                case "eth_sendTransaction":
                    return this._eth_sendTransaction(t);
                case "eth_signTypedData_v1":
                case "eth_signTypedData_v3":
                case "eth_signTypedData_v4":
                case "eth_signTypedData":
                    return this.signTypedData(e);
                case "wallet_addEthereumChain":
                    return this.addEthereumChain(t);
                case "wallet_switchEthereumChain":
                    return this.switchEthereumChain(t);
                case "wallet_watchAsset":
                    return this.watchAsset(t);
                default:
                    if (!this.jsonRpcUrl) throw b("No RPC URL set for chain");
                    return ed(e, this.jsonRpcUrl)
            }
        }
        _ensureKnownAddress(e) {
            let t = K(e);
            if (!this._addresses.map(e => K(e)).includes(t)) throw Error("Unknown Ethereum address")
        }
        _prepareTransactionParams(e) {
            let t = e.from ? K(e.from) : this.selectedAddress;
            if (!t) throw Error("Ethereum address is unavailable");
            this._ensureKnownAddress(t);
            let n = e.to ? K(e.to) : null,
                s = null != e.value ? $(e.value) : BigInt(0),
                i = e.data ? z(e.data) : r.Buffer.alloc(0),
                a = null != e.nonce ? F(e.nonce) : null,
                o = null != e.gasPrice ? $(e.gasPrice) : null,
                l = null != e.maxFeePerGas ? $(e.maxFeePerGas) : null,
                c = null != e.maxPriorityFeePerGas ? $(e.maxPriorityFeePerGas) : null;
            return {
                fromAddress: t,
                toAddress: n,
                weiValue: s,
                data: i,
                nonce: a,
                gasPriceInWei: o,
                maxFeePerGas: l,
                maxPriorityFeePerGas: c,
                gasLimit: null != e.gas ? $(e.gas) : null,
                chainId: e.chainId ? F(e.chainId) : this.getChainId()
            }
        }
        async ecRecover(e) {
            let {
                method: t,
                params: n
            } = e;
            if (!Array.isArray(n)) throw _();
            let s = this.initializeRelay(),
                i = await s.sendRequest({
                    method: "ethereumAddressFromSignedMessage",
                    params: {
                        message: j(n[0]),
                        signature: j(n[1]),
                        addPrefix: "personal_ecRecover" === t
                    }
                });
            if (ew(i)) throw i;
            return i.result
        }
        getChainId() {
            var e;
            return Number.parseInt(null != (e = this._storage.getItem(tO)) ? e : "1", 10)
        }
        async _eth_requestAccounts() {
            var e, t;
            if (this._addresses.length > 0) return null == (e = this.callback) || e.call(this, "connect", {
                chainId: H(this.getChainId())
            }), this._addresses;
            let n = this.initializeRelay(),
                s = await n.requestEthereumAccounts();
            if (ew(s)) throw s;
            if (!s.result) throw Error("accounts received is empty");
            return this._setAddresses(s.result), null == (t = this.callback) || t.call(this, "connect", {
                chainId: H(this.getChainId())
            }), this._addresses
        }
        async personalSign({
            params: e
        }) {
            if (!Array.isArray(e)) throw _();
            let t = e[1],
                n = e[0];
            this._ensureKnownAddress(t);
            let s = this.initializeRelay(),
                i = await s.sendRequest({
                    method: "signEthereumMessage",
                    params: {
                        address: K(t),
                        message: j(n),
                        addPrefix: !0,
                        typedDataJson: null
                    }
                });
            if (ew(i)) throw i;
            return i.result
        }
        async _eth_signTransaction(e) {
            let t = this._prepareTransactionParams(e[0] || {}),
                n = this.initializeRelay(),
                s = await n.signEthereumTransaction(t);
            if (ew(s)) throw s;
            return s.result
        }
        async _eth_sendRawTransaction(e) {
            let t = z(e[0]),
                n = this.initializeRelay(),
                s = await n.submitEthereumTransaction(t, this.getChainId());
            if (ew(s)) throw s;
            return s.result
        }
        async _eth_sendTransaction(e) {
            let t = this._prepareTransactionParams(e[0] || {}),
                n = this.initializeRelay(),
                s = await n.signAndSubmitEthereumTransaction(t);
            if (ew(s)) throw s;
            return s.result
        }
        async signTypedData(e) {
            let {
                method: t,
                params: n
            } = e;
            if (!Array.isArray(n)) throw _();
            let s = n[+("eth_signTypedData_v1" === t)],
                i = n[+("eth_signTypedData_v1" !== t)];
            this._ensureKnownAddress(s);
            let r = this.initializeRelay(),
                a = await r.sendRequest({
                    method: "signEthereumMessage",
                    params: {
                        address: K(s),
                        message: R(({
                            eth_signTypedData_v1: e_.default.hashForSignTypedDataLegacy,
                            eth_signTypedData_v3: e_.default.hashForSignTypedData_v3,
                            eth_signTypedData_v4: e_.default.hashForSignTypedData_v4,
                            eth_signTypedData: e_.default.hashForSignTypedData_v4
                        })[t]({
                            data: function(e) {
                                if ("string" == typeof e) return JSON.parse(e);
                                if ("object" == typeof e) return e;
                                throw _(`Not a JSON string or an object: ${String(e)}`)
                            }(i)
                        }), !0),
                        typedDataJson: JSON.stringify(i, null, 2),
                        addPrefix: !1
                    }
                });
            if (ew(a)) throw a;
            return a.result
        }
        initializeRelay() {
            return this._relay || (this._relay = new tP({
                linkAPIUrl: tT,
                storage: this._storage,
                metadata: this.metadata,
                accountsCallback: this._setAddresses.bind(this),
                chainCallback: this.updateProviderInfo.bind(this)
            })), this._relay
        }
    }
    let tU = "SignerType",
        tH = new i("CBWSDK", "SignerConfigurator");
    async function tW(e) {
        let {
            communicator: t,
            metadata: n,
            handshakeRequest: s,
            callback: i
        } = e;
        tB(t, n, i).catch(() => {});
        let r = {
                id: crypto.randomUUID(),
                event: "selectSignerType",
                data: Object.assign(Object.assign({}, e.preference), {
                    handshakeRequest: s
                })
            },
            {
                data: a
            } = await t.postRequestAndWaitForResponse(r);
        return a
    }
    async function tB(e, t, n) {
        await e.onMessage(({
            event: e
        }) => "WalletLinkSessionRequest" === e);
        let s = new tj({
            metadata: t,
            callback: n
        });
        e.postMessage({
            event: "WalletLinkUpdate",
            data: {
                session: s.getSession()
            }
        }), await s.handshake(), e.postMessage({
            event: "WalletLinkUpdate",
            data: {
                connected: !0
            }
        })
    }
    let tq = `Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.

Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,
        {
            checkCrossOriginOpenerPolicy: tV,
            getCrossOriginOpenerPolicy: tZ
        } = {
            getCrossOriginOpenerPolicy: () => void 0 === t ? "undefined" : t,
            checkCrossOriginOpenerPolicy: async () => {
                if ("u" < typeof window) {
                    t = "non-browser-env";
                    return
                }
                try {
                    let e = `${window.location.origin}${window.location.pathname}`,
                        n = await fetch(e, {
                            method: "HEAD"
                        });
                    if (!n.ok) throw Error(`HTTP error! status: ${n.status}`);
                    let s = n.headers.get("Cross-Origin-Opener-Policy");
                    t = null != s ? s : "null", "same-origin" === t && console.error(tq)
                } catch (e) {
                    console.error("Error checking Cross-Origin-Opener-Policy:", e.message), t = "error"
                }
            }
        },
        tK = {
            isRed: !1,
            info: "Retry",
            svgWidth: "10",
            svgHeight: "11",
            path: tM,
            defaultFillRule: "evenodd",
            defaultClipRule: "evenodd"
        },
        tz = null;
    class tF {
        constructor({
            url: e = "https://keys.coinbase.com/connect",
            metadata: t,
            preference: n
        }) {
            this.popup = null, this.listeners = new Map, this.postMessage = async e => {
                (await this.waitForPopupLoaded()).postMessage(e, this.url.origin)
            }, this.postRequestAndWaitForResponse = async e => {
                let t = this.onMessage(({
                    requestId: t
                }) => t === e.id);
                return this.postMessage(e), await t
            }, this.onMessage = async e => new Promise((t, n) => {
                let s = n => {
                    if (n.origin !== this.url.origin) return;
                    let i = n.data;
                    e(i) && (t(i), window.removeEventListener("message", s), this.listeners.delete(s))
                };
                window.addEventListener("message", s), this.listeners.set(s, {
                    reject: n
                })
            }), this.disconnect = () => {
                var e;
                (e = this.popup) && !e.closed && e.close(), this.popup = null, this.listeners.forEach(({
                    reject: e
                }, t) => {
                    e(w("Request rejected")), window.removeEventListener("message", t)
                }), this.listeners.clear()
            }, this.waitForPopupLoaded = async () => this.popup && !this.popup.closed ? (this.popup.focus(), this.popup) : (this.popup = await
                function(e) {
                    let t = (window.innerWidth - 420) / 2 + window.screenX,
                        n = (window.innerHeight - 540) / 2 + window.screenY;

                    function s() {
                        let s = `wallet_${crypto.randomUUID()}`,
                            i = window.open(e, s, `width=420, height=540, left=${t}, top=${n}`);
                        return (null == i || i.focus(), i) ? i : null
                    }
                    var i = e;
                    for (let [e, t] of Object.entries({
                            sdkName: eh,
                            sdkVersion: ec,
                            origin: window.location.origin,
                            coop: tZ()
                        })) i.searchParams.append(e, t.toString());
                    let r = s();
                    if (!r) {
                        let e = function() {
                            if (!tz) {
                                let e = document.createElement("div");
                                e.className = "-cbwsdk-css-reset", document.body.appendChild(e), (tz = new tE).attach(e)
                            }
                            return tz
                        }();
                        return new Promise((t, n) => {
                            e.presentItem({
                                autoExpand: !0,
                                message: "Popup was blocked. Try again.",
                                menuItems: [Object.assign(Object.assign({}, tK), {
                                    onClick: () => {
                                        (r = s()) ? t(r): n(b("Popup window was blocked")), e.clear()
                                    }
                                })]
                            })
                        })
                    }
                    return Promise.resolve(r)
                }(this.url), this.onMessage(({
                    event: e
                }) => "PopupUnload" === e).then(this.disconnect).catch(() => {}), this.onMessage(({
                    event: e
                }) => "PopupLoaded" === e).then(e => {
                    this.postMessage({
                        requestId: e.id,
                        data: {
                            version: ec,
                            metadata: this.metadata,
                            preference: this.preference,
                            location: window.location.toString()
                        }
                    })
                }).then(() => {
                    if (!this.popup) throw b();
                    return this.popup
                })), this.url = new URL(e), this.metadata = t, this.preference = n
        }
    }
    e.i(102201);
    var t$ = e.i(154325);
    class tG extends t$.EventEmitter {}
    var tJ = function(e, t) {
        var n = {};
        for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && 0 > t.indexOf(s) && (n[s] = e[s]);
        if (null != e && "function" == typeof Object.getOwnPropertySymbols)
            for (var i = 0, s = Object.getOwnPropertySymbols(e); i < s.length; i++) 0 > t.indexOf(s[i]) && Object.prototype.propertyIsEnumerable.call(e, s[i]) && (n[s[i]] = e[s[i]]);
        return n
    };
    class tY extends tG {
        constructor(e) {
            var {
                metadata: t
            } = e, n = e.preference, {
                keysUrl: s
            } = n, i = tJ(n, ["keysUrl"]);
            super(), this.signer = null, this.isCoinbaseWallet = !0, this.metadata = t, this.preference = i, this.communicator = new tF({
                url: s,
                metadata: t,
                preference: i
            });
            const r = tH.getItem(tU);
            r && (this.signer = this.initSigner(r))
        }
        async request(e) {
            try {
                if (! function(e) {
                        if (!e || "object" != typeof e || Array.isArray(e)) throw _({
                            message: "Expected a single, non-array, object argument.",
                            data: e
                        });
                        let {
                            method: t,
                            params: n
                        } = e;
                        if ("string" != typeof t || 0 === t.length) throw _({
                            message: "'args.method' must be a non-empty string.",
                            data: e
                        });
                        if (void 0 !== n && !Array.isArray(n) && ("object" != typeof n || null === n)) throw _({
                            message: "'args.params' must be an object or array if provided.",
                            data: e
                        });
                        switch (t) {
                            case "eth_sign":
                            case "eth_signTypedData_v2":
                            case "eth_subscribe":
                            case "eth_unsubscribe":
                                throw k()
                        }
                    }(e), !this.signer) switch (e.method) {
                    case "eth_requestAccounts":
                        {
                            let t = await this.requestSignerSelection(e),
                                n = this.initSigner(t);await n.handshake(e),
                            this.signer = n,
                            tH.setItem(tU, t);
                            break
                        }
                    case "wallet_sendCalls":
                        {
                            let t = this.initSigner("scw");await t.handshake({
                                method: "handshake"
                            });
                            let n = await t.request(e);
                            return await t.cleanup(),
                            n
                        }
                    case "wallet_getCallsStatus":
                        return ed(e, "https://rpc.wallet.coinbase.com");
                    case "net_version":
                        return 1;
                    case "eth_chainId":
                        return H(1);
                    default:
                        throw v("Must call 'eth_requestAccounts' before other methods")
                }
                return await this.signer.request(e)
            } catch (s) {
                let e, t, {
                    code: n
                } = s;
                return n === c && this.disconnect(), Promise.reject((e = function(e, {
                    shouldIncludeStack: t = !1
                } = {}) {
                    var n, s;
                    let i = {};
                    if (e && "object" == typeof e && !Array.isArray(e) && m(e, "code") && Number.isInteger(n = e.code) && (u[n.toString()] || (s = n) >= -32099 && s <= -32e3)) i.code = e.code, e.message && "string" == typeof e.message ? (i.message = e.message, m(e, "data") && (i.data = e.data)) : (i.message = f(i.code), i.data = {
                        originalError: g(e)
                    });
                    else i.code = o, i.message = y(e, "message") ? e.message : p, i.data = {
                        originalError: g(e)
                    };
                    return t && (i.stack = y(e, "stack") ? e.stack : void 0), i
                }(function(e) {
                    var t;
                    if ("string" == typeof e) return {
                        message: e,
                        code: o
                    };
                    if (ew(e)) {
                        let n = e.errorMessage,
                            s = null != (t = e.errorCode) ? t : n.match(/(denied|rejected)/i) ? l : void 0;
                        return Object.assign(Object.assign({}, e), {
                            message: n,
                            code: s,
                            data: {
                                method: e.method
                            }
                        })
                    }
                    return e
                }(s), {
                    shouldIncludeStack: !0
                }), (t = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors")).searchParams.set("version", ec), t.searchParams.set("code", e.code.toString()), t.searchParams.set("message", e.message), Object.assign(Object.assign({}, e), {
                    docUrl: t.href
                })))
            }
        }
        async enable() {
            return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'), await this.request({
                method: "eth_requestAccounts"
            })
        }
        async disconnect() {
            var e;
            await (null == (e = this.signer) ? void 0 : e.cleanup()), this.signer = null, i.clearAll(), this.emit("disconnect", I("User initiated disconnection"))
        }
        requestSignerSelection(e) {
            return tW({
                communicator: this.communicator,
                preference: this.preference,
                metadata: this.metadata,
                handshakeRequest: e,
                callback: this.emit.bind(this)
            })
        }
        initSigner(e) {
            return function(e) {
                let {
                    signerType: t,
                    metadata: n,
                    communicator: s,
                    callback: i
                } = e;
                switch (t) {
                    case "scw":
                        return new ey({
                            metadata: n,
                            callback: i,
                            communicator: s
                        });
                    case "walletlink":
                        return new tj({
                            metadata: n,
                            callback: i
                        })
                }
            }({
                signerType: e,
                metadata: this.metadata,
                communicator: this.communicator,
                callback: this.emit.bind(this)
            })
        }
    }

    function tQ(e) {
        if (e) {
            if (!["all", "smartWalletOnly", "eoaOnly"].includes(e.options)) throw Error(`Invalid options: ${e.options}`);
            if (e.attribution && void 0 !== e.attribution.auto && void 0 !== e.attribution.dataSuffix) throw Error("Attribution cannot contain both auto and dataSuffix properties")
        }
    }
    class tX {
        constructor(e) {
            this.metadata = {
                appName: e.appName || "Dapp",
                appLogoUrl: e.appLogoUrl || function() {
                    let e = document.querySelector('link[sizes="192x192"]') || document.querySelector('link[sizes="180x180"]') || document.querySelector('link[rel="icon"]') || document.querySelector('link[rel="shortcut icon"]'),
                        {
                            protocol: t,
                            host: n
                        } = document.location,
                        s = e ? e.getAttribute("href") : null;
                    return !s || s.startsWith("javascript:") || s.startsWith("vbscript:") ? `${t}//${n}/favicon.ico` : s.startsWith("http://") || s.startsWith("https://") || s.startsWith("data:") ? s : s.startsWith("//") ? t + s : `${t}//${n}${s}`
                }(),
                appChainIds: e.appChainIds || []
            }, this.storeLatestVersion(), tV()
        }
        makeWeb3Provider(e = {
            options: "all"
        }) {
            var t;
            tQ(e);
            let n = {
                metadata: this.metadata,
                preference: e
            };
            return null != (t = eu(n)) ? t : new tY(n)
        }
        getCoinbaseWalletLogo(e, t = 240) {
            let n;
            switch (e) {
                case "standard":
                default:
                    return n = t, `data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;
                case "circle":
                    return n = t, `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;
                case "text":
                    return n = (.1 * t).toFixed(2), `data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
                case "textWithLogo":
                    return n = (.25 * t).toFixed(2), `data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;
                case "textLight":
                    return n = (.1 * t).toFixed(2), `data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
                case "textWithLogoLight":
                    return n = (.25 * t).toFixed(2), `data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`
            }
        }
        storeLatestVersion() {
            new i("CBWSDK").setItem("VERSION", ec)
        }
    }
    e.s(["default", 0, tX], 260714), e.i(260714);
    let t0 = {
        options: "all"
    };
    e.s(["CoinbaseWalletSDK", 0, tX, "createCoinbaseWalletSDK", 0, function(e) {
        var t;
        new i("CBWSDK").setItem("VERSION", ec), tV();
        let n = {
            metadata: {
                appName: e.appName || "Dapp",
                appLogoUrl: e.appLogoUrl || "",
                appChainIds: e.appChainIds || []
            },
            preference: Object.assign(t0, null != (t = e.preference) ? t : {})
        };
        tQ(n.preference);
        let s = null;
        return {
            getProvider: () => {
                var e;
                let t;
                return s || (s = null != (e = eu(t = {
                    metadata: n.metadata,
                    preference: n.preference
                })) ? e : new tY(t)), s
            }
        }
    }, "default", 0, tX], 570899)
}]);

//# debugId=2107310d-230c-d93d-0bb1-1d3eea0a4c08